🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #10079

Re: [PATCH net] selftests: drv-net: pause: Skip support tests without link autonegotiation

#10079
From: netdev-bot+sashiko
Date: Tue, 03 Nov 2026 05:37
130 lines
12833 bytes
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
Technical Details
Message-ID: <179368424817.488856.1260070865221347541@kernel.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-355234-linux-kernel-netdev=dewy.ru
References: <20261030173516.1002250-1-mohsin.bashr@gmail.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-355234-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net] selftests: drv-net: pause: Skip support tests without
 link autonegotiation
Date: Tue, 03 Nov 2026 05:37:28 +0000
Organization: Usenet Network
Message-ID: <179368424817.488856.1260070865221347541@kernel.org>
References: <20261030173516.1002250-1-mohsin.bashr@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="3102437"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:2Vzh5uUNNTHKTR9daq3WmksRWrw= sha256:2w2g96+zJX0JF0gGrDe7PGmWorR3zDlscchnUlinw6A=
	sha1:I/zVJo1wayyLv4S3/+UpzImm4Mw= sha256:OvRhJqCC1IcsTZhnbhQWgR2seGnyoHZVK8ZpFg0NYG8=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 5387B11270B; Tue,  3 Nov 2026 08:38:04 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.401
X-Spam-Status: No, score=-3.401 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=kernel.org
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id zukNJ9Le53sk;
	Tue,  3 Nov 2026 08:38:01 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-355234-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id CAA7810E9A8; Tue,  3 Nov 2026 08:37:51 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id A31502C546; Tue,  3 Nov 2026 05:37:31 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1793684251;
	b=AMAR95vIkK1tX5p61+oScF64+BM7gywHIoFLfjmjU1ymoiictjRaqLeCWK5HuhFnnICB
	 eH+eAI0cqfe7+rfo1T0izv1duwzJEhmmvbujivAU9E6P0/kT/XkNzxwa8ocx+nYS2bV8a
	 iOO8RloTgCSceyAeG2euhujDlH//Jo2aIU01alzDC3ETdAg7w1jFUZlE3QdGKuz7e/grG
	 1u6UQKCVvItdx9eDHHhKgChae/uxCMG+c3U/4SyoNkISdlksZBOixldYlD8s3S/Xxhyv6
	 UUGfk/xBqKHG5shs5shDnM4daXnCwY48o0fu+Y4BmJnq1xjJS1AbkC2iRVDe5NVVzGA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793684251;
	h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc:
	 Date:Message-ID:In-Reply-To:References:X-sashiko-severity:
	 Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id:
	 List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
	 Precedence:MIME-Version;
	bh=Z9N045PGX72xkHaVesJTSxEo5HdRSWDD+P7HKyru9AE=;
	b=IbEz0TWZqfjjKaG00dr6k8RzdaU6tvkhxZiLR4lITX4yKUj4GAOZ9rJatK65axkPvgeu
	 W/+Qo2fE/ujv5qwAQS64O3dkCcp0i2K+BNI766zHZQAVbL7obd027flXA/hYmqAq8Orar
	 yLx96PzpzDBUT9Uu8aoPf0DUIsVwgw+p/6uvRAZRqLJ+Ni3wfIOhc6iPteDfnNeAYXm3b
	 q2JqIrS5hccdaUp/UW4ILGFWILDcJ7jjoQWKAHxN88Y5q0dkwSz7XPb4lYPQJVM0C7HT4
	 xBsOMLE4D7FEkXUbHBbLRa9Sx1bPziPIfQnjPEQBQdunUtr+Nn9UrKzI17wARuDXMtg==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=fxZDhmJD;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id E7384606A33D;
	Tue,  3 Nov 2026 05:37:30 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=fxZDhmJD
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1793684250;
	b=S0gvpgun81W4HHGg/6a8QGhlOp5WH5iQ/6Cma7xJfVZQj+7sn6cLLNNxeTcpidIA704W
	 fUiNpCGNl2UVMR38JMa6Gupq+MZfS9sEOhNLg0O6xKif/J0Dca/okxUQybUvMS+WSLidg
	 3kaalcO0tHKJnelicyP0uPkvaMAvT8N7aHSWlo3rEs3Sho9KXSICQNLS8WSQmFjmZk3EE
	 n1qAuk9zA9pSQgmXWsHhxztrAMwQk0qWkeu4Rt/X8umXlL7SClpP83wKfoWDvYIOjwiEp
	 BnpDEPyY0exFXyxwXEucn7/UCLy3BbAc9A3zLd9LnrioID93QMJWNrZ/n+k7ic5SVTQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793684250;
	h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID:
	 In-Reply-To:References:X-sashiko-severity:Content-Type:
	 Content-Transfer-Encoding:MIME-Version;
	bh=Z9N045PGX72xkHaVesJTSxEo5HdRSWDD+P7HKyru9AE=;
	b=asIT0HdK/gqbk21eWuMGYHkrIXi2LdTVe8w9h+uxvMdoeYt0l9iln5PLsPhkJSb6LYG/
	 vNy7FRQyIg2Ryox2B8fa9ZfYEq3MHWmnIQpEdrqAGwM3TYTYLMGrdY7ThyDE4GZ27lgjM
	 kubuzfoQ6o9DdsZr01Zo688Ls3UiqKRnRswj90ogaObfwmNpzxu+jo9zCjqh7ts+729t4
	 BhgcbQ/dzUcC4dW/WMGgSakK/hVc4vcl3RVmi1btSJ4cIwle3fQAcmAnM1gn66NQNBARE
	 uZ4rusRferV6h1+aWSjTwrSohysRCgMnLvqTISvb83TKOGosce97EXpddENY6dm/Y5g==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=fxZDhmJD;
	arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id B68B2606A32E;
	Tue,  3 Nov 2026 05:37:29 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id A3FBB1F000C1;
	Tue,  3 Nov 2026 05:37:28 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1793684249;
	bh=Z9N045PGX72xkHaVesJTSxEo5HdRSWDD+P7HKyru9AE=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=fxZDhmJDNgRkKuV+/q/ETsgBgdTezFC5dL54nTcUZSNJKF6wHleyKFQaecX6MqT4g
	 LZJ7vMFd5AkEs3KbKy6gn+VDH2Kg5eB2BbRQ77CPUBP7i5ODD4e9IXCkRCAtcplFje
	 1oTMxLOhFWjODDYq2T6vKjTyl+MOVd6stGmArTngl1MbvbHTZZwaZhCAp8b1U255lj
	 RH/3k7cHlawE8jiZvVwytCbAvro6g4rsn5dnrg5+Z5StuMvuIbmhMZsHQqmVSGodCA
	 OXh356L09rVispOj/3PTtcobSipo8ZO0fFwtLyfInvL60/CeXPHykHJXA+gzNESIBu
	 q/wmq6i/rlUfw==
X-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
X-In-Reply-To: <20261030173516.1002250-1-mohsin.bashr@gmail.com>
X-sashiko-severity: High
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list