Skip to content

Commit

Permalink
selftests: drivers: hw: Fix ethtool_rmon
Browse files Browse the repository at this point in the history
When rx-pktsNtoM reports a range that involves very low-valued range, such
as 0-64, the calculated length of the packet will be -4, because FCS is
subtracted from the value. mausezahn then confuses the value for an option
and bails out. As a result, the test dumps many mausezahn error messages.

Instead, cap the value at 0. mausezahn will use an appropriate minimum
packet length.

Cc: Vladimir Oltean <vladimir.oltean@nxp.com>
Cc: Tobias Waldekranz <tobias@waldekranz.com>
Signed-off-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
  • Loading branch information
Petr Machata authored and Paolo Abeni committed Apr 16, 2024
1 parent 4929761 commit 042db63
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tools/testing/selftests/drivers/net/hw/ethtool_rmon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ bucket_test()
# Mausezahn does not include FCS bytes in its length - but the
# histogram counters do
len=$((len - ETH_FCS_LEN))
len=$((len > 0 ? len : 0))

before=$(ethtool --json -S $iface --groups rmon | \
jq -r ".[0].rmon[\"${set}-pktsNtoM\"][$bucket].val")
Expand Down

0 comments on commit 042db63

Please sign in to comment.