]> www.infradead.org Git - users/dwmw2/linux.git/commit
net: dsa: b53: fix clearing PVID of a port
authorJonas Gorski <jonas.gorski@gmail.com>
Tue, 29 Apr 2025 20:17:02 +0000 (22:17 +0200)
committerJakub Kicinski <kuba@kernel.org>
Thu, 8 May 2025 02:30:34 +0000 (19:30 -0700)
commitf480851981043d9bb6447ca9883ade9247b9a0ad
tree5b292a6b746ed601a3b8431740c1d03fcca16481
parent425f11d4cc9bd9e97e6825d9abb2c51a068ca7b5
net: dsa: b53: fix clearing PVID of a port

Currently the PVID of ports are only set when adding/updating VLANs with
PVID set or removing VLANs, but not when clearing the PVID flag of a
VLAN.

E.g. the following flow

$ ip link add br0 type bridge vlan_filtering 1
$ ip link set sw1p1 master bridge
$ bridge vlan add dev sw1p1 vid 10 pvid untagged
$ bridge vlan add dev sw1p1 vid 10 untagged

Would keep the PVID set as 10, despite the flag being cleared. Fix this
by checking if we need to unset the PVID on vlan updates.

Fixes: a2482d2ce349 ("net: dsa: b53: Plug in VLAN support")
Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
Tested-by: Florian Fainelli <florian.fainelli@broadcom.com>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Link: https://patch.msgid.link/20250429201710.330937-4-jonas.gorski@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/dsa/b53/b53_common.c