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: <Yhi2JHfZ+QI95J9V@shell.armlinux.org.uk>
Date:   Fri, 25 Feb 2022 10:57:40 +0000
From:   "Russell King (Oracle)" <linux@...linux.org.uk>
To:     Vladimir Oltean <olteanv@...il.com>
Cc:     Marek Beh__n <kabel@...nel.org>, Andrew Lunn <andrew@...n.ch>,
        Vivien Didelot <vivien.didelot@...il.com>,
        Florian Fainelli <f.fainelli@...il.com>,
        "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>, netdev@...r.kernel.org
Subject: Re: [PATCH RFC net-next 3/6] net: dsa: sja1105: use
 .mac_select_pcs() interface

On Fri, Feb 25, 2022 at 12:39:13PM +0200, Vladimir Oltean wrote:
> On Thu, Feb 24, 2022 at 04:15:26PM +0000, Russell King (Oracle) wrote:
> > Convert the PCS selection to use mac_select_pcs, which allows the PCS
> > to perform any validation it needs, and removes the need to set the PCS
> > in the mac_config() callback, delving into the higher DSA levels to do
> > so.
> > 
> > Signed-off-by: Russell King (Oracle) <rmk+kernel@...linux.org.uk>
> > ---
> 
> Reviewed-by: Vladimir Oltean <olteanv@...il.com>

Thanks.

> > -	.phylink_mac_config	= sja1105_mac_config,
> 
> Deleting sja1105_mac_config() here is safe not because
> phylink_mac_config() stops calling pl->mac_ops->mac_config(), but
> because dsa_port_phylink_mac_config() first checks whether
> ds->ops->phylink_mac_config is implemented, and that is purely an
> artefact of providing a phylib-style ds->ops->adjust_link, right?

Yes and no.

We already have a several DSA drivers that have NULL phylink_mac_config
and that don't provide an adjust_link function. Even if adjust_link was
eventually killed off, the test in dsa_port_phylink_mac_config() would
still be necessary unless all these DSA drivers are updated with a stub
function for it.

Consequently, I view phylink_mac_config in DSA as entirely optional and
that optionality is already very much a part of the DSA interface, even
though that is not the case with the corresponding phylink_mac_ops
.mac_config method.

Moreover, this optionality is a common theme in DSA switch operations
methods.

> Maybe it's worth mentioning.

Given that .phylink_mac_config is already established as being optional
in DSA, does the addition of one more instance need to be explicitly
mentioned?

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ