Re: [PATCH net-next v1 3/4] net: phy: Don't report advertised EEE modes if EEE is disabled

From: Russell King (Oracle)
Date: Thu Apr 24 2025 - 10:38:50 EST


On Thu, Apr 24, 2025 at 04:30:40PM +0200, Andrew Lunn wrote:
> On Thu, Apr 24, 2025 at 03:02:21PM +0200, Oleksij Rempel wrote:
> > Currently, `ethtool --show-eee` reports "Advertised EEE link modes" even when
> > EEE is disabled, which can be misleading. For example:
> >
> > EEE settings for lan1:
> > EEE status: disabled
> > Tx LPI: disabled
> > Supported EEE link modes: 100baseT/Full
> > 1000baseT/Full
> > Advertised EEE link modes: 100baseT/Full
> > 1000baseT/Full
> > Link partner advertised EEE link modes: Not reported
>
> What is the behaviour for normal link mode advertisement? If i turn
> autoneg off, do the advertised link modes disappear? Do they reappear
> when i turn autoneg back on again?
>
> I would expect EEE to follow what the normal link modes do. Assuming
> the Read/modify/write does not break this.

It's difficult to compare, because ethtool is implemented differently
between modifying the link modes and the EEE stuff. ethtool -s autoneg
on uses this:

if (autoneg_wanted == AUTONEG_ENABLE &&
advertising_wanted == NULL &&
full_advertising_wanted == NULL) {
unsigned int i;

/* Auto negotiation enabled, but with
* unspecified speed and duplex: enable all
* supported speeds and duplexes.
*/

whereas do_seee() has no special handling.

So, if we want ethtool --set-eee eee off; ethtool --set-eee eee on *not*
to end up with the advertising mask being cleared, then we have to
preserve it, or force the advertising mask to something if the
advertising mask is empty and eee_enabled is true.

Or we preserve the advertising mask when eee_enabled is cleared, which
is what we do today.

I think, given the different implementations in ethtool, we can't just
say "we want it to be have the same" by just modifying the kernel.

--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!