Skip to content

Commit a8fdba2

Browse files
KanjiMonsterSasha Levin
authored andcommitted
net: dsa: b53: keep CPU port always tagged again
[ Upstream commit 425f11d ] The Broadcom management header does not carry the original VLAN tag state information, just the ingress port, so for untagged frames we do not know from which VLAN they originated. Therefore keep the CPU port always tagged except for VLAN 0. Fixes the following setup: $ ip link add br0 type bridge vlan_filtering 1 $ ip link set sw1p1 master br0 $ bridge vlan add dev br0 pvid untagged self $ ip link add sw1p2.10 link sw1p2 type vlan id 10 Where VID 10 would stay untagged on the CPU port. Fixes: 2c32a3d ("net: dsa: b53: Do not force CPU to be always tagged") 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-3-jonas.gorski@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent f94f47b commit a8fdba2

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

drivers/net/dsa/b53/b53_common.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1136,6 +1136,11 @@ static int b53_setup(struct dsa_switch *ds)
11361136
*/
11371137
ds->untag_bridge_pvid = dev->tag_protocol == DSA_TAG_PROTO_NONE;
11381138

1139+
/* The switch does not tell us the original VLAN for untagged
1140+
* packets, so keep the CPU port always tagged.
1141+
*/
1142+
ds->untag_vlan_aware_bridge_pvid = true;
1143+
11391144
ret = b53_reset_switch(dev);
11401145
if (ret) {
11411146
dev_err(ds->dev, "failed to reset switch\n");
@@ -1546,6 +1551,9 @@ int b53_vlan_add(struct dsa_switch *ds, int port,
15461551
if (vlan->vid == 0 && vlan->vid == b53_default_pvid(dev))
15471552
untagged = true;
15481553

1554+
if (vlan->vid > 0 && dsa_is_cpu_port(ds, port))
1555+
untagged = false;
1556+
15491557
vl->members |= BIT(port);
15501558
if (untagged && !b53_vlan_port_needs_forced_tagged(ds, port))
15511559
vl->untag |= BIT(port);

0 commit comments

Comments
 (0)