summaryrefslogtreecommitdiffstats
path: root/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py')
-rw-r--r--scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py
index d209cd64..be46e95f 100644
--- a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py
+++ b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py
@@ -406,13 +406,15 @@ class Port(object):
"mul": mul,
"duration": duration,
"force": force}
-
- rc = self.transmit("start_traffic", params)
-
+
# must set this before to avoid race with the async response
+ last_state = self.state
self.state = self.STATE_TX
+
+ rc = self.transmit("start_traffic", params)
+
if rc.bad():
- self.state = self.STATE_IDLE
+ self.state = last_state
return self.err(rc.err())
return self.ok()