From: netdev-bot+sashiko@kernel.org
To: dong100@mucse.com
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
Subject: Re: [PATCH net-next v3 2/5] net: rnpgbe: Report link settings through ethtool
Date: Wed, 25 Nov 2026 06:36:01 +0000 [thread overview]
Message-ID: <179558856190.3135.8838947348700309121@kernel.org> (raw)
In-Reply-To: <32E4A50B05876D23+20261124060546.411262-1-dong100@mucse.com>
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
next prev parent reply other threads:[~2026-11-25 6:36 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-24 6:04 [PATCH net-next v3 0/5] net: rnpgbe: Add basic management and statistics Dong Yibo
2026-11-24 6:05 ` [PATCH net-next v3 1/5] net: rnpgbe: Add basic ethtool support Dong Yibo
2026-11-24 6:05 ` [PATCH net-next v3 2/5] net: rnpgbe: Report link settings through ethtool Dong Yibo
2026-11-25 6:36 ` netdev-bot+sashiko [this message]
2026-11-25 7:09 ` Yibo Dong
2026-11-24 6:06 ` [PATCH net-next v3 3/5] net: rnpgbe: Support copper link configuration Dong Yibo
2026-11-25 6:36 ` netdev-bot+sashiko
2026-11-25 7:31 ` Yibo Dong
2026-11-24 6:06 ` [PATCH net-next v3 4/5] net: rnpgbe: Allow changing the primary MAC address Dong Yibo
2026-11-25 6:36 ` netdev-bot+sashiko
2026-11-24 6:06 ` [PATCH net-next v3 5/5] net: rnpgbe: Add hardware and queue statistics Dong Yibo
2026-11-25 6:36 ` netdev-bot+sashiko
2026-11-25 7:36 ` Yibo Dong
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=179558856190.3135.8838947348700309121@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=dong100@mucse.com \
--cc=edumazet@kernel.org \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=yaojun@mucse.com \
/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®