summaryrefslogtreecommitdiffstats
path: root/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_std.py
diff options
context:
space:
mode:
authorYaroslav Brustinov <ybrustin@cisco.com>2016-03-14 12:00:16 +0200
committerYaroslav Brustinov <ybrustin@cisco.com>2016-03-14 12:00:16 +0200
commit22e06f3c3532890ad336341c279012afc0710a9d (patch)
tree429b84bf6977c37c111bfc61834eb4ccb7f3709f /scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_std.py
parente07322a708dabf6ba50abc32e7c5cc6f6491ba32 (diff)
regression: stl speedup (fix)
Diffstat (limited to 'scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_std.py')
-rw-r--r--scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_std.py31
1 files changed, 16 insertions, 15 deletions
diff --git a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_std.py b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_std.py
index d582b499..6c101fbb 100644
--- a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_std.py
+++ b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_std.py
@@ -5,26 +5,15 @@ from trex_stl_packet_builder_scapy import *
# will destroy all streams/data on the ports
def stl_map_ports (client, ports = None):
# by default use all ports
- if ports == None:
+ if ports is None:
ports = client.get_all_ports()
- # reset the ports
- client.reset(ports)
-
- # generate streams
- base_pkt = CScapyTRexPktBuilder(pkt = Ether()/IP())
-
- # send something initial to calm down switches with arps etc.
- stream = STLStream(packet = base_pkt,
- mode = STLTXSingleBurst(pps = 100000, total_pkts = 1))
- client.add_streams(stream, ports)
-
- client.start(ports, mult = "50%")
- client.wait_on_traffic(ports)
- client.reset(ports)
+ stl_send_3_pkts(client, ports)
tx_pkts = {}
pkts = 1
+ base_pkt = CScapyTRexPktBuilder(pkt = Ether()/IP())
+
for port in ports:
tx_pkts[pkts] = port
stream = STLStream(packet = base_pkt,
@@ -75,3 +64,15 @@ def stl_map_ports (client, ports = None):
return table
+# reset ports and send 3 packets from each acquired port
+def stl_send_3_pkts(client, ports = None):
+
+ base_pkt = CScapyTRexPktBuilder(pkt = Ether()/IP())
+ stream = STLStream(packet = base_pkt,
+ mode = STLTXSingleBurst(pps = 100000, total_pkts = 3))
+
+ client.reset(ports)
+ client.add_streams(stream, ports)
+ client.start(ports, mult = "50%")
+ client.wait_on_traffic(ports)
+ client.reset(ports)