From: netdev-bot+sashiko@kernel.org
To: mohsin.bashr@gmail.com
Cc: netdev@vger.kernel.org, linux-kselftest@vger.kernel.org,
linux-kernel@vger.kernel.org, andrew+netdev@lunn.ch,
davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org,
pabeni@redhat.com, shuah@kernel.org,
maxime.chevallier@bootlin.com
Subject: Re: [PATCH net] selftests: drv-net: pause: Skip support tests without link autonegotiation
Date: Tue, 03 Nov 2026 05:37:28 +0000 [thread overview]
Message-ID: <179368424817.488856.1260070865221347541@kernel.org> (raw)
In-Reply-To: <20261030173516.1002250-1-mohsin.bashr@gmail.com>
Thank you for your contribution! Sashiko AI review found 2 potential
issue(s) to consider.
Critical: 0 · High: 1 · Medium: 1 · Low: 0
If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).
- [High] The fix is incomplete.
- [Medium] The new require_link_autoneg(cfg) call in pause_test_support()
(pause.py:469) now runs before pause_setup()'s guard for devices that…
--
selftests: drv-net: pause: Skip support tests without link autonegotiation
This commit calls require_link_autoneg() before pause_setup() in
pause_test_support(), so the test is skipped when either interface lacks
link autonegotiation. The goal is to stop cleanup failures on fbnic, where
the deferred restore of unchanged link settings returns EOPNOTSUPP.
> diff --git a/tools/testing/selftests/drivers/net/hw/pause.py b/tools/testing/selftests/drivers/net/hw/pause.py
> index ca4a55e59c30f..1537f88e0e77e 100755
> --- a/tools/testing/selftests/drivers/net/hw/pause.py
> +++ b/tools/testing/selftests/drivers/net/hw/pause.py
> @@ -466,6 +466,7 @@ def pause_test_support(cfg, pauseparams):
> supported fields.
> """
>
> + require_link_autoneg(cfg)
[Severity: Medium]
Can this turn a SKIP into a failure on devices that don't report link
modes?
require_link_autoneg() reads the JSON key directly for both interfaces,
without checking that it exists:
def require_link_autoneg(cfg):
...
if not ethtool(f"{cfg.ifname}", json=True)[0]["supports-auto-negotiation"]:
...
if not ethtool(f"{cfg.remote_ifname}",
json=True, host=cfg.remote)[0]["supports-auto-negotiation"]:
ethtool fills both "auto-negotiation" and "supports-auto-negotiation" from
the same LINKMODES_GET reply. If the driver has no get_link_ksettings,
ethtool still exits 0, but the JSON has neither key.
Before this patch, pause_test_support() reached this guard in pause_setup()
and skipped:
link = ethtool(f"{cfg.ifname}", json=True)[0]
if "auto-negotiation" not in link:
raise KsftSkipEx(f"{cfg.ifname} doesn't report its link modes")
With this patch, require_link_autoneg() runs first and raises KeyError.
ksft_run() catches that and reports a failure for all four variants.
The other callers of require_link_autoneg() first go through the
require_pause_supported helpers. Those check "supported-pause-frame-use"
from the same reply. pause_test_support() is the only caller that has no
earlier guard.
Would using .get("supports-auto-negotiation") avoid this? Checking for the
key and skipping would also work.
> pause_setup(cfg)
[Severity: High]
Does this fully fix the fbnic CI failure described in the commit message?
pause_setup() always defers a restore of the current link settings. It
does this for both the local and the remote interface, even when nothing
will change those settings:
if link["auto-negotiation"]:
defer(cmd, f"ethtool -s {cfg.ifname} autoneg on")
elif "speed" in link and "duplex" in link:
defer(cmd, f"ethtool -s {cfg.ifname} autoneg off speed {link['speed']} "
f"duplex {link['duplex'].lower()}")
pause_advertising_test() and pause_aneg_resolution() still call
pause_setup() without a require_link_autoneg() check:
pause_advertising_test():
require_pause_supported_allof(cfg, pauseparams["linkmodes"])
pause_setup(cfg)
lp = controllable_lp(cfg)
pause_aneg_resolution():
require_pause_supported_allof(cfg, required_local_linkmodes)
require_peer_pause_supported_allof(cfg, required_remote_linkmodes)
pause_setup(cfg)
require_controllable_lp(cfg)
fbnic has .get_link_ksettings, but it has no .set_link_ksettings and no
.nway_reset.
Take the "RX off TX off" variant of pause_advertising_test(). Its linkmodes
list is empty, so the support check passes, and then:
pause_advertising_test()
pause_setup()
defer(cmd, "ethtool -s ... autoneg off speed X duplex Y")
controllable_lp()
ethtool -r -> EOPNOTSUPP
raise KsftSkipEx(...)
ksft_flush_defer()
ethtool -s -> EOPNOTSUPP
KSFT_RESULT = False
The result is "not ok ... # SKIP", and ksft_exit() returns 1.
pause_aneg_resolution() takes the same path through
require_controllable_lp(), for example in the all-off/all-off variant.
controllable_lp() also does not cache a result when it skips. Every later
test runs ethtool -r again and fails the same way.
Would it be better to add require_link_autoneg() to these two tests? The
other option is for pause_setup() to defer the link-settings restore only
when it actually changes the link settings.
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261030173516.1002250-1-mohsin.bashr%40gmail.com
prev parent reply other threads:[~2026-11-03 5:37 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-30 17:35 Mohsin Bashir
2026-10-30 17:54 ` Maxime Chevallier
2026-10-30 18:39 ` Mohsin Bashir
2026-10-30 20:12 ` Andrew Lunn
2026-11-02 16:58 ` Mohsin Bashir
2026-11-03 5:37 ` netdev-bot+sashiko [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=179368424817.488856.1260070865221347541@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=maxime.chevallier@bootlin.com \
--cc=mohsin.bashr@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=shuah@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®