pkt_gen: MoonGen should use class object for line rate calc 51/18251/2
authorbmichalo <bmichalo@redhat.com>
Tue, 9 Aug 2016 15:52:36 +0000 (11:52 -0400)
committerbmichalo <bmichalo@redhat.com>
Tue, 9 Aug 2016 16:00:54 +0000 (12:00 -0400)
Instead of hard coding line speed numbers for rate calcuation,
MoonGen should use its class object initialized at start time.

JIRA: VSPERF-368

Change-Id: I68c688f8c244df16d98cfd15efabf491a317256b
Signed-off-by: bmichalo <bmichalo@redhat.com>
tools/pkt_gen/moongen/moongen.py

index 1d2fdee..0638fce 100644 (file)
@@ -502,7 +502,7 @@ class Moongen(ITrafficGenerator):
         if results_match and parameters_match and num_traffic_streams:
             # Assume for now 10G link speed
             max_theoretical_fps = (
-                num_traffic_streams * (10000000000 / 8) / (frame_size + 20))
+                num_traffic_streams * (self._moongen_line_speed / 8) / (frame_size + 20))
 
             moongen_results[ResultsConstants.THROUGHPUT_RX_FPS] = (
                 float(results_match.group(6)) * 1000000)