linux/drivers/net/ethernet/mscc
Vladimir Oltean 5ec6d7d737 net: mscc: ocelot: delete PVID VLAN when readding it as non-PVID
The following set of commands:

ip link add br0 type bridge vlan_filtering 1 # vlan_default_pvid 1 is implicit
ip link set swp0 master br0
bridge vlan add dev swp0 vid 1

should result in the dropping of untagged and 802.1p-tagged traffic, but
we see that it continues to be accepted. Whereas, had we deleted VID 1
instead, the aforementioned dropping would have worked

This is because the ANA_PORT_DROP_CFG update logic doesn't run, because
ocelot_vlan_add() only calls ocelot_port_set_pvid() if the new VLAN has
the BRIDGE_VLAN_INFO_PVID flag.

Similar to other drivers like mt7530_port_vlan_add() which handle this
case correctly, we need to test whether the VLAN we're changing used to
have the BRIDGE_VLAN_INFO_PVID flag, but lost it now. That amounts to a
PVID deletion and should be treated as such.

Regarding blame attribution: this never worked properly since the
introduction of bridge VLAN filtering in commit 7142529f16 ("net:
mscc: ocelot: add VLAN filtering"). However, there was a significant
paradigm shift which aligned the ANA_PORT_DROP_CFG register with the
PVID concept rather than with the native VLAN concept, and that change
wasn't targeted for 'stable'. Realistically, that is as far as this fix
needs to be propagated to.

Fixes: be0576fed6 ("net: mscc: ocelot: move the logic to drop 802.1p traffic to the pvid deletion")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Link: https://patch.msgid.link/20250424223734.3096202-1-vladimir.oltean@nxp.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-04-25 18:45:43 -07: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: delete PVID VLAN when readding it as non-PVID 2025-04-25 18:45:43 -07: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
ocelot_flower.c net: mscc: ocelot: allow tc-flower mirred action towards foreign interfaces 2024-10-30 17:33:55 -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
ocelot_net.c net: mscc: ocelot: add TX timestamping statistics 2025-01-17 20:01:10 -08:00
ocelot_police.c
ocelot_police.h
ocelot_ptp.c net: mscc: ocelot: add TX timestamping statistics 2025-01-17 20:01:10 -08:00
ocelot_qs.h
ocelot_rew.h
ocelot_stats.c net: mscc: ocelot: add TX timestamping statistics 2025-01-17 20:01: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: ethernet: Switch back to struct platform_driver::remove() 2024-10-04 16:39:56 -07:00
vsc7514_regs.c net: mscc: ocelot: fix stat counter register values 2023-05-10 12:11:18 +01:00