selftests: mlxsw: Decrease required rate accuracy
authorIdo Schimmel <idosch@mellanox.com>
Sun, 23 Aug 2020 08:06:23 +0000 (11:06 +0300)
committerDavid S. Miller <davem@davemloft.net>
Tue, 25 Aug 2020 00:36:11 +0000 (17:36 -0700)
On Spectrum-{2,3} the required accuracy is +/-10%.

Align the test to this requirement so that it can reliably pass on these
platforms.

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 47edf099a17e6d90e22b68c9e0e0fc5f5cb256f5..bd4ffed1cca30ad7e2b68c4a798ad7036f8cde81 100755 (executable)
@@ -220,8 +220,8 @@ __rate_test()
 
        rate=$(trap_rate_get)
        pct=$((100 * (rate - 1000) / 1000))
-       ((-5 <= pct && pct <= 5))
-       check_err $? "Expected rate 1000 pps, got $rate pps, which is $pct% off. Required accuracy is +-5%"
+       ((-10 <= pct && pct <= 10))
+       check_err $? "Expected rate 1000 pps, got $rate pps, which is $pct% off. Required accuracy is +-10%"
        log_info "Expected rate 1000 pps, measured rate $rate pps"
 
        drop_rate=$(policer_drop_rate_get $id)