Skip to content

Commit b36cca0

Browse files
idoschdavem330
authored andcommitted
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: Ido Schimmel <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 8e0d8ce commit b36cca0

File tree

1 file changed

+2
-25
lines changed

1 file changed

+2
-25
lines changed

tools/testing/selftests/drivers/net/mlxsw/devlink_trap_policer.sh

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -288,35 +288,12 @@ __burst_test()
288288

289289
RET=0
290290

291-
devlink trap policer set $DEVLINK_DEV policer $id rate 1000 burst 32
291+
devlink trap policer set $DEVLINK_DEV policer $id rate 1000 burst 512
292292
devlink trap group set $DEVLINK_DEV group l3_drops policer $id
293293

294-
# Send a burst of 64 packets and make sure that about 32 are received
295-
# and the rest are dropped by the policer
296-
log_info "=== Tx burst size: 64, Policer burst size: 32 pps ==="
297-
298-
t0_rx=$(devlink_trap_rx_packets_get blackhole_route)
299-
t0_drop=$(devlink_trap_policer_rx_dropped_get $id)
300-
301-
start_traffic $h1 192.0.2.1 198.51.100.100 $rp1_mac -c 64
302-
303-
t1_rx=$(devlink_trap_rx_packets_get blackhole_route)
304-
t1_drop=$(devlink_trap_policer_rx_dropped_get $id)
305-
306-
rx=$((t1_rx - t0_rx))
307-
pct=$((100 * (rx - 32) / 32))
308-
((-20 <= pct && pct <= 20))
309-
check_err $? "Expected burst size of 32 packets, got $rx packets, which is $pct% off. Required accuracy is +-20%"
310-
log_info "Expected burst size of 32 packets, measured burst size of $rx packets"
311-
312-
drop=$((t1_drop - t0_drop))
313-
(( drop > 0 ))
314-
check_err $? "Expected non-zero policer drops, got 0"
315-
log_info "Measured policer drops of $drop packets"
316-
317294
# Send a burst of 16 packets and make sure that 16 are received
318295
# and that none are dropped by the policer
319-
log_info "=== Tx burst size: 16, Policer burst size: 32 pps ==="
296+
log_info "=== Tx burst size: 16, Policer burst size: 512 ==="
320297

321298
t0_rx=$(devlink_trap_rx_packets_get blackhole_route)
322299
t0_drop=$(devlink_trap_policer_rx_dropped_get $id)

0 commit comments

Comments
 (0)