Netdev List
 help / color / mirror / Atom feed
* [PATCH v2] net: enetc: fix the netc-lib driver build dependency
@ 2025-06-05  6:08 Wei Fang
  2025-06-05  8:56 ` Vladimir Oltean
  2025-06-06 11:30 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 5+ messages in thread
From: Wei Fang @ 2025-06-05  6:08 UTC (permalink / raw)
  To: claudiu.manoil, vladimir.oltean, xiaoning.wang, andrew+netdev,
	davem, edumazet, kuba, pabeni
  Cc: netdev, linux-kernel, imx, arnd

The kernel robot reported the following errors when the netc-lib driver
was compiled as a loadable module and the enetc-core driver was built-in.

ld.lld: error: undefined symbol: ntmp_init_cbdr
referenced by enetc_cbdr.c:88 (drivers/net/ethernet/freescale/enetc/enetc_cbdr.c:88)
ld.lld: error: undefined symbol: ntmp_free_cbdr
referenced by enetc_cbdr.c:96 (drivers/net/ethernet/freescale/enetc/enetc_cbdr.c:96)

Simply changing "tristate" to "bool" can fix this issue, but considering
that the netc-lib driver needs to support being compiled as a loadable
module and LS1028 does not need the netc-lib driver. Therefore, we add a
boolean symbol 'NXP_NTMP' to enable 'NXP_NETC_LIB' as needed. And when
adding NETC switch driver support in the future, there is no need to
modify the dependency, just select "NXP_NTMP" and "NXP_NETC_LIB" at the
same time.

Reported-by: Arnd Bergmann <arnd@kernel.org>
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202505220734.x6TF6oHR-lkp@intel.com/
Fixes: 4701073c3deb ("net: enetc: add initial netc-lib driver to support NTMP")
Suggested-by: Arnd Bergmann <arnd@kernel.org>
Signed-off-by: Wei Fang <wei.fang@nxp.com>
---
v1 Link: https://lore.kernel.org/imx/20250603105056.4052084-1-wei.fang@nxp.com/
v2:
1. Add the boolean symbol 'NXP_NTMP' as Arnd suggested and modify
the commit message.
---
 drivers/net/ethernet/freescale/enetc/Kconfig | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/freescale/enetc/Kconfig b/drivers/net/ethernet/freescale/enetc/Kconfig
index e917132d3714..54b0f0a5a6bb 100644
--- a/drivers/net/ethernet/freescale/enetc/Kconfig
+++ b/drivers/net/ethernet/freescale/enetc/Kconfig
@@ -1,6 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0
 config FSL_ENETC_CORE
 	tristate
+	select NXP_NETC_LIB if NXP_NTMP
 	help
 	  This module supports common functionality between the PF and VF
 	  drivers for the NXP ENETC controller.
@@ -22,6 +23,9 @@ config NXP_NETC_LIB
 	  Switch, such as NETC Table Management Protocol (NTMP) 2.0, common tc
 	  flower and debugfs interfaces and so on.
 
+config NXP_NTMP
+	bool
+
 config FSL_ENETC
 	tristate "ENETC PF driver"
 	depends on PCI_MSI
@@ -45,7 +49,7 @@ config NXP_ENETC4
 	select FSL_ENETC_CORE
 	select FSL_ENETC_MDIO
 	select NXP_ENETC_PF_COMMON
-	select NXP_NETC_LIB
+	select NXP_NTMP
 	select PHYLINK
 	select DIMLIB
 	help
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] net: enetc: fix the netc-lib driver build dependency
  2025-06-05  6:08 [PATCH v2] net: enetc: fix the netc-lib driver build dependency Wei Fang
@ 2025-06-05  8:56 ` Vladimir Oltean
  2025-06-05 11:05   ` Wei Fang
  2025-06-06 11:30 ` patchwork-bot+netdevbpf
  1 sibling, 1 reply; 5+ messages in thread
From: Vladimir Oltean @ 2025-06-05  8:56 UTC (permalink / raw)
  To: Wei Fang
  Cc: claudiu.manoil, xiaoning.wang, andrew+netdev, davem, edumazet,
	kuba, pabeni, netdev, linux-kernel, imx, arnd

Hi Wei,

On Thu, Jun 05, 2025 at 02:08:36PM +0800, Wei Fang wrote:
> The kernel robot reported the following errors when the netc-lib driver
> was compiled as a loadable module and the enetc-core driver was built-in.
> 
> ld.lld: error: undefined symbol: ntmp_init_cbdr
> referenced by enetc_cbdr.c:88 (drivers/net/ethernet/freescale/enetc/enetc_cbdr.c:88)
> ld.lld: error: undefined symbol: ntmp_free_cbdr
> referenced by enetc_cbdr.c:96 (drivers/net/ethernet/freescale/enetc/enetc_cbdr.c:96)
> 
> Simply changing "tristate" to "bool" can fix this issue, but considering
> that the netc-lib driver needs to support being compiled as a loadable
> module and LS1028 does not need the netc-lib driver. Therefore, we add a
> boolean symbol 'NXP_NTMP' to enable 'NXP_NETC_LIB' as needed. And when
> adding NETC switch driver support in the future, there is no need to
> modify the dependency, just select "NXP_NTMP" and "NXP_NETC_LIB" at the
> same time.
> 
> Reported-by: Arnd Bergmann <arnd@kernel.org>
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202505220734.x6TF6oHR-lkp@intel.com/
> Fixes: 4701073c3deb ("net: enetc: add initial netc-lib driver to support NTMP")
> Suggested-by: Arnd Bergmann <arnd@kernel.org>
> Signed-off-by: Wei Fang <wei.fang@nxp.com>
> ---
> v1 Link: https://lore.kernel.org/imx/20250603105056.4052084-1-wei.fang@nxp.com/
> v2:
> 1. Add the boolean symbol 'NXP_NTMP' as Arnd suggested and modify
> the commit message.
> ---
>  drivers/net/ethernet/freescale/enetc/Kconfig | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/freescale/enetc/Kconfig b/drivers/net/ethernet/freescale/enetc/Kconfig
> index e917132d3714..54b0f0a5a6bb 100644
> --- a/drivers/net/ethernet/freescale/enetc/Kconfig
> +++ b/drivers/net/ethernet/freescale/enetc/Kconfig
> @@ -1,6 +1,7 @@
>  # SPDX-License-Identifier: GPL-2.0
>  config FSL_ENETC_CORE
>  	tristate
> +	select NXP_NETC_LIB if NXP_NTMP
>  	help
>  	  This module supports common functionality between the PF and VF
>  	  drivers for the NXP ENETC controller.
> @@ -22,6 +23,9 @@ config NXP_NETC_LIB
>  	  Switch, such as NETC Table Management Protocol (NTMP) 2.0, common tc
>  	  flower and debugfs interfaces and so on.
>  
> +config NXP_NTMP
> +	bool
> +
>  config FSL_ENETC
>  	tristate "ENETC PF driver"
>  	depends on PCI_MSI
> @@ -45,7 +49,7 @@ config NXP_ENETC4
>  	select FSL_ENETC_CORE
>  	select FSL_ENETC_MDIO
>  	select NXP_ENETC_PF_COMMON
> -	select NXP_NETC_LIB
> +	select NXP_NTMP
>  	select PHYLINK
>  	select DIMLIB
>  	help
> -- 
> 2.34.1
>

I think you slightly misunderstood Arnd's suggestion. NXP_NTMP was named
"NXP_NETC_NTMP" in his proposal, and it meant "does FSL_ENETC_CORE need
the functionality from NXP_NETC_LIB?".

The switch driver shouldn't need to select NXP_NTMP. Just NXP_NETC_LIB.

I don't agree with removing "NETC" from NXP_NETC_NTMP, I think it helps
clarify that the option pertains just to the NETC drivers.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [PATCH v2] net: enetc: fix the netc-lib driver build dependency
  2025-06-05  8:56 ` Vladimir Oltean
@ 2025-06-05 11:05   ` Wei Fang
  2025-06-05 12:37     ` Vladimir Oltean
  0 siblings, 1 reply; 5+ messages in thread
From: Wei Fang @ 2025-06-05 11:05 UTC (permalink / raw)
  To: Vladimir Oltean
  Cc: Claudiu Manoil, Clark Wang, andrew+netdev@lunn.ch,
	davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, imx@lists.linux.dev,
	arnd@kernel.org

> On Thu, Jun 05, 2025 at 02:08:36PM +0800, Wei Fang wrote:
> > The kernel robot reported the following errors when the netc-lib
> > driver was compiled as a loadable module and the enetc-core driver was
> built-in.
> >
> > ld.lld: error: undefined symbol: ntmp_init_cbdr referenced by
> > enetc_cbdr.c:88 (drivers/net/ethernet/freescale/enetc/enetc_cbdr.c:88)
> > ld.lld: error: undefined symbol: ntmp_free_cbdr referenced by
> > enetc_cbdr.c:96 (drivers/net/ethernet/freescale/enetc/enetc_cbdr.c:96)
> >
> > Simply changing "tristate" to "bool" can fix this issue, but
> > considering that the netc-lib driver needs to support being compiled
> > as a loadable module and LS1028 does not need the netc-lib driver.
> > Therefore, we add a boolean symbol 'NXP_NTMP' to enable 'NXP_NETC_LIB'
> > as needed. And when adding NETC switch driver support in the future,
> > there is no need to modify the dependency, just select "NXP_NTMP" and
> > "NXP_NETC_LIB" at the same time.
> >
> > Reported-by: Arnd Bergmann <arnd@kernel.org>
> > Reported-by: kernel test robot <lkp@intel.com>
> > Closes:
> > https://lore.kernel.org/oe-kbuild-all/202505220734.x6TF6oHR-lkp@intel.
> > com/
> > Fixes: 4701073c3deb ("net: enetc: add initial netc-lib driver to
> > support NTMP")
> > Suggested-by: Arnd Bergmann <arnd@kernel.org>
> > Signed-off-by: Wei Fang <wei.fang@nxp.com>
> > ---
> > v1 Link:
> >
> https://lore.kernel.org/imx/20250603105056.4052084-1-wei.fang@nxp.com/
> > v2:
> > 1. Add the boolean symbol 'NXP_NTMP' as Arnd suggested and modify the
> > commit message.
> > ---
> >  drivers/net/ethernet/freescale/enetc/Kconfig | 6 +++++-
> >  1 file changed, 5 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/ethernet/freescale/enetc/Kconfig
> > b/drivers/net/ethernet/freescale/enetc/Kconfig
> > index e917132d3714..54b0f0a5a6bb 100644
> > --- a/drivers/net/ethernet/freescale/enetc/Kconfig
> > +++ b/drivers/net/ethernet/freescale/enetc/Kconfig
> > @@ -1,6 +1,7 @@
> >  # SPDX-License-Identifier: GPL-2.0
> >  config FSL_ENETC_CORE
> >  	tristate
> > +	select NXP_NETC_LIB if NXP_NTMP
> >  	help
> >  	  This module supports common functionality between the PF and VF
> >  	  drivers for the NXP ENETC controller.
> > @@ -22,6 +23,9 @@ config NXP_NETC_LIB
> >  	  Switch, such as NETC Table Management Protocol (NTMP) 2.0, common
> tc
> >  	  flower and debugfs interfaces and so on.
> >
> > +config NXP_NTMP
> > +	bool
> > +
> >  config FSL_ENETC
> >  	tristate "ENETC PF driver"
> >  	depends on PCI_MSI
> > @@ -45,7 +49,7 @@ config NXP_ENETC4
> >  	select FSL_ENETC_CORE
> >  	select FSL_ENETC_MDIO
> >  	select NXP_ENETC_PF_COMMON
> > -	select NXP_NETC_LIB
> > +	select NXP_NTMP
> >  	select PHYLINK
> >  	select DIMLIB
> >  	help
> > --
> > 2.34.1
> >
> 
> I think you slightly misunderstood Arnd's suggestion. NXP_NTMP was named
> "NXP_NETC_NTMP" in his proposal, and it meant "does FSL_ENETC_CORE need
> the functionality from NXP_NETC_LIB?".
> 
> The switch driver shouldn't need to select NXP_NTMP. Just NXP_NETC_LIB.
> 

For the case :NXP_ENET4=n , FSL_ENETC=y and NXP_NETC_SWITCH=m, if the
switch driver only selects NXP_NETC_LIB, then the netc-lib driver will be compiled
as a module. So the issue will be reported again. And Arnd also said "The switch
module can then equally enable bool symbol."

> I don't agree with removing "NETC" from NXP_NETC_NTMP, I think it helps
> clarify that the option pertains just to the NETC drivers.

NTMP means " NETC Table Management Protocol", I don't know why we need
to add a 'NETC' again, it does not make sense to me.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] net: enetc: fix the netc-lib driver build dependency
  2025-06-05 11:05   ` Wei Fang
@ 2025-06-05 12:37     ` Vladimir Oltean
  0 siblings, 0 replies; 5+ messages in thread
From: Vladimir Oltean @ 2025-06-05 12:37 UTC (permalink / raw)
  To: Wei Fang
  Cc: Claudiu Manoil, Clark Wang, andrew+netdev@lunn.ch,
	davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, imx@lists.linux.dev,
	arnd@kernel.org

On Thu, Jun 05, 2025 at 02:05:47PM +0300, Wei Fang wrote:
> > I think you slightly misunderstood Arnd's suggestion. NXP_NTMP was named
> > "NXP_NETC_NTMP" in his proposal, and it meant "does FSL_ENETC_CORE need
> > the functionality from NXP_NETC_LIB?".
> > 
> > The switch driver shouldn't need to select NXP_NTMP. Just NXP_NETC_LIB.
> > 
> 
> For the case :NXP_ENET4=n , FSL_ENETC=y and NXP_NETC_SWITCH=m, if the
> switch driver only selects NXP_NETC_LIB, then the netc-lib driver will be compiled
> as a module. So the issue will be reported again. And Arnd also said "The switch
> module can then equally enable bool symbol."
> 
> > I don't agree with removing "NETC" from NXP_NETC_NTMP, I think it helps
> > clarify that the option pertains just to the NETC drivers.
> 
> NTMP means " NETC Table Management Protocol", I don't know why we need
> to add a 'NETC' again, it does not make sense to me.

Understood, thanks for the example. It was me who misunderstood. In that case

Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] net: enetc: fix the netc-lib driver build dependency
  2025-06-05  6:08 [PATCH v2] net: enetc: fix the netc-lib driver build dependency Wei Fang
  2025-06-05  8:56 ` Vladimir Oltean
@ 2025-06-06 11:30 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 5+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-06-06 11:30 UTC (permalink / raw)
  To: Wei Fang
  Cc: claudiu.manoil, vladimir.oltean, xiaoning.wang, andrew+netdev,
	davem, edumazet, kuba, pabeni, netdev, linux-kernel, imx, arnd

Hello:

This patch was applied to netdev/net.git (main)
by David S. Miller <davem@davemloft.net>:

On Thu,  5 Jun 2025 14:08:36 +0800 you wrote:
> The kernel robot reported the following errors when the netc-lib driver
> was compiled as a loadable module and the enetc-core driver was built-in.
> 
> ld.lld: error: undefined symbol: ntmp_init_cbdr
> referenced by enetc_cbdr.c:88 (drivers/net/ethernet/freescale/enetc/enetc_cbdr.c:88)
> ld.lld: error: undefined symbol: ntmp_free_cbdr
> referenced by enetc_cbdr.c:96 (drivers/net/ethernet/freescale/enetc/enetc_cbdr.c:96)
> 
> [...]

Here is the summary with links:
  - [v2] net: enetc: fix the netc-lib driver build dependency
    https://git.kernel.org/netdev/net/c/82cbd06f327f

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-06-06 11:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-05  6:08 [PATCH v2] net: enetc: fix the netc-lib driver build dependency Wei Fang
2025-06-05  8:56 ` Vladimir Oltean
2025-06-05 11:05   ` Wei Fang
2025-06-05 12:37     ` Vladimir Oltean
2025-06-06 11:30 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox