...`, causing a failure on such hardware. The patch changes that line to `raise KsftSkipEx("Device has fewer than 3 queues (or doesn't support queue stats)")`, correctly converting the intended skip into an actual skip. - Exact change: In `tools/testing/selftests/drivers/net/hw/rss_ctx.py:121`, replace a bare `KsftSkipEx(...)` construction with `raise KsftSkipEx(...)`. - Impacted flow: `test_rss_key_indir()` computes `qcnt = len(_get_rx_cnts(cfg))` and then checks `if qcnt < 3`. Previously, because the exception wasn’t raised, the function continued into operations that require at least 3 queues (e.g., `ethtool(f"-X {cfg.ifname} equal 3 hkey ...")`, `tools/testing/selftests/drivers/net/hw/rss_ctx.py:143`), yielding spurious failures on devices with <3 queues. - User-visible failure mode: Matches the commit message’s “Before” case where `ethtool -X ... equal 3 ...` fails due to insufficient queues instead of the test printing a TAP SKIP. - Correctness with harness: Raising `KsftSkipEx` is the established mechanism for skipping tests; the ksft runner handles it and prints “ok ... # SKIP ...” (see `tools/testing/selftests/net/lib/py/ksft.py:255`, which catches `KsftSkipEx` and produces a SKIP result). The fix aligns `rss_ctx.py` with that contract. - Consistency with other tests: Numerous selftests use `raise KsftSkipEx(...)` for capability-based skips, e.g. `tools/testing/selftests/drivers/net/stats.py:34` and `tools/testing/selftests/drivers/net/hw/rss_api.py:21`. The change in `rss_ctx.py` brings it in line with common practice across the tree. - Scope and risk: Single-line change in selftests only; no kernel code or ABI touched. Very low regression risk and no side effects on runtime or API. - Containment: Only affects the `drv-net` selftest path and only the behavior when devices have <3 queues (or when qstats-based queue enumeration leads to that conclusion). It does not alter any test logic beyond ensuring the intended early skip is actually executed. - No architectural changes: The patch does not introduce new features or rework logic—just corrects an exception handling mistake. - Stable criteria fit: - Fixes a real bug in the selftest (false failures on common hardware configurations). - Minimal, targeted change with negligible risk. - Improves CI/test reliability for stable users without affecting the kernel. - No new dependencies or features. - Security considerations: None—selftests only; no exposure to kernel paths or privilege boundaries. - Backport breadth: Safe to apply to maintained stable trees that include `tools/testing/selftests/drivers/net/hw/rss_ctx.py` and the ksft Python harness (which already defines and handles `KsftSkipEx` as seen in `tools/testing/selftests/net/lib/py/ksft.py:22` and `tools/testing/selftests/net/lib/py/ksft.py:255`). - Note on commit message: There’s no Fixes tag, but the rationale and diff are clear and meet stable rules for a small, correctness-only test fix. tools/testing/selftests/drivers/net/hw/rss_ctx.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/drivers/net/hw/rss_ctx.py b/tools/testing/selftests/drivers/net/hw/rss_ctx.py index 7bb552f8b1826..9838b8457e5a6 100755 --- a/tools/testing/selftests/drivers/net/hw/rss_ctx.py +++ b/tools/testing/selftests/drivers/net/hw/rss_ctx.py @@ -118,7 +118,7 @@ def test_rss_key_indir(cfg): qcnt = len(_get_rx_cnts(cfg)) if qcnt < 3: - KsftSkipEx("Device has fewer than 3 queues (or doesn't support queue stats)") + raise KsftSkipEx("Device has fewer than 3 queues (or doesn't support queue stats)") data = get_rss(cfg) want_keys = ['rss-hash-key', 'rss-hash-function', 'rss-indirection-table'] -- 2.51.0[PATCH AUTOSEL 6.17-6.12] selftests: drv-net: rss_ctx: fix the queue count checkSasha Levin undefinedpatches@lists.linux.dev, stable@vger.kernel.org undefined undefined undefined undefined undefined undefined undefined undefined undefined