summaryrefslogtreecommitdiffstats
path: root/tools/pkt_gen/xena
diff options
context:
space:
mode:
authorChristian Trautman <ctrautma@redhat.com>2017-01-23 13:33:56 -0500
committerChristian Trautman <ctrautma@redhat.com>2017-01-23 13:33:56 -0500
commit3aa4a6fab319a1e532eb8bb963a4632bc37797ef (patch)
treeb465d9c98e80fbaae44a735943aec0d01b7d1f4d /tools/pkt_gen/xena
parent605742c4e23f8aa199395dea96d5758dc2616093 (diff)
xena_cont_learning: Adds learning preemption to continuous traffic
Adds a configurable learning preemptive option when running xena continuous traffic tests. This resolves a missing packet or two when running OVS tests at flow rates that should not drop packets. JIRA: VSPERF-473 Change-Id: I056578ed9c9181287d97aea55a002f09aac14e81 Signed-off-by: Christian Trautman <ctrautma@redhat.com>
Diffstat (limited to 'tools/pkt_gen/xena')
-rw-r--r--tools/pkt_gen/xena/XenaDriver.py9
-rwxr-xr-xtools/pkt_gen/xena/xena.py9
2 files changed, 18 insertions, 0 deletions
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()