]> 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:24:05 +0000 (08:24 +0200)
commitaa00a30a28c7aae05f0955c03000f2b8b4596105
treeae666d13e7190ad0d4ea627ceec0fec50ea7a64c
parent0121c19ebd53af5a2d634d8be904060ca95af23e
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