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 4/5] net: rnpgbe: Allow changing the primary MAC address
Date: Wed, 25 Nov 2026 06:36:04 +0000 [thread overview]
Message-ID: <179558856439.3135.10366216867025200313@kernel.org> (raw)
In-Reply-To: <4EBB27E12BC81D8D+20261124060613.411393-1-dong100@mucse.com>
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.
Low priority / nit picks for your consideration:
- [Low] rnpgbe_set_mac_address() in
drivers/net/ethernet/mucse/rnpgbe/rnpgbe_chip.c checks the new address…
--
net: rnpgbe: Allow changing the primary MAC address
This adds ndo_set_mac_address support to rnpgbe so the primary MAC address
can be changed while the interface is up or down. The new address is
validated, written to the primary receive address filter (RAR0), and then
committed to the netdev. It also wires up eth_validate_addr as
ndo_validate_addr.
> diff --git a/drivers/net/ethernet/mucse/rnpgbe/rnpgbe_chip.c b/drivers/net/ethernet/mucse/rnpgbe/rnpgbe_chip.c
> index 3a2f62f0630da..f25cca98878ef 100644
> --- a/drivers/net/ethernet/mucse/rnpgbe/rnpgbe_chip.c
> +++ b/drivers/net/ethernet/mucse/rnpgbe/rnpgbe_chip.c
[ ... ]
> +int rnpgbe_set_mac_address(struct net_device *netdev, void *addr)
> +{
> + struct mucse *mucse = netdev_priv(netdev);
> + struct sockaddr *sa = addr;
> + int err;
> +
> + err = eth_prepare_mac_addr_change(netdev, addr);
> + if (err)
> + return err;
> +
> + rnpgbe_set_rar(&mucse->hw, 0, sa->sa_data);
> + eth_commit_mac_addr_change(netdev, addr);
[Severity: Low]
Is updating only the ETH-block RAR0 entry enough here? Would the GMAC
station address and the firmware still hold the old MAC after this runs?
As far as I can tell, rnpgbe_hw.h defines no GMAC station address
register, and the driver never writes one. The GMAC would then keep
whatever address firmware programmed at reset.
The GMAC block looks like the Synopsys DWC GMAC layout:
#define MUCSE_GMAC_OFF(_n) (0x20000 + (_n))
#define GMAC_CONTROL_RE 0x00000004
#define GMAC_CONTROL MUCSE_GMAC_OFF(0)
#define GMAC_RX_ALL (BIT(31) | BIT(0))
#define GMAC_FRAME_FILTER MUCSE_GMAC_OFF(0x4)
On that IP, MAC Address0 High/Low is the source address of the PAUSE
frames the MAC generates. RNPGBE_LINK_ST reports pause state in bits
25:24. If TX pause is active after "ip link set dev X address ...",
could those PAUSE frames carry an address the host no longer uses?
The mailbox command set in rnpgbe_mbx_fw.h also has only
GET_MAC_ADDRESS and no set command. So any firmware-side copy of the
MAC, for example for NCSI (which owns RAR entries 30-31), would also be
stale.
Receive is not affected. rnpgbe_set_link() puts the GMAC in receive-all
mode, and filtering is done by the ETH-block RAR/MTA tables. The concern
only covers frames the hardware generates and firmware state.
This is inferred from the IP family and would need to be checked against
the Mucse datasheet or vendor driver. Later patches in the series don't
seem to add a GMAC address register write or a firmware set-MAC command
either.
Does the GMAC station address need to be programmed here, or the
firmware notified, when the address changes?
> +
> + return 0;
> +}
[ ... ]
--
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: 10+ 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
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-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 [this message]
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
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=179558856439.3135.10366216867025200313@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