[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20241022154919.1dba3e1a@device-21.home>
Date: Tue, 22 Oct 2024 15:49:19 +0200
From: Maxime Chevallier <maxime.chevallier@...tlin.com>
To: "Russell King (Oracle)" <rmk+kernel@...linux.org.uk>
Cc: Andrew Lunn <andrew@...n.ch>, Heiner Kallweit <hkallweit1@...il.com>,
"David S. Miller" <davem@...emloft.net>, Eric Dumazet
<edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>, Paolo Abeni
<pabeni@...hat.com>, netdev@...r.kernel.org
Subject: Re: [PATCH net-next 3/3] net: phylink: simplify how SFP PHYs are
attached
Hi Russell,
On Tue, 22 Oct 2024 12:54:17 +0100
"Russell King (Oracle)" <rmk+kernel@...linux.org.uk> wrote:
> There are a few issues with how SFP PHYs are attached:
>
> a) The phylink_sfp_connect_phy() and phylink_sfp_config_phy() code
> validates the configuration three times:
>
> 1. To discover the support/advertising masks that the PHY/PCS/MAC
> can support in order to select an interface.
> 2. To validate the selected interface.
> 3. When the PHY is brought up after being attached, another validation
> is done.
>
> This is needlessly complex.
>
> b) The configuration is set prior to the PHY being attached, which
> means we don't have the PHY available in phylink_major_config()
> for phylink_pcs_neg_mode() to make decisions upon.
>
> We have already added an extra step to validate the selected interface,
> so we can now move the attachment and bringup of the PHY earlier,
> inside phylink_sfp_config_phy(). This results in the validation at
> step 2 above becoming entirely unnecessary, so remove that too.
>
> Signed-off-by: Russell King (Oracle) <rmk+kernel@...linux.org.uk>
This is indeed cleaner and easier to understand, thanks.
Modulo the warning,
Reviewed-by: Maxime Chevallier <maxime.chevallier@...tlin.com>
Tested-by: Maxime Chevallier <maxime.chevallier@...tlin.com>
Thanks,
Maxime
Powered by blists - more mailing lists