Article View: linux.kernel.netdev
Article #22327Re: [PATCH net-next v3 2/5] net: rnpgbe: Report link settings through ethtool
From: netdev-bot+sashiko
Date: Wed, 25 Nov 2026 06:36
Date: Wed, 25 Nov 2026 06:36
195 lines
15162 bytes
15162 bytes
Thank you for your contribution! Sashiko AI review found 4 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 2 · Low: 2
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).
- [Medium] rnpgbe_setup_default_link() builds the PHY_LINK_SET
advertisement as hw->link_config.supported & RNPGBE_DEFAULT_ADV, where…
- [Medium] rnpgbe_add_adapter() now calls rnpgbe_init_link_config(),
which sends GET_LANE_STATUS (0x0610) through mucse_mbx_get_link() and…
- [Low] The commit message leaves out some changes in the patch.
- [Low] ST_STATUS_MDIX_MASK is GENMASK(11, 10), a 2-bit field that can
hold 0-3.
--
net: rnpgbe: Report link settings through ethtool
This commit adds get_link_ksettings support. It reports supported and
advertised link modes, autoneg, port type and PHY address, all taken
from a new GET_LANE_STATUS firmware query made at probe time. It also
changes the default link setup: TP ports now autonegotiate, and fibre
and backplane ports are forced to 1 Gb/s full duplex.
> Add get_link_ksettings support to report supported and advertised
> link modes, autonegotiation, port type and PHY address. Report copper,
> fibre and backplane link modes from firmware, with autonegotiation
> support on copper ports.
[Severity: Low]
This isn't a bug, but could the commit message also mention a few
changes it doesn't describe?
Probe now sends the new GET_LANE_STATUS command, and probe fails if that
command returns an error.
mucse_mbx_fw_req_handler() now decodes ST_STATUS_MDIX_MASK from
LINK_CHANGE_EVT. get_link_ksettings reports eth_tp_mdix and
eth_tp_mdix_ctrl.
In rnpgbe_setup_default_link(), the TP default advertisement is no
longer the fixed RNPGBE_DEFAULT_ADV mask. It is now
supported & RNPGBE_DEFAULT_ADV.
> diff --git a/drivers/net/ethernet/mucse/rnpgbe/rnpgbe_chip.c b/drivers/net/ethernet/mucse/rnpgbe/rnpgbe_chip.c
> index dcc8233e024e1..3a2f62f0630da 100644
> --- a/drivers/net/ethernet/mucse/rnpgbe/rnpgbe_chip.c
> +++ b/drivers/net/ethernet/mucse/rnpgbe/rnpgbe_chip.c
> @@ -64,12 +64,42 @@ int rnpgbe_reset_hw(struct mucse_hw *hw)
> * rnpgbe_setup_default_link - Configure the default link settings
> * @hw: hardware information structure
> *
> + * The default configuration relies on GET_LANE_STATUS reporting at least
> + * one mode in RNPGBE_DEFAULT_ADV for TP ports and RNPGBE_FW_ADV_1000_FULL
> + * for fibre and backplane ports. TP ports use the supported subset of the
> + * default mask for autonegotiation. Fibre and backplane use fixed 1 Gb/s
> + * full duplex.
> + *
> * Return: 0 on success, negative errno on failure
> **/
> int rnpgbe_setup_default_link(struct mucse_hw *hw)
> {
> - return mucse_mbx_set_link(hw, RNPGBE_DEFAULT_ADV, true, 0, 0,
> - ETH_TP_MDI_AUTO);
> + u32 advertising = hw->link_config.supported & RNPGBE_DEFAULT_ADV;
> + bool autoneg = hw->link_config.status & MUCSE_LINK_TP;
> + u8 duplex = DUPLEX_UNKNOWN;
> + u32 speed = SPEED_UNKNOWN;
> + int err;
> +
> + if (!autoneg) {
> + advertising &= RNPGBE_FW_ADV_1000_FULL;
> + speed = SPEED_1000;
> + duplex = DUPLEX_FULL;
> + }
> +
> + err = mucse_mbx_set_link(hw, advertising, autoneg,
> + autoneg ? 0 : speed, autoneg ? 0 : duplex,
> + ETH_TP_MDI_AUTO);
[Severity: Medium]
What happens if advertising is 0 at this point?
The kernel-doc above states the assumption, but nothing checks it. Take
a TP port where firmware reports none of the RNPGBE_DEFAULT_ADV modes.
Autoneg is requested with advertising == 0. On ACK,
MUCSE_LINK_AUTONEG and advertising = 0 are cached, and probe still
succeeds.
Could the link then stay down forever, with nothing logged?
Now take a fibre or backplane port whose supported mask lacks
RNPGBE_FW_ADV_1000_FULL. 1000/Full is still forced and cached. Then in
rnpgbe_get_link_ksettings():
if (supported & RNPGBE_FW_ADV_1000_FULL)
linkmode_set_bit(mode, cmd->link_modes.supported);
...
if (cmd->base.autoneg == AUTONEG_DISABLE) {
cmd->base.speed = hw->link_config.speed;
cmd->base.duplex = hw->link_config.duplex;
}
Would ethtool then show speed 1000 without listing 1000baseX or
1000baseKX as a supported mode?
The old code always advertised the full RNPGBE_DEFAULT_ADV mask,
whatever firmware reported. The later patch "net: rnpgbe: Support copper
link configuration" rejects an empty autoneg advertisement in
set_link_ksettings. This default path still has no such check.
[ ... ]
> diff --git a/drivers/net/ethernet/mucse/rnpgbe/rnpgbe_main.c b/drivers/net/ethernet/mucse/rnpgbe/rnpgbe_main.c
> index 46981ef2542ad..31871b244882d 100644
> --- a/drivers/net/ethernet/mucse/rnpgbe/rnpgbe_main.c
> +++ b/drivers/net/ethernet/mucse/rnpgbe/rnpgbe_main.c
[ ... ]
> @@ -258,6 +260,11 @@ static int rnpgbe_add_adapter(struct pci_dev *pdev,
> dev_err(&pdev->dev, "Hw reset failed %d\n", err);
> goto err_powerdown;
> }
> + err = rnpgbe_init_link_config(hw);
> + if (err) {
> + dev_err(&pdev->dev, "Get link capabilities failed %d\n", err);
> + goto err_powerdown;
> + }
[Severity: Medium]
Will the device still probe if its firmware doesn't implement
GET_LANE_STATUS (0x0610), or rejects it?
The call chain is:
rnpgbe_init_link_config()
mucse_mbx_get_link()
mucse_fw_send_cmd_wait_resp()
This returns -ETIMEDOUT if no reply with a matching opcode arrives. It
returns -EIO if the reply has a non-zero error_code. Either error jumps
to err_powerdown, so no netdev is registered.
There is no fallback to the old defaults, and the commit message doesn't
give a minimum firmware version.
Does every firmware version this driver binds to support
GET_LANE_STATUS?
[ ... ]
> diff --git a/drivers/net/ethernet/mucse/rnpgbe/rnpgbe_mbx_fw.c b/drivers/net/ethernet/mucse/rnpgbe/rnpgbe_mbx_fw.c
> index 4a18937927514..469818b83d70f 100644
> --- a/drivers/net/ethernet/mucse/rnpgbe/rnpgbe_mbx_fw.c
> +++ b/drivers/net/ethernet/mucse/rnpgbe/rnpgbe_mbx_fw.c
[ ... ]
> @@ -435,6 +462,8 @@ static void mucse_mbx_fw_req_handler(struct mucse_hw *hw,
>
> hw->speed = le16_to_cpu(req->link_stat.st.speed);
> hw->duplex = req->link_stat.st.flags & DUPLEX_BIT;
> + hw->mdix = FIELD_GET(ST_STATUS_MDIX_MASK,
> + le16_to_cpu(req->link_stat.st.status));
[Severity: Low]
ST_STATUS_MDIX_MASK is GENMASK(11, 10), so the field can hold 0 to 3.
The comment in rnpgbe_mbx_fw.h lists only three values:
/* MDI-X status uses ETH_TP_MDI_* encoding: 0 on link down, 1 MDI, 2 MDI-X. */
The raw value is stored here without a range check.
rnpgbe_get_link_ksettings() then copies it into cmd->base.eth_tp_mdix:
if (status & MUCSE_LINK_TP)
cmd->base.eth_tp_mdix = hw->mdix;
If firmware ever reported 3, ETH_TP_MDI_AUTO would show up in the
resolved MDI-X status field. That value is only meant for
eth_tp_mdix_ctrl.
Should values other than ETH_TP_MDI and ETH_TP_MDI_X be reported as
ETH_TP_MDI_INVALID instead?
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/6C54E9FB2E95869E%2B20261124060436.410989-1-dong100%40mucse.com
Technical Details
Message-ID:
<179558856190.3135.8838947348700309121@kernel.org>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-371068-linux-kernel-netdev=dewy.ruReferences:
<32E4A50B05876D23+20261124060546.411262-1-dong100@mucse.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-371068-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next v3 2/5] net: rnpgbe: Report link settings through ethtool Date: Wed, 25 Nov 2026 06:36:01 +0000 Organization: Usenet Network Message-ID: <179558856190.3135.8838947348700309121@kernel.org> References: <32E4A50B05876D23+20261124060546.411262-1-dong100@mucse.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="133811"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:wFEkYFJwV8ZAdRDFSqffYesltno= sha256:pqrYhYMQfztOaohgvn3pyMeov5fc9cbUMR4pnIa8/AQ= sha1:a0RRUrPSzQvsBz3RwdbO3IwA2rg= sha256:b6oJkC3ZB9vivzfxLf4G22UU6MaaC1SOCE22CPHZjyg= 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 2B9E6125E41; Wed, 25 Nov 2026 09:36:21 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.4 X-Spam-Status: No, score=-3.4 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, URIBL_BLOCKED=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 qXWh6NVXidTP; Wed, 25 Nov 2026 09:36:17 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-371068-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 tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mail.dewy.ru (Postfix) with ESMTPS id B4264125E35; Wed, 25 Nov 2026 09:36:06 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by tor.lore.kernel.org (Postfix) with ESMTP id 543F3275E6; Wed, 25 Nov 2026 06:36:05 +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=1795588564; b=W4k0a7INf9TF4eh2ewSeGrlflZVAFXTtj7Tay+fDDYHsZsbpMIY2YmXKjecT1eHprg9o Nu6t5vqcv7IgbQLouXoaolz5FLX3ru6dtYi/1CH8pSjyW3cFE+homCLJuD9L2scgHDVUv hwEeA2fwnyYgk04JHbjXgoTJrim/DSERvR//oWiut4oHC4Y/Vfec7XW/PdQ0UVZjb29+W E0oou3qdRVkcuSzOAOLJ6z81vr48m0V5MolscBaeWBObCfI7NOr/GCEemwTwJALy51FM6 Klp6HsATroDJoHXpT70JmM5RfZnt3N2RhC0LuC5k9ilznm9jvTf64/iOlajqLuvop2Q== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795588564; 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=gqIokuDmw+C8EIieLfWo36U5fTUYAqRMChwxSzD8YUE=; b=ZcEKCGqMKFCFmxmPrOSaAGa1LeQeUUl/FoP1t3hvHyj+S98spK9rpHQhv7KM5aUS2VKY M+NE7zL6VB1h37hgbFZQyCGvb2MLOek75sPZ9Auc5Qziq4woJ+gLhurB43E/uF+dw3zQX LRMQZtIGZa2Nnb4VglPG26ChY8sDmnLNtlj+lrd6AV1227OXxEg5dwAttjCMHKlVbOz+4 zxeBi9gK4neVEvkp/TaBLg7BEkARk1eqILf5KGuVJJz3J8AsU+g9GBReYm6oviPXtxo6K 6rH/6gmXYf36MSHr2PYd/EVrYqRPL/IWfQH1nuFGMk4mNytlZw/WCiYUOFmFIPZqsXQ== 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=iT7hMpxv; 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 5E337606A333; Wed, 25 Nov 2026 06:36:04 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=iT7hMpxv 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=1795588563; b=OENIhmkDY+xk+N18mvaHdkIvj8zMd0BNp3fVf1m6Jo5UyA8cIRJ/jpOEwFYeLW5ySViG KjCH/EpPRn26LSaExkmTFGiAXuzZQrhKyiRFOoG266paPFIkvycsIHBETgg65G/MfiU6u d4xdtULyEcA4JgyM+ULFQ9pbhHaBY0LGzuExwLw+mGNiy45MTh+LP/1QNCMtGJWwkZHWI X424WHl3ugAwtM2eJTPj9VXclrbC7uQ36gj6dfciIexlQBOOTvYPsguVkfCVj3Dj/2kCN MQ/uiVfD45zCLflP+K4LKYS3uaX6umxmvWESZ5hSViYKk97/6ljqmWDu9NMSg3bGoDg== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795588563; 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=gqIokuDmw+C8EIieLfWo36U5fTUYAqRMChwxSzD8YUE=; b=jQtr1/WV5HviToL4tjvW8sR0drESP88WTehWvPf0OlJrxmCcRZItIJFA1Zb1SB3berp/ 72mnydPodcVaOcz5Ql7fzBHpLOVHaacCY8EhbL6FxpCn4JTJ67wa4+jEwnty0JdNWPXsd X0F/214iOJHwocJ1O99p4RNlpmLEhq4g+7gN22/T3LzAqv6lCQBAZQgSwTsZ4aKEV4tUF LthISxVbPav1IvmPwhEYJcP7nLjw9FpHlQrqfI2T8Noi2KZgm7ebZWCgWs2WganV0RO2y 90M8enMLalE8F1jmkM3e502R45jL+hMwyelaM6RzxAPh7mKPVoB6rSfnD1b+TI6u6cA== 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=iT7hMpxv; 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 7C8CF606A31E; Wed, 25 Nov 2026 06:36:03 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6C7811F000C4; Wed, 25 Nov 2026 06:36:02 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795588563; bh=gqIokuDmw+C8EIieLfWo36U5fTUYAqRMChwxSzD8YUE=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=iT7hMpxvyQHNG7u0z2j+8h+4bj1jxjA64zMwxYfkddD2kNCZx6Wq9hzuVpOEAbhts o9yEe8Vjqpur94e1fAvtJgVIcGg7/VBzZ+Cqz3yjkuRn0fGdPzW8dHomvwGIKIdc5G XftwFU5RgeY4b0jsbOoagi+dbIAlOrPOgB5jNyWugdGsXjYpotovf77Q3XL6K8wuYB dDEpu4o9R1PHlT+PgkAl+96UU0jeCZfNPugdkYjqIq8daTY+IVlKY2kfpsQB2O2nch KjJcHJwSKDl+zqn/NA+0jn5lEE7PyEi8bZdx8revJi88NmHd7o/hIUPHYht3ZmS89j yPKb/fqzOddbA== X-Cc: andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, horms@kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, yaojun@mucse.com X-In-Reply-To: <32E4A50B05876D23+20261124060546.411262-1-dong100@mucse.com> X-sashiko-severity: Medium 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