Re: [PATCH net-next v21 07/15] net: phylink: add capabilities helper and track modified advertising
From: Christian Marangi
Date: Mon Nov 16 2026 - 11:37:57 EST
On Mon, Nov 16, 2026 at 05:33:50PM +0100, Christian Marangi wrote:
> In preparation for PCS release/late attach, it's needed to introduce an
> helper to calculate the capabilities after a PCS is removed/added and it's
> needed to track the advertising in link_config changed by the user compared
> to the originally one calculated in phylink_create().
>
> To archieve this, introduce dedicated advertising variables in phylink
> struct and update it when the new phylink_update_capabilities() is called
> or advertise is updated in link_config.
>
> In phylink struct the new advertising will contain the full advertising
> bits right after a phylink_validate and the new user_disabled_advertising
> will be the mask of modes that were disabled from an ethtool ksettings
> (with the parsing done in phylink_update_user_disabled_advertising()).
>
> This double reference is needed to account case when a PCS gets removed and
> attached again to preserve user-defined advertising rules.
>
> phylink_update_capabilities() will calculate the new supported modes and
> the new capabilities, update the full advertising in phylink and restore
> the user-disabled modes.
>
> phylink_create() is also updated to init the phylink advertising and
> link_config advertising.
>
> phylink_update_mac_pause_capabilities() is updated to use the new
> phylink_update_capabilities() to account for user-disabled advertising
> modes and update the full advertising in phylink.
>
> phylink_sfp_set_config() and phylink_choose_sfp_interface() are updated to
> account for the user-disabled modes, first in the
> phylink_sfp_interface_preference loop and then on updating the link_config
> advertising.
>
> Signed-off-by: Christian Marangi <ansuelsmth@xxxxxxxxx>
This is a leftover from the title rename... Please ignore.
--
Ansuel