]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 18 May 2025 06:20:35 +0000 (08:20 +0200)
commit1b094a7c84b1991b38d936f461a03d07c1aed59e
tree3efdf9344bb4d2953892c3b5f0be9afc378b1e14
parent402be90e4ebdd4709bdfdb0d0d848a3441c77fa2
net: dsa: b53: fix clearing PVID of a port

[ Upstream commit f480851981043d9bb6447ca9883ade9247b9a0ad ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/dsa/b53/b53_common.c