linux/drivers/net/dsa
Vladimir Oltean 38b5beeae7 net: dsa: sja1105: prepare tagger for handling DSA tags and VLAN simultaneously
In VLAN-unaware mode, sja1105 uses VLAN tags with a custom TPID of
0xdadb. While in the yet-to-be introduced best_effort_vlan_filtering
mode, it needs to work with normal VLAN TPID values.

A complication arises when we must transmit a VLAN-tagged packet to the
switch when it's in VLAN-aware mode. We need to construct a packet with
2 VLAN tags, and the switch will use the outer header for routing and
pop it on egress. But sadly, here the 2 hardware generations don't
behave the same:

- E/T switches won't pop an ETH_P_8021AD tag on egress, it seems
  (packets will remain double-tagged).
- P/Q/R/S switches will drop a packet with 2 ETH_P_8021Q tags (it looks
  like it tries to prevent VLAN hopping).

But looks like the reverse is also true:

- E/T switches have no problem popping the outer tag from packets with
  2 ETH_P_8021Q tags.
- P/Q/R/S will have no problem popping a single tag even if that is
  ETH_P_8021AD.

So it is clear that if we want the hardware to work with dsa_8021q
tagging in VLAN-aware mode, we need to send different TPIDs depending on
revision. Keep that information in priv->info->qinq_tpid.

The per-port tagger structure will hold an xmit_tpid value that depends
not only upon the qinq_tpid, but also upon the VLAN awareness state
itself (in case we must transmit using 0xdadb).

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2020-05-12 13:08:08 -07:00
..
b53 net: dsa: b53: Remove is_static argument to b53_read_op() 2020-04-30 17:43:29 -07:00
microchip net: dsa: ksz: Select KSZ protocol tag 2020-03-31 10:04:40 -07:00
mv88e6xxx net: dsa: permit cross-chip bridging between all trees in the system 2020-05-10 19:52:33 -07:00
ocelot Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-05-06 22:10:13 -07:00
qca net: dsa: propagate resolved link config via mac_link_up() 2020-02-27 12:02:14 -08:00
sja1105 net: dsa: sja1105: prepare tagger for handling DSA tags and VLAN simultaneously 2020-05-12 13:08:08 -07:00
bcm_sf2.c net: dsa: bcm_sf2: Ensure correct sub-node is parsed 2020-04-06 10:22:58 -07:00
bcm_sf2.h net: dsa: bcm_sf2: Add support for optional reset controller line 2019-11-05 18:06:38 -08:00
bcm_sf2_cfp.c net: dsa: bcm_sf2: Support specifying VLAN tag egress rule 2020-03-30 19:55:42 -07:00
bcm_sf2_regs.h Revert "net: dsa: bcm_sf2: Also configure Port 5 for 2Gb/sec on 7278" 2020-02-26 16:33:35 -08:00
dsa_loop.c net: dsa: Get information about stacked DSA protocol 2020-01-08 16:01:13 -08:00
dsa_loop.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
dsa_loop_bdinfo.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
Kconfig net: dsa: vsc73xx: Remove dependency on CONFIG_OF 2020-01-05 14:23:48 -08:00
lan9303-core.c net: dsa: Get information about stacked DSA protocol 2020-01-08 16:01:13 -08:00
lan9303.h Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-11-04 09:26:51 +09:00
lan9303_i2c.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 174 2019-05-30 11:26:41 -07:00
lan9303_mdio.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 174 2019-05-30 11:26:41 -07:00
lantiq_gswip.c net: dsa: propagate resolved link config via mac_link_up() 2020-02-27 12:02:14 -08:00
lantiq_pce.h net: dsa: Use the correct style for SPDX License Identifier 2019-09-22 15:25:08 -07:00
Makefile net: dsa: add support for Atheros AR9331 built-in switch 2019-12-20 17:05:47 -08:00
mt7530.c net: dsa: mt7530: fix tagged frames pass-through in VLAN-unaware mode 2020-04-16 13:32:05 -07:00
mt7530.h net: dsa: mt7530: fix tagged frames pass-through in VLAN-unaware mode 2020-04-16 13:32:05 -07:00
mv88e6060.c net: dsa: Get information about stacked DSA protocol 2020-01-08 16:01:13 -08:00
mv88e6060.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
qca8k.c net: dsa: Get information about stacked DSA protocol 2020-01-08 16:01:13 -08:00
qca8k.h net: dsa: qca8k: introduce reset via gpio feature 2019-06-27 11:17:30 -07:00
realtek-smi-core.c net: dsa: remove dsa_switch_alloc helper 2019-10-22 12:37:07 -07:00
realtek-smi-core.h net: dsa: fix warning same module names 2019-06-14 19:28:54 -07:00
rtl8366.c net: dsa: rtl8366: Check VLAN ID and not ports 2019-10-02 12:09:23 -04:00
rtl8366rb.c net: dsa: Get information about stacked DSA protocol 2020-01-08 16:01:13 -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: vsc73xx: convert to devm_platform_ioremap_resource 2020-05-08 22:28:24 -07:00
vitesse-vsc73xx-spi.c net: dsa: vsc73xx: Split vsc73xx driver 2019-07-07 14:16:32 -07:00
vitesse-vsc73xx.h net: dsa: vsc73xx: Split vsc73xx driver 2019-07-07 14:16:32 -07:00