public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] selftests: drv-net: fix skip for unsupported devices
@ 2026-01-19  9:13 Nimrod Oren
  2026-01-20 23:56 ` Jakub Kicinski
  0 siblings, 1 reply; 2+ messages in thread
From: Nimrod Oren @ 2026-01-19  9:13 UTC (permalink / raw)
  To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Shuah Khan, Joe Damato, Willem de Bruijn
  Cc: netdev, linux-kselftest, linux-kernel, Nimrod Oren, Gal Pressman

The test_rss_flow_label_6only test case fails instead of skipping on
devices that don't support IPv6 flow label hashing.
While test_rss_flow_label properly checks for flow label support and
raises KsftSkipEx, test_rss_flow_label_6only was missing this check.

Fixes: 26dbe030ff08 ("selftests: drv-net: add test for RSS on flow label")
Reviewed-by: Gal Pressman <gal@nvidia.com>
Signed-off-by: Nimrod Oren <noren@nvidia.com>
---
 .../selftests/drivers/net/hw/rss_flow_label.py        | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/tools/testing/selftests/drivers/net/hw/rss_flow_label.py b/tools/testing/selftests/drivers/net/hw/rss_flow_label.py
index 6fa95fe27c47..7dc80070884a 100755
--- a/tools/testing/selftests/drivers/net/hw/rss_flow_label.py
+++ b/tools/testing/selftests/drivers/net/hw/rss_flow_label.py
@@ -145,9 +145,14 @@ def test_rss_flow_label_6only(cfg):
 
     # Try to enable Flow Labels and check again, in case it leaks thru
     initial = _ethtool_get_cfg(cfg, "udp6")
-    changed = initial.replace("l", "") if "l" in initial else initial + "l"
-
-    cmd(f"ethtool -N {cfg.ifname} rx-flow-hash udp6 {changed}")
+    no_lbl = initial.replace("l", "")
+    if "l" not in initial:
+        try:
+            cmd(f"ethtool -N {cfg.ifname} rx-flow-hash udp6 l{no_lbl}")
+        except CmdExitFailure as exc:
+            raise KsftSkipEx("Device doesn't support Flow Label for UDP6") from exc
+    else:
+        cmd(f"ethtool -N {cfg.ifname} rx-flow-hash udp6 {no_lbl}")
     restore = defer(cmd, f"ethtool -N {cfg.ifname} rx-flow-hash udp6 {initial}")
 
     _check_v4_flow_types(cfg)
-- 
2.45.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-01-20 23:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-19  9:13 [PATCH net] selftests: drv-net: fix skip for unsupported devices Nimrod Oren
2026-01-20 23:56 ` Jakub Kicinski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox