1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00
linux/drivers/net/ethernet/mscc
Vladimir Oltean 36dd1141be net: mscc: ocelot: treat 802.1ad tagged traffic as 802.1Q-untagged
I was revisiting the topic of 802.1ad treatment in the Ocelot switch [0]
and realized that not only is its basic VLAN classification pipeline
improper for offloading vlan_protocol 802.1ad bridges, but also improper
for offloading regular 802.1Q bridges already.

Namely, 802.1ad-tagged traffic should be treated as VLAN-untagged by
bridged ports, but this switch treats it as if it was 802.1Q-tagged with
the same VID as in the 802.1ad header. This is markedly different to
what the Linux bridge expects; see the "other_tpid()" function in
tools/testing/selftests/net/forwarding/bridge_vlan_aware.sh.

An idea came to me that the VCAP IS1 TCAM is more powerful than I'm
giving it credit for, and that it actually overwrites the classified VID
before the VLAN Table lookup takes place. In other words, it can be
used even to save a packet from being dropped on ingress due to VLAN
membership.

Add a sophisticated TCAM rule hardcoded into the driver to force the
switch to behave like a Linux bridge with vlan_filtering 1 vlan_protocol
802.1Q.

Regarding the lifetime of the filter: eventually the bridge will
disappear, and vlan_filtering on the port will be restored to 0 for
standalone mode. Then the filter will be deleted.

[0]: https://lore.kernel.org/netdev/20201009122947.nvhye4hvcha3tljh@skbuf/

Fixes: 7142529f16 ("net: mscc: ocelot: add VLAN filtering")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2024-08-16 09:59:32 +01:00
..
Kconfig net: dsa: ocelot: add PTP dependency for NET_DSA_MSCC_OCELOT_EXT 2023-02-10 19:35:58 -08:00
Makefile net: mscc: ocelot: add MAC Merge layer support for VSC9959 2023-01-23 12:44:18 +00:00
ocelot.c net: mscc: ocelot: treat 802.1ad tagged traffic as 802.1Q-untagged 2024-08-16 09:59:32 +01:00
ocelot.h net: mscc: ocelot: Remove unused declarations 2023-08-22 10:29:15 -07:00
ocelot_devlink.c net: mscc: ocelot: expose ocelot wm functions 2023-01-30 21:07:20 -08:00
ocelot_fdma.c net: mscc: ocelot: fix QoS class for injected packets with "ocelot-8021q" 2024-08-16 09:59:32 +01:00
ocelot_fdma.h net: ocelot: add FDMA support 2021-12-10 20:56:58 -08:00
ocelot_flower.c net: mscc: ocelot: flower: validate control flags 2024-04-18 17:05:38 -07:00
ocelot_io.c net: mscc: ocelot: refactor enum ocelot_reg decoding to helper 2023-04-13 21:56:06 -07:00
ocelot_mm.c net: mscc: ocelot: fix oversize frame dropping for preemptible TCs 2023-07-06 19:10:22 -07:00
ocelot_mrp.c net: mscc: ocelot: enforce FDB isolation when VLAN-unaware 2022-02-27 11:06:14 +00:00
ocelot_net.c net: Add struct kernel_ethtool_ts_info 2024-07-15 08:02:26 -07:00
ocelot_police.c net: mscc: ocelot: drop port argument from qos_policer_conf_set 2022-05-04 20:42:15 -07:00
ocelot_police.h net: mscc: ocelot: drop port argument from qos_policer_conf_set 2022-05-04 20:42:15 -07:00
ocelot_ptp.c net: Add struct kernel_ethtool_ts_info 2024-07-15 08:02:26 -07:00
ocelot_qs.h
ocelot_rew.h
ocelot_stats.c net: mscc: ocelot: fix pMAC TX RMON stats for bucket 256-511 and above 2023-12-14 17:58:10 -08:00
ocelot_vcap.c net: mscc: ocelot: treat 802.1ad tagged traffic as 802.1Q-untagged 2024-08-16 09:59:32 +01:00
ocelot_vcap.h net: mscc: ocelot: Remove unused declarations 2023-08-22 10:29:15 -07:00
ocelot_vsc7514.c net: mscc: ocelot: serialize access to the injection/extraction groups 2024-08-16 09:59:32 +01:00
vsc7514_regs.c net: mscc: ocelot: fix stat counter register values 2023-05-10 12:11:18 +01:00