Skip to contentSkip to conversation

selftests: drv-net: fix skip for unsupported devices

PATCH In review Nimrod Oren 2 participants 2 messages Jan 19 – Jan 20

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 selftests: drv-net: fix skip for unsupported devices

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")
---
 .../selftests/drivers/net/hw/rss_flow_label.py        | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
tools/testing/selftests/drivers/net/hw/rss_flow_label.py +8 -3
index 6fa95fe27c47..7dc80070884a 100755
@@ -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)
Signature · 1 line
2.45.0
maintainer
#1 lore raw
Quoted 2 lines · On Mon, 19 Jan 2026 11:13:03 +0200 Nimrod Oren wrote:

The test_rss_flow_label_6only test case fails instead of skipping on devices that don't support IPv6 flow label hashing.

HW tests can just fail if something is not supported.
You can repost against net-next without the Fixes tag if you care deeply but I want to very much prioritize ease of writing these tests. IOW there's no practical difference in "SKIP" vs "error + EOPNOTSUPP"

We care about crashes and regressions, primarily.

Signature · 1 line
pw-bot: cr