summaryrefslogtreecommitdiffstats
path: root/scripts/automation/trex_control_plane/stl/trex_stl_lib
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/automation/trex_control_plane/stl/trex_stl_lib')
-rw-r--r--scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py7
1 files changed, 5 insertions, 2 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 391b2076..d209cd64 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
@@ -408,13 +408,16 @@ class Port(object):
"force": force}
rc = self.transmit("start_traffic", params)
- if rc.bad():
- return self.err(rc.err())
+ # must set this before to avoid race with the async response
self.state = self.STATE_TX
+ if rc.bad():
+ self.state = self.STATE_IDLE
+ return self.err(rc.err())
return self.ok()
+
# stop traffic
# with force ignores the cached state and sends the command
@owned