aboutsummaryrefslogtreecommitdiffstats
path: root/tools/pkt_gen/xena/xena.py
diff options
context:
space:
mode:
authorChristian Trautman <ctrautma@redhat.com>2016-11-21 09:28:41 -0500
committerChristian Trautman <ctrautma@redhat.com>2016-11-21 09:32:27 -0500
commit04a0e5c51eb28e11c3337fc3b85fc16167c4af95 (patch)
treebb9d2f37cc27e5725db86341e0acb36623946aff /tools/pkt_gen/xena/xena.py
parent1356d7c2bccabdd6239d1ae8628f869556ed2938 (diff)
Xena_cont_accuracy: Modify continuous from duration to packet limit
First of a few patches planned to help increase Xena continuous traffic accuracy. Modifies port limits to packet calculated limits versus time based limits which can be wildly inaccurate. Also modifies some port settings to be more inline with how rfc2544 settings are applied on Xena. Increased time delay by one second to allow packets to finish transmitting before stat collection occurs. JIRA: VSPerf-423 Change-Id: I214b13d743a84a0733e885ccfc5bdd57812d7104 Signed-off-by: Christian Trautman <ctrautma@redhat.com>
Diffstat (limited to 'tools/pkt_gen/xena/xena.py')
-rwxr-xr-xtools/pkt_gen/xena/xena.py22
1 files changed, 18 insertions, 4 deletions
diff --git a/tools/pkt_gen/xena/xena.py b/tools/pkt_gen/xena/xena.py
index 8d45053e..798bb832 100755
--- a/tools/pkt_gen/xena/xena.py
+++ b/tools/pkt_gen/xena/xena.py
@@ -421,7 +421,20 @@ class Xena(ITrafficGenerator):
:return: None
"""
stream.set_on()
- stream.set_packet_limit(packet_limit)
+ if packet_limit != -1:
+ stream.set_packet_limit(packet_limit)
+ else:
+ speed = port.get_port_speed() / 8 # convert to bytes
+ gap = port.get_inter_frame_gap()
+ pkt_size = self._params['traffic']['l2']['framesize']
+ packets = int(((speed / (pkt_size + gap)) * self._duration) *
+ (self._params['traffic']['frame_rate'] / 100))
+ stream.set_packet_limit(packets)
+
+ port.set_port_arp_reply(on=True)
+ port.set_port_arp_reply(on=True, v6=True)
+ port.set_port_ping_reply(on=True)
+ port.set_port_ping_reply(on=True, v6=True)
stream.set_rate_fraction(
10000 * self._params['traffic']['frame_rate'])
@@ -431,10 +444,11 @@ class Xena(ITrafficGenerator):
'ETHERNET VLAN IP UDP' if self._params['traffic']['vlan'][
'enabled'] else 'ETHERNET IP UDP')
stream.set_packet_length(
- 'fixed', self._params['traffic']['l2']['framesize'], 16383)
+ 'fixed', self._params['traffic']['l2']['framesize'],
+ self._params['traffic']['l2']['framesize'])
stream.set_packet_payload('incrementing', '0x00')
stream.set_payload_id(payload_id)
- port.set_port_time_limit(self._duration * 1000000)
+ port.set_port_time_limit(0)
if self._params['traffic']['l2']['framesize'] == 64:
# set micro tpld
@@ -459,7 +473,7 @@ class Xena(ITrafficGenerator):
if not self.xmanager.ports[1].traffic_on():
self._logger.error(
"Failure to start port 1. Check settings and retry.")
- sleep(self._duration)
+ sleep(self._duration + 1)
# getting results
if self._params['traffic']['bidir'] == 'True':
# need to aggregate out both ports stats and assign that data