[RFC net-next v1 2/5] net: phy: remove MACSEC guard

Radu Pirea (NXP OSS) posted 5 patches 2 years, 4 months ago
There is a newer version of this series
[RFC net-next v1 2/5] net: phy: remove MACSEC guard
Posted by Radu Pirea (NXP OSS) 2 years, 4 months ago
Allow the phy driver to build the MACSEC support even if
CONFIG_MACSEC=N.

Signed-off-by: Radu Pirea (NXP OSS) <radu-nicolae.pirea@oss.nxp.com>
---
 include/linux/phy.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/include/linux/phy.h b/include/linux/phy.h
index 3c1ceedd1b77..813a99449f77 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -753,10 +753,8 @@ struct phy_device {
 	void (*phy_link_change)(struct phy_device *phydev, bool up);
 	void (*adjust_link)(struct net_device *dev);
 
-#if IS_ENABLED(CONFIG_MACSEC)
 	/* MACsec management functions */
 	const struct macsec_ops *macsec_ops;
-#endif
 };
 
 /* Generic phy_device::dev_flags */
-- 
2.34.1
Re: [RFC net-next v1 2/5] net: phy: remove MACSEC guard
Posted by Andrew Lunn 2 years, 4 months ago
On Fri, Aug 11, 2023 at 06:32:46PM +0300, Radu Pirea (NXP OSS) wrote:
> Allow the phy driver to build the MACSEC support even if
> CONFIG_MACSEC=N.

What is missing from this commit message is an answer to the question
'Why?'

     Andrew
Re: [RFC net-next v1 2/5] net: phy: remove MACSEC guard
Posted by Sabrina Dubroca 2 years, 4 months ago
2023-08-11, 18:59:57 +0200, Andrew Lunn wrote:
> On Fri, Aug 11, 2023 at 06:32:46PM +0300, Radu Pirea (NXP OSS) wrote:
> > Allow the phy driver to build the MACSEC support even if
> > CONFIG_MACSEC=N.
> 
> What is missing from this commit message is an answer to the question
> 'Why?'

The same question applies to patch #1. Why would we need a dummy
implementation of macsec_pn_wrapped when !CONFIG_MACSEC?

I guess it's to avoid conditional compilation of
drivers/net/phy/nxp-c45-tja11xx-macsec.c and a few ifdefs in the main
driver.

-- 
Sabrina
Re: [RFC net-next v1 2/5] net: phy: remove MACSEC guard
Posted by Andrew Lunn 2 years, 4 months ago
On Mon, Aug 14, 2023 at 05:35:33PM +0200, Sabrina Dubroca wrote:
> 2023-08-11, 18:59:57 +0200, Andrew Lunn wrote:
> > On Fri, Aug 11, 2023 at 06:32:46PM +0300, Radu Pirea (NXP OSS) wrote:
> > > Allow the phy driver to build the MACSEC support even if
> > > CONFIG_MACSEC=N.
> > 
> > What is missing from this commit message is an answer to the question
> > 'Why?'
> 
> The same question applies to patch #1. Why would we need a dummy
> implementation of macsec_pn_wrapped when !CONFIG_MACSEC?
> 
> I guess it's to avoid conditional compilation of
> drivers/net/phy/nxp-c45-tja11xx-macsec.c and a few ifdefs in the main
> driver.

Which is that the mscc driver does.

Implementing MACSEC is a lot of code, and makes the resulting binary a
lot bigger. So it does seem reasonable to leave it out if MACSEC is
not needed.

So i suggest you follow what mscc does.

    Andrew