summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Klozik <martinx.klozik@intel.com>2017-01-24 07:56:48 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-01-24 07:56:48 +0000
commit14c3ad198f680fb1477f59af79fccc72e1ad8389 (patch)
tree2d5835242d09a4d622328d0c44840c250c09d535
parent76ac721519246949968b7b6fadcdd8642021e5b0 (diff)
parent3aa4a6fab319a1e532eb8bb963a4632bc37797ef (diff)
Merge "xena_cont_learning: Adds learning preemption to continuous traffic"
-rw-r--r--conf/03_traffic.conf5
-rw-r--r--conf/10_custom.conf5
-rw-r--r--docs/configguide/trafficgen.rst13
-rw-r--r--tools/pkt_gen/xena/XenaDriver.py9
-rwxr-xr-xtools/pkt_gen/xena/xena.py9
5 files changed, 41 insertions, 0 deletions
diff --git a/conf/03_traffic.conf b/conf/03_traffic.conf
index 72324660..4931e977 100644
--- a/conf/03_traffic.conf
+++ b/conf/03_traffic.conf
@@ -374,6 +374,11 @@ TRAFFICGEN_XENA_2544_TPUT_VALUE_RESOLUTION = '0.5'
TRAFFICGEN_XENA_2544_TPUT_USEPASS_THRESHHOLD = 'false'
TRAFFICGEN_XENA_2544_TPUT_PASS_THRESHHOLD = '0.0'
+# Xena Continuous traffic options
+# Please reference xena documentation before making changes to these settings
+TRAFFICGEN_XENA_CONT_PORT_LEARNING_ENABLED = True
+TRAFFICGEN_XENA_CONT_PORT_LEARNING_DURATION = 3
+
# Xena Configuration -- END
###########################
diff --git a/conf/10_custom.conf b/conf/10_custom.conf
index 498ac29f..ece733d9 100644
--- a/conf/10_custom.conf
+++ b/conf/10_custom.conf
@@ -88,6 +88,11 @@ TRAFFICGEN_XENA_2544_TPUT_VALUE_RESOLUTION = '0.5'
TRAFFICGEN_XENA_2544_TPUT_USEPASS_THRESHHOLD = 'false'
TRAFFICGEN_XENA_2544_TPUT_PASS_THRESHHOLD = '0.0'
+# Xena Continuous traffic options
+# Please reference xena documentation before making changes to these settings
+TRAFFICGEN_XENA_CONT_PORT_LEARNING_ENABLED = True
+TRAFFICGEN_XENA_CONT_PORT_LEARNING_DURATION = 3
+
###################################################
# MoonGen Configuration and Connection Info-- BEGIN
diff --git a/docs/configguide/trafficgen.rst b/docs/configguide/trafficgen.rst
index 5190bc8e..b66a1787 100644
--- a/docs/configguide/trafficgen.rst
+++ b/docs/configguide/trafficgen.rst
@@ -516,6 +516,19 @@ Each value modifies the behavior of rfc 2544 throughput testing. Refer to your
Xena documentation to understand the behavior changes in modifying these
values.
+Continuous Traffic Testing
+~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Xena continuous traffic by default does a 3 second learning preemption to allow
+the DUT to receive learning packets before a continuous test is performed. If
+a custom test case requires this learning be disabled, you can disable the option
+or modify the length of the learning by modifying the following settings.
+
+.. code-block:: console
+
+ TRAFFICGEN_XENA_CONT_PORT_LEARNING_ENABLED = False
+ TRAFFICGEN_XENA_CONT_PORT_LEARNING_DURATION = 3
+
MoonGen
-------
diff --git a/tools/pkt_gen/xena/XenaDriver.py b/tools/pkt_gen/xena/XenaDriver.py
index 04a99e9d..e144514f 100644
--- a/tools/pkt_gen/xena/XenaDriver.py
+++ b/tools/pkt_gen/xena/XenaDriver.py
@@ -57,6 +57,7 @@ CMD_LOGOFF = 'c_logoff'
CMD_OWNER = 'c_owner'
CMD_PORT = ';Port:'
CMD_PORT_IP = 'p_ipaddress'
+CMD_PORT_LEARNING = 'p_autotrain'
CMD_RESERVE = 'p_reservation reserve'
CMD_RELEASE = 'p_reservation release'
CMD_RELINQUISH = 'p_reservation relinquish'
@@ -560,6 +561,14 @@ class XenaPort(object):
"on" if on else "off"), self)
return self._manager.driver.ask_verify(command)
+ def set_port_learning(self, interval):
+ """Start port learning with the interval in seconds specified. 0 disables port learning
+ :param: interval as int
+ :return: Boolean True if response OK, False if error.
+ """
+ command = make_port_command('{} {}'.format(CMD_PORT_LEARNING, interval), self)
+ return self._manager.driver.ask_verify(command)
+
def set_port_ip(self, ip_addr, cidr, gateway, wild='255'):
"""
Set the port ip address of the specific port
diff --git a/tools/pkt_gen/xena/xena.py b/tools/pkt_gen/xena/xena.py
index 20577e8d..f5415d52 100755
--- a/tools/pkt_gen/xena/xena.py
+++ b/tools/pkt_gen/xena/xena.py
@@ -383,6 +383,15 @@ class Xena(ITrafficGenerator):
# Clear port configuration for a clean start
self.xmanager.ports[0].reset_port()
self.xmanager.ports[1].reset_port()
+ if settings.getValue('TRAFFICGEN_XENA_CONT_PORT_LEARNING_ENABLED'):
+ # turn on port learning
+ self.xmanager.ports[0].set_port_learning(1)
+ self.xmanager.ports[1].set_port_learning(1)
+ sleep(settings.getValue('TRAFFICGEN_XENA_CONT_PORT_LEARNING_DURATION'))
+ # turn off port learning
+ self.xmanager.ports[0].set_port_learning(0)
+ self.xmanager.ports[1].set_port_learning(0)
+ sleep(1)
self.xmanager.ports[0].clear_stats()
self.xmanager.ports[1].clear_stats()