[SRU][J][PATCH 0/2] selftests: net: veth: fix compatibility with older ethtool versions (LP: #2136734)

Massimiliano Pellizzer massimiliano.pellizzer at canonical.com
Wed Dec 17 13:11:27 UTC 2025


BugLink: https://bugs.launchpad.net/bugs/2136734

[ Impact ]

The veth.sh selftest fails on Focal systems running 5.15 hwe kernel
due to incompatibilities with older ethtool version shipped in Focal.

Two specific failures occur:
1. The test command "ethtool -K veth$DST generic-receive-offload on"
   fails with "ethtool: bad command line argument(s)" because ethtool 5.4
   does not recognize the long form feature name with the -K option.
2. The chk_channels() function incorrectly reports failures for combined
   channels because ethtool 5.4 outputs '0' for unsupported channels while
   the test expects 'n/a'.

These failures occur even when the underlying kernel functionality being
tested works correctly, causing false negatives in the test suite.

[ Fix ]

Use the short form 'gro' instead of 'generic-receive-offload' when
setting features with ethtool -K. The short form is compatible with
both old and new ethtool versions, while the long form only works with
newer versions for the -K operation.

Modify the chk_channels() function to accept both 'n/a' and '0' as valid
values for unsupported combined channels. This accommodates the
different output formats between ethtool versions while maintaining the
correct validation logic.

Both fixes are purely compatibility changes that do not alter the test
logic or the kernel functionality being tested.

[ Test Plan ]

Test ubuntu_kselftest_net net:veth.sh on both Jammy 5.15 and Focal 5.15 kernels.
The expected output is the following:

# selftests: net: veth.sh
# default - gro flag ok
# - peer gro flag ok
# - tso flag ok
# - peer tso flag ok
# - aggregation ok
# - aggregation with TSO off ok
# with gro on - gro flag ok
# - peer gro flag ok
# - tso flag ok
# - peer tso flag ok
# - aggregation with TSO off ok
# gro vs xdp while down - gro flag on ok
# - after down ok
# - after xdp off ok
# - after up ok
# - after peer xdp ok
# default channels ok
# with gro enabled on link down - gro flag ok
# - peer gro flag ok
# - tso flag ok
# - peer tso flag ok
# - aggregation with TSO off ok
# setting tx channels ok
# setting both rx and tx channels ok
# bad setting: combined channels ok
# setting invalid channels nr ok
# bad setting: XDP with RX nr less than TX ok
# bad setting: reducing RX nr below peer TX with XDP set ok
# bad setting: increasing peer TX nr above RX with XDP set ok
# setting invalid channels nr ok
# with xdp attached - gro flag ok
# - peer gro flag ok
# - tso flag ok
# - peer tso flag ok
# - no aggregation ok
# - gro flag with GRO on ok
# - aggregation ok
# - after dev off, flag ok
# - peer flag ok
# - after gro on xdp off, gro flag ok
# - peer gro flag ok
# - tso flag ok
# - peer tso flag ok
# decreasing tx channels with device down ok
# - aggregation ok
# increasing tx channels with device down ok
# aggregation again with default and TSO off ok
ok 7 selftests: net: veth.sh

[ Regression Potential ]

The patchset only modify the selftest script and do not change any
kernel code. The changes improve compatibility with different ethtool
versions by using universally supported feature names and accepting
multiple valid output formats. In case of a regression, it would only
affect test execution, not kernel functionality.

[ Other Info ]

The bug affects all Focal's 5.15 kernels.
In order to fix them all the patchset has been submitted for Jammy.

Massimiliano Pellizzer (2):
  selftests: net: veth: use short form gro for ethtool -K
  selftests: net: veth: accept 0 for unsupported combined channels

 tools/testing/selftests/net/veth.sh | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

-- 
2.51.0




More information about the kernel-team mailing list