Re: [PATCH net v1 1/1] net: phylink: keep initial advertising settings

From: Thilo Zirnstein

Date: Fri Nov 06 2026 - 16:21:56 EST


Hi Andrew,

Thanks for your feedback,

On Fri, Nov 06, 2026 at 02:51:18PM +0100, Andrew Lunn wrote:
...
> > The mode of action is as follows:
> >
> > * The link was not up yet - no phy connected
> > * the user configures the advertisement of the interface
> > * the mac driver delegates the call to phylink_ethtool_ksettings_set
> > * here we are not configuring the phy - it does not exist yet
>
> If it does not exist, it is not possible to validate the user request
> is actually supported by the PHY.

I think my description was a bit misleading.
The mode of action describes how the phy is attached by some
net driver and what the program flow is and why there is a problem.

Typically the device driver does not set/clear any advertisment bits
during device bring up. As least what I have seen so far.
It attaches the phy and brings up the link.

>
> > * the user set up the interface
> > * the mac drivers calls phylink_connect_phy
>
> At this point, is the previously configured value sanitised by what
> the PHY can actually do?
>
> Take the example of a MAC which can do up to 2500BaseX, but it is
> connected to a PHY which only supports SGMII. Before up, the user
> could request 2.5GBaseT, but at admin up that needs to be reduced down
> to 1G.

Good example, with this patch applied this will advertise 1G,
if the user does not configure exclusive 2.5G prior attaching the phy.
If the user configures exclusive 2.5G (2.5G only) the advertisment is empty.
I think this is fine because the user missconfigured the link, but maybe
i am to restrictive.

I wrote a little table for a better overview. I am not 100% sure
how your example behaves because 2.5G uses another interface then SGMII.
I have tested with a sgmii 1G half/full duplex link.

Without patch

without phy (user): phy caps link up advertisement
1G FD+HD 1G FD+HD 1G FD+HD
1G FD 1G FD+HD 1G FD+HD <= bad
1G FD+HD 1G FD 1G FD

With patch

without phy (user): phy caps link up advertisement
1G FD+HD 1G FD+HD 1G FD+HD
1G FD 1G FD+HD 1G FD <= good
1G FD+HD 1G FD 1G FD

> Andrew

Thilo