linux/drivers/net/dsa
Vladimir Oltean e21268efbe net: dsa: felix: perform switch setup for tag_8021q
Unlike sja1105, the only other user of the software-defined tag_8021q.c
tagger format, the implementation we choose for the Felix DSA switch
driver preserves full functionality under a vlan_filtering bridge
(i.e. IP termination works through the DSA user ports under all
circumstances).

The tag_8021q protocol just wants:
- Identifying the ingress switch port based on the RX VLAN ID, as seen
  by the CPU. We achieve this by using the TCAM engines (which are also
  used for tc-flower offload) to push the RX VLAN as a second, outer
  tag, on egress towards the CPU port.
- Steering traffic injected into the switch from the network stack
  towards the correct front port based on the TX VLAN, and consuming
  (popping) that header on the switch's egress.

A tc-flower pseudocode of the static configuration done by the driver
would look like this:

$ tc qdisc add dev <cpu-port> clsact
$ for eth in swp0 swp1 swp2 swp3; do \
	tc filter add dev <cpu-port> egress flower indev ${eth} \
		action vlan push id <rxvlan> protocol 802.1ad; \
	tc filter add dev <cpu-port> ingress protocol 802.1Q flower
		vlan_id <txvlan> action vlan pop \
		action mirred egress redirect dev ${eth}; \
done

but of course since DSA does not register network interfaces for the CPU
port, this configuration would be impossible for the user to do. Also,
due to the same reason, it is impossible for the user to inadvertently
delete these rules using tc. These rules do not collide in any way with
tc-flower, they just consume some TCAM space, which is something we can
live with.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2021-01-29 21:25:27 -08:00
..
b53 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-01-20 12:16:11 -08:00
hirschmann net: dsa: hellcreek: Add missing TAPRIO dependency 2021-01-29 21:02:31 -08:00
microchip Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-01-28 17:09:31 -08:00
mv88e6xxx net: dsa: mv88e6xxx: Make global2 support mandatory 2021-01-27 19:28:16 -08:00
ocelot net: dsa: felix: perform switch setup for tag_8021q 2021-01-29 21:25:27 -08:00
qca net: dsa: set configure_vlan_while_not_filtering to true by default 2021-01-15 17:29:40 -08:00
sja1105 net: dsa: set configure_vlan_while_not_filtering to true by default 2021-01-15 17:29:40 -08:00
xrs700x net: dsa: add Arrow SpeedChips XRS700x driver 2021-01-15 15:37:37 -08:00
bcm_sf2.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-01-28 17:09:31 -08:00
bcm_sf2.h net: dsa: bcm_sf2: recalculate switch clock rate based on ports 2020-09-03 15:08:03 -07:00
bcm_sf2_cfp.c net: dsa: remove the transactional logic from VLAN objects 2021-01-11 16:00:57 -08:00
bcm_sf2_regs.h net: dsa: bcm_sf2: support BCM4908's integrated switch 2021-01-09 19:18:10 -08:00
dsa_loop.c net: dsa: Fix off by one in dsa_loop_port_vlan_add() 2021-01-20 17:10:04 -08:00
dsa_loop.h
dsa_loop_bdinfo.c
Kconfig net: dsa: add Arrow SpeedChips XRS700x driver 2021-01-15 15:37:37 -08:00
lan9303-core.c net: dsa: remove the transactional logic from MDB entries 2021-01-11 16:00:57 -08:00
lan9303.h
lan9303_i2c.c
lan9303_mdio.c
lantiq_gswip.c net: dsa: set configure_vlan_while_not_filtering to true by default 2021-01-15 17:29:40 -08:00
lantiq_pce.h
Makefile net: dsa: add Arrow SpeedChips XRS700x driver 2021-01-15 15:37:37 -08:00
mt7530.c net: dsa: mt7530: MT7530 optional GPIO support 2021-01-25 18:29:04 -08:00
mt7530.h net: dsa: mt7530: MT7530 optional GPIO support 2021-01-25 18:29:04 -08:00
mv88e6060.c
mv88e6060.h
qca8k.c net: dsa: set configure_vlan_while_not_filtering to true by default 2021-01-15 17:29:40 -08:00
qca8k.h net: dsa: qca8k: Add 802.1q VLAN support 2020-08-03 15:45:39 -07:00
realtek-smi-core.c net: dsa: rtl8366rb: Roof MTU for switch 2020-10-10 11:25:05 -07:00
realtek-smi-core.h net: dsa: remove the transactional logic from VLAN objects 2021-01-11 16:00:57 -08:00
rtl8366.c net: dsa: remove the transactional logic from VLAN objects 2021-01-11 16:00:57 -08:00
rtl8366rb.c net: dsa: rtl8366rb: standardize init jam tables 2021-01-27 20:21:20 -08:00
vitesse-vsc73xx-core.c net: dsa: vsc73xx: make the MTU configurable 2020-03-27 16:07:25 -07:00
vitesse-vsc73xx-platform.c net: dsa: vitesse-vsc73xx: Convert to plain comments to avoid kerneldoc warnings 2020-07-05 15:49:03 -07:00
vitesse-vsc73xx-spi.c net: dsa: vitesse-vsc73xx: Convert to plain comments to avoid kerneldoc warnings 2020-07-05 15:49:03 -07:00
vitesse-vsc73xx.h