From ced349e749efcd129943544812bc607238879383 Mon Sep 17 00:00:00 2001
From: Christian Trautman <ctrautma@redhat.com>
Date: Thu, 20 Apr 2017 15:28:01 -0400
Subject: xena_duration_fix: Revert xena continuous to port time limits

Revert xena continuous traffic to port based time limits as
packet limits have an uppers bounds which could be reached
with small packet sizes and longer durations.

JIRA: VSPERF-507

Change-Id: I56986159643344f7872e311590f7d05ac02b038b
Signed-off-by: Christian Trautman <ctrautma@redhat.com>
---
 tools/pkt_gen/xena/xena.py | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

(limited to 'tools')

diff --git a/tools/pkt_gen/xena/xena.py b/tools/pkt_gen/xena/xena.py
index 2601a7c3..26d26542 100755
--- a/tools/pkt_gen/xena/xena.py
+++ b/tools/pkt_gen/xena/xena.py
@@ -422,13 +422,6 @@ class Xena(ITrafficGenerator):
             stream.set_on()
             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(is_on=True)
             port.set_port_arp_reply(is_on=True, ipv6=True)
@@ -447,7 +440,7 @@ class Xena(ITrafficGenerator):
                 self._params['traffic']['l2']['framesize'])
             stream.set_packet_payload('incrementing', '0x00')
             stream.set_payload_id(payload_id)
-            port.set_port_time_limit(0)
+            port.set_port_time_limit(self._duration)
 
             if self._params['traffic']['l2']['framesize'] == 64:
                 # set micro tpld
-- 
cgit