summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorIdo Barnea <ibarnea@cisco.com>2017-03-09 11:53:37 +0200
committerIdo Barnea <ibarnea@cisco.com>2017-03-09 11:53:37 +0200
commitf48443a11497c9a38c1aa3df42741e4a55ac780f (patch)
treeffa6219c03937e4edfc42c83ead7e60050a9ee99 /scripts
parentd8a541a28d09ecc85629f29a57db8a4be1fe526c (diff)
trex-370. Added --no-hw-flow-stat command line option
Signed-off-by: Ido Barnea <ibarnea@cisco.com>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/automation/trex_control_plane/stl/examples/stl_flow_stats.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/scripts/automation/trex_control_plane/stl/examples/stl_flow_stats.py b/scripts/automation/trex_control_plane/stl/examples/stl_flow_stats.py
index 3c630ece..f6336bf0 100644
--- a/scripts/automation/trex_control_plane/stl/examples/stl_flow_stats.py
+++ b/scripts/automation/trex_control_plane/stl/examples/stl_flow_stats.py
@@ -68,6 +68,7 @@ def rx_iteration (c, tx_port, rx_port, total_pkts, pkt_len):
tx_pkts = flow_stats['tx_pkts'].get(tx_port, 0)
tx_bytes = flow_stats['tx_bytes'].get(tx_port, 0)
rx_pkts = flow_stats['rx_pkts'].get(rx_port, 0)
+ rx_bytes = flow_stats['rx_bytes'].get(rx_port, 0)
if c.get_warnings():
print("\n\n*** test had warnings ****\n\n")
@@ -96,6 +97,15 @@ def rx_iteration (c, tx_port, rx_port, total_pkts, pkt_len):
else:
print("RX pkts match - {0}".format(rx_pkts))
+ # On x710, by default rx_bytes will be 0. See manual for details.
+ # If you use x710, and need byte count, run the TRex server with --no-hw-flow-stat
+ if rx_bytes != 0:
+ if rx_bytes != total_pkts * pkt_len:
+ print("RX bytes mismatch - got: {0}, expected: {1}".format(rx_bytes, (total_pkts * pkt_len)))
+ pprint.pprint(flow_stats)
+ ret = False
+ else:
+ print("RX bytes match - {0}".format(rx_bytes))
for field in ['rx_err', 'tx_err']:
for port in global_flow_stats['global'][field].keys():