Re: [PATCH net-next v2 2/5] net: rnpgbe: Report link settings through ethtool

From: Andrew Lunn

Date: Mon Nov 16 2026 - 20:55:00 EST


On Tue, Nov 17, 2026 at 09:49:02AM +0800, Yibo Dong wrote:
> On Mon, Nov 16, 2026 at 02:18:28PM +0100, Andrew Lunn wrote:
> > > link, speed, duplex and mdix are updated asynchronously by
> > > the mailbox event handler, outside RTNL. link_lock protects these updates
> > > and provides a consistent snapshot in the getter.
> >
> > O.K, thanks for the explanation.
> >
> > I removed too much context, so i cannot see here. What about
> > lp_advertising? That also comes from the firmware, reported on link up
> > when autoneg completes.
> >
> The firmware manages autonegotiation and reports the negotiated speed
> and duplex through mailbox link events. However, the current mailbox
> interface does not expose the link partner's advertisement bitmap.
>
> Therefore, lp_advertising is currently left zero to indicate that this
> information is unknown to the driver.
>
> If reporting lp_advertising is must, we would need to add a new
> firmware mailbox command to retrieve the link partner's advertisement,
> or add lp_advertising to link-event mbx alongwith link, speed and
> duplex.

It is not a must, but it is useful.

Or you can just throw away your firmware, expose the MDIO bus, and let
phylink drive the hardware. Less code, less bugs, more functionality
for free.

Andrew