net: dsa: build tag_8021q.c as part of DSA core
authorVladimir Oltean <vladimir.oltean@nxp.com>
Mon, 19 Jul 2021 17:14:47 +0000 (20:14 +0300)
committerDavid S. Miller <davem@davemloft.net>
Tue, 20 Jul 2021 13:36:42 +0000 (06:36 -0700)
Upcoming patches will add tag_8021q related logic to switch.c and
port.c, in order to allow it to make use of cross-chip notifiers.
In addition, a struct dsa_8021q_context *ctx pointer will be added to
struct dsa_switch.

It seems fairly low-reward to #ifdef the *ctx from struct dsa_switch and
to provide shim implementations of the entire tag_8021q.c calling
surface (not even clear what to do about the tag_8021q cross-chip
notifiers to avoid compiling them). The runtime overhead for switches
which don't use tag_8021q is fairly small because all helpers will check
for ds->tag_8021q_ctx being a NULL pointer and stop there.

So let's make it part of dsa_core.o.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/dsa/Kconfig
net/dsa/Makefile
net/dsa/tag_8021q.c

index 00bb89b..bca1b5d 100644 (file)
@@ -18,16 +18,6 @@ if NET_DSA
 
 # Drivers must select the appropriate tagging format(s)
 
-config NET_DSA_TAG_8021Q
-       tristate
-       select VLAN_8021Q
-       help
-         Unlike the other tagging protocols, the 802.1Q config option simply
-         provides helpers for other tagging implementations that might rely on
-         VLAN in one way or another. It is not a complete solution.
-
-         Drivers which use these helpers should select this as dependency.
-
 config NET_DSA_TAG_AR9331
        tristate "Tag driver for Atheros AR9331 SoC with built-in switch"
        help
@@ -126,7 +116,6 @@ config NET_DSA_TAG_OCELOT_8021Q
        tristate "Tag driver for Ocelot family of switches, using VLAN"
        depends on MSCC_OCELOT_SWITCH_LIB || \
                  (MSCC_OCELOT_SWITCH_LIB=n && COMPILE_TEST)
-       select NET_DSA_TAG_8021Q
        help
          Say Y or M if you want to enable support for tagging frames with a
          custom VLAN-based header. Frames that require timestamping, such as
@@ -149,7 +138,6 @@ config NET_DSA_TAG_LAN9303
 
 config NET_DSA_TAG_SJA1105
        tristate "Tag driver for NXP SJA1105 switches"
-       select NET_DSA_TAG_8021Q
        select PACKING
        help
          Say Y or M if you want to enable support for tagging frames with the
index 44bc799..67ea009 100644 (file)
@@ -1,10 +1,9 @@
 # SPDX-License-Identifier: GPL-2.0
 # the core
 obj-$(CONFIG_NET_DSA) += dsa_core.o
-dsa_core-y += dsa.o dsa2.o master.o port.o slave.o switch.o
+dsa_core-y += dsa.o dsa2.o master.o port.o slave.o switch.o tag_8021q.o
 
 # tagging formats
-obj-$(CONFIG_NET_DSA_TAG_8021Q) += tag_8021q.o
 obj-$(CONFIG_NET_DSA_TAG_AR9331) += tag_ar9331.o
 obj-$(CONFIG_NET_DSA_TAG_BRCM_COMMON) += tag_brcm.o
 obj-$(CONFIG_NET_DSA_TAG_DSA_COMMON) += tag_dsa.o
index 73966ca..16eb2c7 100644 (file)
@@ -473,5 +473,3 @@ void dsa_8021q_rcv(struct sk_buff *skb, int *source_port, int *switch_id)
        skb->priority = (tci & VLAN_PRIO_MASK) >> VLAN_PRIO_SHIFT;
 }
 EXPORT_SYMBOL_GPL(dsa_8021q_rcv);
-
-MODULE_LICENSE("GPL v2");