selftests: mlxsw: Increase burst size for burst test
authorIdo Schimmel <idosch@mellanox.com>
Sun, 23 Aug 2020 08:06:25 +0000 (11:06 +0300)
committerDavid S. Miller <davem@davemloft.net>
Tue, 25 Aug 2020 00:36:11 +0000 (17:36 -0700)
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 <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
tools/testing/selftests/drivers/net/mlxsw/devlink_trap_policer.sh

index ecba9ab..508a702 100755 (executable)
@@ -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)