Commit b36cca02 authored by Ido Schimmel's avatar Ido Schimmel Committed by David S. Miller

selftests: mlxsw: Increase burst size for burst test

The current combination of rate and burst size does not adhere to
Spectrum-{2,3} limitation which states that the minimum burst size
should be 40% of the rate.

Increase the burst size in order to honor above mentioned limitation and
avoid intermittent failures of this test case on Spectrum-{2,3}.

Remove the first sub-test case as the variation in number of received
packets is simply too large to reliably test it.
Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8e0d8ce4
......@@ -288,35 +288,12 @@ __burst_test()
RET=0
devlink trap policer set $DEVLINK_DEV policer $id rate 1000 burst 32
devlink trap policer set $DEVLINK_DEV policer $id rate 1000 burst 512
devlink trap group set $DEVLINK_DEV group l3_drops policer $id
# Send a burst of 64 packets and make sure that about 32 are received
# and the rest are dropped by the policer
log_info "=== Tx burst size: 64, Policer burst size: 32 pps ==="
t0_rx=$(devlink_trap_rx_packets_get blackhole_route)
t0_drop=$(devlink_trap_policer_rx_dropped_get $id)
start_traffic $h1 192.0.2.1 198.51.100.100 $rp1_mac -c 64
t1_rx=$(devlink_trap_rx_packets_get blackhole_route)
t1_drop=$(devlink_trap_policer_rx_dropped_get $id)
rx=$((t1_rx - t0_rx))
pct=$((100 * (rx - 32) / 32))
((-20 <= pct && pct <= 20))
check_err $? "Expected burst size of 32 packets, got $rx packets, which is $pct% off. Required accuracy is +-20%"
log_info "Expected burst size of 32 packets, measured burst size of $rx packets"
drop=$((t1_drop - t0_drop))
(( drop > 0 ))
check_err $? "Expected non-zero policer drops, got 0"
log_info "Measured policer drops of $drop packets"
# Send a burst of 16 packets and make sure that 16 are received
# and that none are dropped by the policer
log_info "=== Tx burst size: 16, Policer burst size: 32 pps ==="
log_info "=== Tx burst size: 16, Policer burst size: 512 ==="
t0_rx=$(devlink_trap_rx_packets_get blackhole_route)
t0_drop=$(devlink_trap_policer_rx_dropped_get $id)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment