linux/drivers/net/dsa
Vladimir Oltean 91495f21fc net: dsa: tag_8021q: replace the SVL bridging with VLAN-unaware IVL bridging
For VLAN-unaware bridging, tag_8021q uses something perhaps a bit too
tied with the sja1105 switch: each port uses the same pvid which is also
used for standalone operation (a unique one from which the source port
and device ID can be retrieved when packets from that port are forwarded
to the CPU). Since each port has a unique pvid when performing
autonomous forwarding, the switch must be configured for Shared VLAN
Learning (SVL) such that the VLAN ID itself is ignored when performing
FDB lookups. Without SVL, packets would always be flooded, since FDB
lookup in the source port's VLAN would never find any entry.

First of all, to make tag_8021q more palatable to switches which might
not support Shared VLAN Learning, let's just use a common VLAN for all
ports that are under the same bridge.

Secondly, using Shared VLAN Learning means that FDB isolation can never
be enforced. But if all ports under the same VLAN-unaware bridge share
the same VLAN ID, it can.

The disadvantage is that the CPU port can no longer perform precise
source port identification for these packets. But at least we have a
mechanism which has proven to be adequate for that situation: imprecise
RX (dsa_find_designated_bridge_port_by_vid), which is what we use for
termination on VLAN-aware bridges.

The VLAN ID that VLAN-unaware bridges will use with tag_8021q is the
same one as we were previously using for imprecise TX (bridge TX
forwarding offload). It is already allocated, it is just a matter of
using it.

Note that because now all ports under the same bridge share the same
VLAN, the complexity of performing a tag_8021q bridge join decreases
dramatically. We no longer have to install the RX VLAN of a newly
joining port into the port membership of the existing bridge ports.
The newly joining port just becomes a member of the VLAN corresponding
to that bridge, and the other ports are already members of it from when
they joined the bridge themselves. So forwarding works properly.

This means that we can unhook dsa_tag_8021q_bridge_{join,leave} from the
cross-chip notifier level dsa_switch_bridge_{join,leave}. We can put
these calls directly into the sja1105 driver.

With this new mode of operation, a port controlled by tag_8021q can have
two pvids whereas before it could only have one. The pvid for standalone
operation is different from the pvid used for VLAN-unaware bridging.
This is done, again, so that FDB isolation can be enforced.
Let tag_8021q manage this by deleting the standalone pvid when a port
joins a bridge, and restoring it when it leaves it.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2022-02-27 11:06:13 +00:00
..
b53 net: dsa: b53: mark as non-legacy 2022-02-22 11:03:02 +00:00
hirschmann net: dsa: hellcreek: Add missing PTP via UDP rules 2021-12-14 18:46:29 -08:00
microchip Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-02-24 17:54:25 -08:00
mv88e6xxx net: dsa: create a dsa_lag structure 2022-02-24 21:31:43 -08:00
ocelot net: dsa: ocelot: mark as non-legacy 2022-02-26 12:44:29 +00:00
qca Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-02-10 17:29:56 -08:00
realtek net: dsa: realtek: rtl8365mb: serialize indirect PHY register access 2022-02-23 12:24:29 +00:00
sja1105 net: dsa: tag_8021q: replace the SVL bridging with VLAN-unaware IVL bridging 2022-02-27 11:06:13 +00:00
xrs700x net: dsa: xrs700x: convert to phylink_generic_validate() 2022-02-03 11:47:06 +00:00
bcm_sf2_cfp.c
bcm_sf2_regs.h net: dsa: bcm_sf2: refactor LED regs access 2021-12-30 17:28:32 -08:00
bcm_sf2.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-02-10 17:29:56 -08:00
bcm_sf2.h net: dsa: bcm_sf2: refactor LED regs access 2021-12-30 17:28:32 -08:00
dsa_loop_bdinfo.c
dsa_loop.c net: dsa: add a "tx_fwd_offload" argument to ->port_bridge_join 2021-12-08 14:31:16 -08:00
dsa_loop.h
Kconfig Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-02-17 11:44:20 -08:00
lan9303_i2c.c
lan9303_mdio.c
lan9303-core.c net: dsa: lan9303: add VLAN IDs to master device 2022-02-17 09:32:13 -08:00
lan9303.h
lantiq_gswip.c net: dsa: lantiq_gswip: fix use after free in gswip_remove() 2022-02-16 20:39:13 -08:00
lantiq_pce.h
Makefile net: dsa: realtek-smi: move to subdirectory 2022-01-28 15:02:49 +00:00
mt7530.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-02-10 17:29:56 -08:00
mt7530.h
mv88e6060.c
mv88e6060.h
qca8k.c net: dsa: qca8k: return with -EINVAL on invalid port 2022-02-25 22:21:24 -08:00
qca8k.h net: dsa: qca8k: convert to use phylink_pcs 2022-02-18 11:28:33 +00:00
vitesse-vsc73xx-core.c net: dsa: vsc73xxx: Get rid of duplicate of_node assignment 2021-12-03 14:13:02 +00:00
vitesse-vsc73xx-platform.c
vitesse-vsc73xx-spi.c
vitesse-vsc73xx.h