linux-yocto/include/soc
Vladimir Oltean dc7ffe02ad net: mscc: ocelot: treat 802.1ad tagged traffic as 802.1Q-untagged
[ Upstream commit 36dd1141be ]

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>
Stable-dep-of: 5ec6d7d737 ("net: mscc: ocelot: delete PVID VLAN when readding it as non-PVID")
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-05-09 09:43:58 +02:00
..
amlogic
arc
at91 ARM: at91: Remove unused extern declarations 2023-07-29 16:56:09 +03:00
bcm2835
canaan
fsl
imx clk: imx25: print silicon revision during init 2023-08-14 12:41:05 +03:00
mediatek iommu/mediatek: Add enable IOMMU SMC command for INFRA masters 2023-08-07 14:15:48 +02:00
microchip
mscc net: mscc: ocelot: treat 802.1ad tagged traffic as 802.1Q-untagged 2025-05-09 09:43:58 +02:00
qcom soc: qcom: ice: introduce devm_of_qcom_ice_get 2025-05-02 07:50:37 +02:00
rockchip
sa1100
sifive
starfive
tegra firmware: tegra: Add suspend hook and reset BPMP IPC early on resume 2023-11-20 11:59:16 +01:00