trex: Enforce 10 iterations for RFC2544 tput 71/42071/1
authorMartin Klozik <martinx.klozik@intel.com>
Fri, 15 Sep 2017 13:57:35 +0000 (14:57 +0100)
committerMartin Klozik <martinx.klozik@intel.com>
Fri, 15 Sep 2017 13:57:35 +0000 (14:57 +0100)
This patch enforces 10 iterations during search
for besti RFC2544 Throughput with 0% packet loss. Unless
0% packet loss is detected during first iteration
with initial frame rate.

JIRA: VSPERF-530

Change-Id: I99e49e9dbf4e1424253d0cfec804819516c00df8
Signed-off-by: Martin Klozik <martinx.klozik@intel.com>
Reviewed-by: Al Morton <acmorton@att.com>
Reviewed-by: Christian Trautman <ctrautma@redhat.com>
Reviewed-by: Sridhar Rao <sridhar.rao@spirent.com>
Reviewed-by: Trevor Cooper <trevor.cooper@intel.com>
Reviewed-by: Martin Goldammer <martin.goldammer6@gmail.com>
tools/pkt_gen/trex/trex.py

index ae26230..e8ed42f 100644 (file)
@@ -284,7 +284,9 @@ class Trex(ITrafficGenerator):
         right = traffic['frame_rate']
         center = traffic['frame_rate']
 
-        while num_test <= tests:
+        # execute 10 iterations to find out best tput with 0% packet loss
+        # unless 0% packet loss is detected for initial frame_rate
+        while num_test <= 10:
             test_lossrate = ((stats["total"]["opackets"] - stats["total"]
                               ["ipackets"]) * 100) / stats["total"]["opackets"]
             self._logger.debug("Iteration: %s, frame rate: %s, throughput_rx_fps: %s, frame_loss_percent: %s",