summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierrick Louin <pierrick.louin@orange.com>2020-10-13 18:24:12 +0200
committerAlec Hothan <ahothan@cisco.com>2020-10-17 14:56:24 +0000
commitd04f640acaf5d0f1bd5fa2c4a645900c8bd34f5b (patch)
tree346ce0b13aa319df9c2bec27be317d427dc78d82
parent77ad6af4cc10aece9fac24eef1a01c50979cb3d2 (diff)
NFVBENCH-183: Correct a very old bug - revealed with python3 - when traffic is unidirectional (while checking pps rate)
Change-Id: I55fd64915c647a3a6b2b85bf30ecc69af620f420 Signed-off-by: Pierrick Louin <pierrick.louin@orange.com>
-rw-r--r--nfvbench/traffic_gen/trex_gen.py17
1 files changed, 11 insertions, 6 deletions
diff --git a/nfvbench/traffic_gen/trex_gen.py b/nfvbench/traffic_gen/trex_gen.py
index f5c2afb..85331b2 100644
--- a/nfvbench/traffic_gen/trex_gen.py
+++ b/nfvbench/traffic_gen/trex_gen.py
@@ -869,8 +869,10 @@ class TRex(AbstractTrafficGenerator):
chain_count)
break
- # if the capture from the TRex console was started before the arp request step,
- # it keeps 'service_mode' enabled, otherwise, it disables the 'service_mode'
+ # A traffic capture may have been started (from a T-Rex console) at this time.
+ # If asked so, we keep the service mode enabled here, and disable it otherwise.
+ # | Disabling the service mode while a capture is in progress
+ # | would cause the application to stop/crash with an error.
if not self.config.service_mode:
self.client.set_service_mode(ports=self.port_handle, enabled=False)
if len(arp_dest_macs) == len(self.port_handle):
@@ -889,7 +891,8 @@ class TRex(AbstractTrafficGenerator):
total_rate += int(r['rate_pps'])
else:
mult = 1
- total_rate = utils.convert_rates(l2frame_size, rates[0], intf_speed)
+ r = utils.convert_rates(l2frame_size, rates[0], intf_speed)
+ total_rate = int(r['rate_pps'])
# rate must be enough for latency stream and at least 1 pps for base stream per chain
required_rate = (self.LATENCY_PPS + 1) * self.config.service_chain_count * mult
result = utils.convert_rates(l2frame_size,
@@ -1020,8 +1023,10 @@ class TRex(AbstractTrafficGenerator):
if self.capture_id:
self.client.stop_capture(capture_id=self.capture_id['id'])
self.capture_id = None
- # if the capture from TRex console was started before the connectivity step,
- # it keeps 'service_mode' enabled, otherwise, it disables the 'service_mode'
+ # A traffic capture may have been started (from a T-Rex console) at this time.
+ # If asked so, we keep the service mode enabled here, and disable it otherwise.
+ # | Disabling the service mode while a capture is in progress
+ # | would cause the application to stop/crash with an error.
if not self.config.service_mode:
self.client.set_service_mode(ports=self.port_handle, enabled=False)
@@ -1036,5 +1041,5 @@ class TRex(AbstractTrafficGenerator):
pass
def set_service_mode(self, enabled=True):
- """Enable/disable the 'service_mode'."""
+ """Enable/disable the 'service' mode."""
self.client.set_service_mode(ports=self.port_handle, enabled=enabled)