lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241009122938.qmrq6csapdghwry3@skbuf>
Date: Wed, 9 Oct 2024 15:29:38 +0300
From: Vladimir Oltean <olteanv@...il.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>,
	Florian Fainelli <f.fainelli@...il.com>,
	Jakub Kicinski <kuba@...nel.org>, netdev@...r.kernel.org,
	Paolo Abeni <pabeni@...hat.com>
Subject: Re: [PATCH net-next 3/3] net: phylink: remove "using_mac_select_pcs"

On Tue, Oct 08, 2024 at 03:41:44PM +0100, Russell King (Oracle) wrote:
> With DSA's implementation of the mac_select_pcs() method removed, we
> can now remove the detection of mac_select_pcs() implementation.
> 
> Signed-off-by: Russell King (Oracle) <rmk+kernel@...linux.org.uk>
> ---
>  drivers/net/phy/phylink.c | 14 +++-----------
>  1 file changed, 3 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c
> index 4309317de3d1..8f86599d3d78 100644
> --- a/drivers/net/phy/phylink.c
> +++ b/drivers/net/phy/phylink.c
> @@ -79,7 +79,6 @@ struct phylink {
>  	unsigned int pcs_state;
>  
>  	bool mac_link_dropped;
> -	bool using_mac_select_pcs;
>  
>  	struct sfp_bus *sfp_bus;
>  	bool sfp_may_have_phy;
> @@ -661,12 +660,12 @@ static int phylink_validate_mac_and_pcs(struct phylink *pl,
>  	int ret;
>  
>  	/* Get the PCS for this interface mode */
> -	if (pl->using_mac_select_pcs) {
> +	if (pl->mac_ops->mac_select_pcs) {
>  		pcs = pl->mac_ops->mac_select_pcs(pl->config, state->interface);
>  		if (IS_ERR(pcs))
>  			return PTR_ERR(pcs);
>  	} else {
> -		pcs = pl->pcs;
> +		pcs = NULL;

The assignment from the "else" branch could have been folded into the
variable initialization.

Also, maybe a word in the commit message would be good about why the
"pcs = pl->pcs" line became "pcs = NULL". I get the impression that
these are 2 logical changes in one patch. This second aspect I'm
highlighting seems to be cleaning up the last remnants of phylink_set_pcs().
Since all phylink users have been converted to mac_select_pcs(), there's
no other possible value for "pl->pcs" than NULL if "using_mac_select_pcs"
is true.

I'm not 100% sure that this is the case, but cross-checking with the git
history, it seems to be the case. Commit 1054457006d4 ("net: phy:
phylink: fix DSA mac_select_pcs() introduction") was merged on Feb 21,2022,
and commit a5081bad2eac ("net: phylink: remove phylink_set_pcs()") on
Feb 26. So it seems plausible that this fixup could have been made as
soon as Feb 26, 2022. Please confirm.

>  	}
>  
>  	if (pcs) {

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ