[PATCH net-next v2 7/9] selftests: drivers: hw: replace counter upper limit with UINT32_MAX in rmon test

From: Ioana Ciornei

Date: Thu Mar 12 2026 - 10:28:02 EST


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@xxxxxxx>
---
Changes in v2:
- patch is new

tools/testing/selftests/drivers/net/hw/ethtool_rmon.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/drivers/net/hw/ethtool_rmon.sh b/tools/testing/selftests/drivers/net/hw/ethtool_rmon.sh
index 636429018b6b..1baaaab3c3a4 100755
--- a/tools/testing/selftests/drivers/net/hw/ethtool_rmon.sh
+++ b/tools/testing/selftests/drivers/net/hw/ethtool_rmon.sh
@@ -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()
--
2.25.1