aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--conf/02_vswitch.conf4
-rw-r--r--conf/03_traffic.conf9
-rw-r--r--conf/10_custom.conf9
-rw-r--r--docs/configguide/trafficgen.rst19
-rw-r--r--tools/hugepages.py43
-rwxr-xr-xtools/pkt_gen/xena/xena.py11
-rw-r--r--tools/pkt_gen/xena/xena_json.py16
7 files changed, 96 insertions, 15 deletions
diff --git a/conf/02_vswitch.conf b/conf/02_vswitch.conf
index e5736138..81632d56 100644
--- a/conf/02_vswitch.conf
+++ b/conf/02_vswitch.conf
@@ -101,9 +101,9 @@ VSWITCH_BRIDGE_NAME = 'br0'
HUGEPAGE_DIR = '/dev/hugepages'
# If no hugepages are available, try to allocate HUGEPAGE_RAM_ALLOCATION.
-# Default is 2 x 1048576 = 2097152 kB.
+# Default is 10 GB.
# 10 GB (10485760 kB) or more is recommended for PVP & PVVP testing scenarios.
-HUGEPAGE_RAM_ALLOCATION = 2097152
+HUGEPAGE_RAM_ALLOCATION = 10485760
# Sets OVS PMDs core mask to 30 for affinitization to 5th and 6th CPU core.
# Note that the '0x' notation should not be used.
diff --git a/conf/03_traffic.conf b/conf/03_traffic.conf
index a5a8629d..fd0f589d 100644
--- a/conf/03_traffic.conf
+++ b/conf/03_traffic.conf
@@ -179,6 +179,15 @@ TRAFFICGEN_XENA_PORT1_IP = '192.168.199.11'
TRAFFICGEN_XENA_PORT1_CIDR = 24
TRAFFICGEN_XENA_PORT1_GATEWAY = '192.168.199.1'
+# Xena RFC 2544 options
+# Please reference xena documentation before making changes to these settings
+TRAFFICGEN_XENA_2544_TPUT_INIT_VALUE = '10.0'
+TRAFFICGEN_XENA_2544_TPUT_MIN_VALUE = '0.1'
+TRAFFICGEN_XENA_2544_TPUT_MAX_VALUE = '100.0'
+TRAFFICGEN_XENA_2544_TPUT_VALUE_RESOLUTION = '0.5'
+TRAFFICGEN_XENA_2544_TPUT_USEPASS_THRESHHOLD = 'false'
+TRAFFICGEN_XENA_2544_TPUT_PASS_THRESHHOLD = '0.0'
+
###################################################
# MoonGen Configuration and Connection Info-- BEGIN
diff --git a/conf/10_custom.conf b/conf/10_custom.conf
index fdb5031a..b3707149 100644
--- a/conf/10_custom.conf
+++ b/conf/10_custom.conf
@@ -79,6 +79,15 @@ TRAFFICGEN_XENA_PORT1_IP = '192.168.199.11'
TRAFFICGEN_XENA_PORT1_CIDR = 24
TRAFFICGEN_XENA_PORT1_GATEWAY = '192.168.199.1'
+# Xena RFC 2544 options
+# Please reference xena documentation before making changes to these settings
+TRAFFICGEN_XENA_2544_TPUT_INIT_VALUE = '10.0'
+TRAFFICGEN_XENA_2544_TPUT_MIN_VALUE = '0.1'
+TRAFFICGEN_XENA_2544_TPUT_MAX_VALUE = '100.0'
+TRAFFICGEN_XENA_2544_TPUT_VALUE_RESOLUTION = '0.5'
+TRAFFICGEN_XENA_2544_TPUT_USEPASS_THRESHHOLD = 'false'
+TRAFFICGEN_XENA_2544_TPUT_PASS_THRESHHOLD = '0.0'
+
###################################################
# MoonGen Configuration and Connection Info-- BEGIN
diff --git a/docs/configguide/trafficgen.rst b/docs/configguide/trafficgen.rst
index 939b6cad..c323ae9d 100644
--- a/docs/configguide/trafficgen.rst
+++ b/docs/configguide/trafficgen.rst
@@ -373,6 +373,25 @@ set to allow for proper connections to the chassis.
TRAFFICGEN_XENA_MODULE1 = ''
TRAFFICGEN_XENA_MODULE2 = ''
+RFC2544 Throughput Testing
+~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Xena traffic generator testing for rfc2544 throughput can be modified for
+different behaviors if needed. The default options for the following are
+optimized for best results.
+
+.. code-block:: console
+
+ TRAFFICGEN_XENA_2544_TPUT_INIT_VALUE = '10.0'
+ TRAFFICGEN_XENA_2544_TPUT_MIN_VALUE = '0.1'
+ TRAFFICGEN_XENA_2544_TPUT_MAX_VALUE = '100.0'
+ TRAFFICGEN_XENA_2544_TPUT_VALUE_RESOLUTION = '0.5'
+ TRAFFICGEN_XENA_2544_TPUT_USEPASS_THRESHHOLD = 'false'
+ TRAFFICGEN_XENA_2544_TPUT_PASS_THRESHHOLD = '0.0'
+
+Each value modifies the behavior of rfc 2544 throughput testing. Refer to your
+Xena documentation to understand the behavior changes in modifying these
+values.
MoonGen
-------
diff --git a/tools/hugepages.py b/tools/hugepages.py
index 02e4f29c..bba40122 100644
--- a/tools/hugepages.py
+++ b/tools/hugepages.py
@@ -26,7 +26,7 @@ from tools import tasks
from conf import settings
_LOGGER = logging.getLogger(__name__)
-
+_allocated_hugepages = False
#
# hugepage management
#
@@ -53,23 +53,39 @@ def allocate_hugepages():
"""Allocate hugepages on the fly
"""
hp_size = get_hugepage_size()
-
if hp_size > 0:
- nr_hp = int(math.ceil(settings.getValue('HUGEPAGE_RAM_ALLOCATION')/hp_size))
- _LOGGER.info('Will allocate %s hugepages.', nr_hp)
+ nr_hp = int(math.ceil(settings.getValue('HUGEPAGE_RAM_ALLOCATION')/hp_size))
+ _LOGGER.info('Will allocate %s hugepages.', nr_hp)
+
+ nr_hugepages = 'vm.nr_hugepages=' + str(nr_hp)
+ try:
+ tasks.run_task(['sudo', 'sysctl', nr_hugepages],
+ _LOGGER, 'Trying to allocate hugepages..', True)
+ except subprocess.CalledProcessError:
+ _LOGGER.error('Unable to allocate hugepages.')
+ return False
+ global _allocated_hugepages
+ _allocated_hugepages = True
+ return True
- nr_hugepages = 'vm.nr_hugepages=' + str(nr_hp)
+ else:
+ _LOGGER.error('Division by 0 will be supported in next release')
+ return False
+
+def deallocate_hugepages():
+ """De-allocate hugepages that were allocated on the fly
+ """
+ global _allocated_hugepages
+ if _allocated_hugepages:
+ nr_hugepages = 'vm.nr_hugepages= 0'
try:
tasks.run_task(['sudo', 'sysctl', nr_hugepages],
- _LOGGER, 'Trying to allocate hugepages..', True)
+ _LOGGER, 'Trying to de-allocate hugepages..', True)
except subprocess.CalledProcessError:
- _LOGGER.error('Unable to allocate hugepages.')
+ _LOGGER.error('Unable to de-allocate hugepages.')
return False
- return True
-
- else:
- _LOGGER.error('Division by 0 will be supported in next release')
- return False
+ _allocated_hugepages = False
+ return True
def get_free_hugepages(socket=None):
@@ -178,4 +194,5 @@ def umount_hugepages():
except subprocess.CalledProcessError:
_LOGGER.error('Unable to umount hugepages.')
-
+ if not deallocate_hugepages():
+ _LOGGER.error('Unable to deallocate previously allocated hugepages.')
diff --git a/tools/pkt_gen/xena/xena.py b/tools/pkt_gen/xena/xena.py
index 449ef5b4..8d45053e 100755
--- a/tools/pkt_gen/xena/xena.py
+++ b/tools/pkt_gen/xena/xena.py
@@ -309,6 +309,17 @@ class Xena(ITrafficGenerator):
duration=self._duration, micro_tpld=True if self._params[
'traffic']['l2']['framesize'] == 64 else False)
j_file.enable_throughput_test()
+ j_file.modify_2544_tput_options(
+ settings.getValue('TRAFFICGEN_XENA_2544_TPUT_INIT_VALUE'),
+ settings.getValue('TRAFFICGEN_XENA_2544_TPUT_MIN_VALUE'),
+ settings.getValue('TRAFFICGEN_XENA_2544_TPUT_MAX_VALUE'),
+ settings.getValue(
+ 'TRAFFICGEN_XENA_2544_TPUT_VALUE_RESOLUTION'),
+ settings.getValue(
+ 'TRAFFICGEN_XENA_2544_TPUT_USEPASS_THRESHHOLD'),
+ settings.getValue(
+ 'TRAFFICGEN_XENA_2544_TPUT_PASS_THRESHHOLD')
+ )
elif testtype == '2544_b2b':
j_file.set_test_options_back2back(
diff --git a/tools/pkt_gen/xena/xena_json.py b/tools/pkt_gen/xena/xena_json.py
index 2a15a932..1ce7b46f 100644
--- a/tools/pkt_gen/xena/xena_json.py
+++ b/tools/pkt_gen/xena/xena_json.py
@@ -233,6 +233,22 @@ class XenaJSON(object):
self.json_data['TestOptions']['TestTypeOptionMap']['Throughput'][
'Enabled'] = 'true'
+ def modify_2544_tput_options(self, initial_value, minimum_value,
+ maximum_value, value_resolution,
+ use_pass_threshhold, pass_threshhold):
+ self.json_data['TestOptions']['TestTypeOptionMap']['Throughput'][
+ 'RateIterationOptions']['InitialValue'] = initial_value
+ self.json_data['TestOptions']['TestTypeOptionMap']['Throughput'][
+ 'RateIterationOptions']['MinimumValue'] = minimum_value
+ self.json_data['TestOptions']['TestTypeOptionMap']['Throughput'][
+ 'RateIterationOptions']['MaximumValue'] = maximum_value
+ self.json_data['TestOptions']['TestTypeOptionMap']['Throughput'][
+ 'RateIterationOptions']['ValueResolution'] = value_resolution
+ self.json_data['TestOptions']['TestTypeOptionMap']['Throughput'][
+ 'RateIterationOptions']['UsePassThreshold'] = use_pass_threshhold
+ self.json_data['TestOptions']['TestTypeOptionMap']['Throughput'][
+ 'RateIterationOptions']['PassThreshold'] = pass_threshhold
+
def set_chassis_info(self, hostname, pwd):
"""
Set the chassis info