]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
selftests: drivers: hw: replace counter upper limit with UINT32_MAX in rmon test
authorIoana Ciornei <ioana.ciornei@nxp.com>
Mon, 30 Mar 2026 15:29:30 +0000 (18:29 +0300)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 2 Apr 2026 10:11:04 +0000 (12:11 +0200)
The ethtool_rmon.sh script checks that the number of packets sent /
received during a test matches the expected value with a 1% tolerance.

Since in the next patches this test will gain the capability to also be
run on systems with a single interface where the traffic generator is
accesible through ssh, use the UINT32_MAX as the upper limit. This is
necessary since the same interface will be used also for control traffic
(the ssh commands) as well as the mausezahn generated one.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Reviewed-by: Petr Machata <petrm@nvidia.com>
Link: https://patch.msgid.link/20260330152933.2195885-7-ioana.ciornei@nxp.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
tools/testing/selftests/drivers/net/hw/ethtool_rmon.sh

index 80e75b9b40fd543da7cd2ddd3fc819130b8c509f..f290ce1832f12b16ad847dc12f143355d1f77497 100755 (executable)
@@ -12,6 +12,7 @@ NUM_NETIFS=2
 lib_dir=$(dirname "$0")
 source "$lib_dir"/../../../net/forwarding/lib.sh
 
+UINT32_MAX=$((2**32 - 1))
 ETH_FCS_LEN=4
 ETH_HLEN=$((6+6+2))
 
@@ -64,8 +65,7 @@ bucket_test()
 
        expected=$([ "$set" = rx ] && echo "$num_rx" || echo "$num_tx")
 
-       # Allow some extra tolerance for other packets sent by the stack
-       [ "$delta" -ge "$expected" ] && [ "$delta" -le $((expected + 100)) ]
+       [ "$delta" -ge "$expected" ] && [ "$delta" -le "$UINT32_MAX" ]
 }
 
 rmon_histogram()