* [PATCH net-next] net: dsa: ocelot: build felix.c into a dedicated kernel module
@ 2023-01-25 14:57 Vladimir Oltean
2023-01-26 17:00 ` Colin Foster
2023-01-27 8:00 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Vladimir Oltean @ 2023-01-25 14:57 UTC (permalink / raw)
To: netdev
Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Claudiu Manoil, Colin Foster, UNGLinuxDriver, Alexandre Belloni,
Andrew Lunn, Florian Fainelli, Alexander Lobakin
The build system currently complains:
scripts/Makefile.build:252: drivers/net/dsa/ocelot/Makefile:
felix.o is added to multiple modules: mscc_felix mscc_seville
Since felix.c holds the DSA glue layer, create a mscc_felix_dsa_lib.ko.
This is similar to how mscc_ocelot_switch_lib.ko holds a library for
configuring the hardware.
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
---
drivers/net/dsa/ocelot/Kconfig | 11 +++++++++++
drivers/net/dsa/ocelot/Makefile | 11 ++++-------
drivers/net/dsa/ocelot/felix.c | 6 ++++++
3 files changed, 21 insertions(+), 7 deletions(-)
diff --git a/drivers/net/dsa/ocelot/Kconfig b/drivers/net/dsa/ocelot/Kconfig
index 08db9cf76818..60f1f7ada465 100644
--- a/drivers/net/dsa/ocelot/Kconfig
+++ b/drivers/net/dsa/ocelot/Kconfig
@@ -1,4 +1,13 @@
# SPDX-License-Identifier: GPL-2.0-only
+config NET_DSA_MSCC_FELIX_DSA_LIB
+ tristate
+ help
+ This is an umbrella module for all network switches that are
+ register-compatible with Ocelot and that perform I/O to their host
+ CPU through an NPI (Node Processor Interface) Ethernet port.
+ Its name comes from the first hardware chip to make use of it
+ (VSC9959), code named Felix.
+
config NET_DSA_MSCC_FELIX
tristate "Ocelot / Felix Ethernet switch support"
depends on NET_DSA && PCI
@@ -8,6 +17,7 @@ config NET_DSA_MSCC_FELIX
depends on PTP_1588_CLOCK_OPTIONAL
depends on NET_SCH_TAPRIO || NET_SCH_TAPRIO=n
select MSCC_OCELOT_SWITCH_LIB
+ select NET_DSA_MSCC_FELIX_DSA_LIB
select NET_DSA_TAG_OCELOT_8021Q
select NET_DSA_TAG_OCELOT
select FSL_ENETC_MDIO
@@ -24,6 +34,7 @@ config NET_DSA_MSCC_SEVILLE
depends on PTP_1588_CLOCK_OPTIONAL
select MDIO_MSCC_MIIM
select MSCC_OCELOT_SWITCH_LIB
+ select NET_DSA_MSCC_FELIX_DSA_LIB
select NET_DSA_TAG_OCELOT_8021Q
select NET_DSA_TAG_OCELOT
select PCS_LYNX
diff --git a/drivers/net/dsa/ocelot/Makefile b/drivers/net/dsa/ocelot/Makefile
index f6dd131e7491..fd7dde570d4e 100644
--- a/drivers/net/dsa/ocelot/Makefile
+++ b/drivers/net/dsa/ocelot/Makefile
@@ -1,11 +1,8 @@
# SPDX-License-Identifier: GPL-2.0-only
+obj-$(CONFIG_NET_DSA_MSCC_FELIX_DSA_LIB) += mscc_felix_dsa_lib.o
obj-$(CONFIG_NET_DSA_MSCC_FELIX) += mscc_felix.o
obj-$(CONFIG_NET_DSA_MSCC_SEVILLE) += mscc_seville.o
-mscc_felix-objs := \
- felix.o \
- felix_vsc9959.o
-
-mscc_seville-objs := \
- felix.o \
- seville_vsc9953.o
+mscc_felix_dsa_lib-objs := felix.o
+mscc_felix-objs := felix_vsc9959.o
+mscc_seville-objs := seville_vsc9953.o
diff --git a/drivers/net/dsa/ocelot/felix.c b/drivers/net/dsa/ocelot/felix.c
index d21e7be2f8c7..f57b4095b793 100644
--- a/drivers/net/dsa/ocelot/felix.c
+++ b/drivers/net/dsa/ocelot/felix.c
@@ -2131,6 +2131,7 @@ const struct dsa_switch_ops felix_switch_ops = {
.port_set_host_flood = felix_port_set_host_flood,
.port_change_master = felix_port_change_master,
};
+EXPORT_SYMBOL_GPL(felix_switch_ops);
struct net_device *felix_port_to_netdev(struct ocelot *ocelot, int port)
{
@@ -2142,6 +2143,7 @@ struct net_device *felix_port_to_netdev(struct ocelot *ocelot, int port)
return dsa_to_port(ds, port)->slave;
}
+EXPORT_SYMBOL_GPL(felix_port_to_netdev);
int felix_netdev_to_port(struct net_device *dev)
{
@@ -2153,3 +2155,7 @@ int felix_netdev_to_port(struct net_device *dev)
return dp->index;
}
+EXPORT_SYMBOL_GPL(felix_netdev_to_port);
+
+MODULE_DESCRIPTION("Felix DSA library");
+MODULE_LICENSE("GPL");
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] net: dsa: ocelot: build felix.c into a dedicated kernel module
2023-01-25 14:57 [PATCH net-next] net: dsa: ocelot: build felix.c into a dedicated kernel module Vladimir Oltean
@ 2023-01-26 17:00 ` Colin Foster
2023-01-27 8:00 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Colin Foster @ 2023-01-26 17:00 UTC (permalink / raw)
To: Vladimir Oltean
Cc: netdev, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Claudiu Manoil, UNGLinuxDriver, Alexandre Belloni,
Andrew Lunn, Florian Fainelli, Alexander Lobakin
On Wed, Jan 25, 2023 at 04:57:16PM +0200, Vladimir Oltean wrote:
> The build system currently complains:
>
> scripts/Makefile.build:252: drivers/net/dsa/ocelot/Makefile:
> felix.o is added to multiple modules: mscc_felix mscc_seville
>
> Since felix.c holds the DSA glue layer, create a mscc_felix_dsa_lib.ko.
> This is similar to how mscc_ocelot_switch_lib.ko holds a library for
> configuring the hardware.
>
I remember seeing this at one point. I thought I'd fixed it, but
apparently not.
Acked-by: Colin Foster <colin.foster@in-advantage.com>
> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
> ---
> drivers/net/dsa/ocelot/Kconfig | 11 +++++++++++
> drivers/net/dsa/ocelot/Makefile | 11 ++++-------
> drivers/net/dsa/ocelot/felix.c | 6 ++++++
> 3 files changed, 21 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/net/dsa/ocelot/Kconfig b/drivers/net/dsa/ocelot/Kconfig
> index 08db9cf76818..60f1f7ada465 100644
> --- a/drivers/net/dsa/ocelot/Kconfig
> +++ b/drivers/net/dsa/ocelot/Kconfig
> @@ -1,4 +1,13 @@
> # SPDX-License-Identifier: GPL-2.0-only
> +config NET_DSA_MSCC_FELIX_DSA_LIB
> + tristate
> + help
> + This is an umbrella module for all network switches that are
> + register-compatible with Ocelot and that perform I/O to their host
> + CPU through an NPI (Node Processor Interface) Ethernet port.
> + Its name comes from the first hardware chip to make use of it
> + (VSC9959), code named Felix.
> +
> config NET_DSA_MSCC_FELIX
> tristate "Ocelot / Felix Ethernet switch support"
> depends on NET_DSA && PCI
> @@ -8,6 +17,7 @@ config NET_DSA_MSCC_FELIX
> depends on PTP_1588_CLOCK_OPTIONAL
> depends on NET_SCH_TAPRIO || NET_SCH_TAPRIO=n
> select MSCC_OCELOT_SWITCH_LIB
> + select NET_DSA_MSCC_FELIX_DSA_LIB
> select NET_DSA_TAG_OCELOT_8021Q
> select NET_DSA_TAG_OCELOT
> select FSL_ENETC_MDIO
> @@ -24,6 +34,7 @@ config NET_DSA_MSCC_SEVILLE
> depends on PTP_1588_CLOCK_OPTIONAL
> select MDIO_MSCC_MIIM
> select MSCC_OCELOT_SWITCH_LIB
> + select NET_DSA_MSCC_FELIX_DSA_LIB
> select NET_DSA_TAG_OCELOT_8021Q
> select NET_DSA_TAG_OCELOT
> select PCS_LYNX
> diff --git a/drivers/net/dsa/ocelot/Makefile b/drivers/net/dsa/ocelot/Makefile
> index f6dd131e7491..fd7dde570d4e 100644
> --- a/drivers/net/dsa/ocelot/Makefile
> +++ b/drivers/net/dsa/ocelot/Makefile
> @@ -1,11 +1,8 @@
> # SPDX-License-Identifier: GPL-2.0-only
> +obj-$(CONFIG_NET_DSA_MSCC_FELIX_DSA_LIB) += mscc_felix_dsa_lib.o
> obj-$(CONFIG_NET_DSA_MSCC_FELIX) += mscc_felix.o
> obj-$(CONFIG_NET_DSA_MSCC_SEVILLE) += mscc_seville.o
>
> -mscc_felix-objs := \
> - felix.o \
> - felix_vsc9959.o
> -
> -mscc_seville-objs := \
> - felix.o \
> - seville_vsc9953.o
> +mscc_felix_dsa_lib-objs := felix.o
> +mscc_felix-objs := felix_vsc9959.o
> +mscc_seville-objs := seville_vsc9953.o
> diff --git a/drivers/net/dsa/ocelot/felix.c b/drivers/net/dsa/ocelot/felix.c
> index d21e7be2f8c7..f57b4095b793 100644
> --- a/drivers/net/dsa/ocelot/felix.c
> +++ b/drivers/net/dsa/ocelot/felix.c
> @@ -2131,6 +2131,7 @@ const struct dsa_switch_ops felix_switch_ops = {
> .port_set_host_flood = felix_port_set_host_flood,
> .port_change_master = felix_port_change_master,
> };
> +EXPORT_SYMBOL_GPL(felix_switch_ops);
>
> struct net_device *felix_port_to_netdev(struct ocelot *ocelot, int port)
> {
> @@ -2142,6 +2143,7 @@ struct net_device *felix_port_to_netdev(struct ocelot *ocelot, int port)
>
> return dsa_to_port(ds, port)->slave;
> }
> +EXPORT_SYMBOL_GPL(felix_port_to_netdev);
>
> int felix_netdev_to_port(struct net_device *dev)
> {
> @@ -2153,3 +2155,7 @@ int felix_netdev_to_port(struct net_device *dev)
>
> return dp->index;
> }
> +EXPORT_SYMBOL_GPL(felix_netdev_to_port);
> +
> +MODULE_DESCRIPTION("Felix DSA library");
> +MODULE_LICENSE("GPL");
> --
> 2.34.1
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] net: dsa: ocelot: build felix.c into a dedicated kernel module
2023-01-25 14:57 [PATCH net-next] net: dsa: ocelot: build felix.c into a dedicated kernel module Vladimir Oltean
2023-01-26 17:00 ` Colin Foster
@ 2023-01-27 8:00 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-01-27 8:00 UTC (permalink / raw)
To: Vladimir Oltean
Cc: netdev, davem, edumazet, kuba, pabeni, claudiu.manoil,
colin.foster, UNGLinuxDriver, alexandre.belloni, andrew,
f.fainelli, alobakin
Hello:
This patch was applied to netdev/net-next.git (master)
by Jakub Kicinski <kuba@kernel.org>:
On Wed, 25 Jan 2023 16:57:16 +0200 you wrote:
> The build system currently complains:
>
> scripts/Makefile.build:252: drivers/net/dsa/ocelot/Makefile:
> felix.o is added to multiple modules: mscc_felix mscc_seville
>
> Since felix.c holds the DSA glue layer, create a mscc_felix_dsa_lib.ko.
> This is similar to how mscc_ocelot_switch_lib.ko holds a library for
> configuring the hardware.
>
> [...]
Here is the summary with links:
- [net-next] net: dsa: ocelot: build felix.c into a dedicated kernel module
https://git.kernel.org/netdev/net-next/c/c8005511f387
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] 3+ messages in thread
end of thread, other threads:[~2023-01-27 8:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-25 14:57 [PATCH net-next] net: dsa: ocelot: build felix.c into a dedicated kernel module Vladimir Oltean
2023-01-26 17:00 ` Colin Foster
2023-01-27 8:00 ` patchwork-bot+netdevbpf
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.