Skip to content

Commit 425f11d

Browse files
KanjiMonsterkuba-moo
authored andcommitted
net: dsa: b53: keep CPU port always tagged again
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 <[email protected]> Tested-by: Florian Fainelli <[email protected]> Reviewed-by: Florian Fainelli <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 5f93185 commit 425f11d

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
@@ -1135,6 +1135,11 @@ static int b53_setup(struct dsa_switch *ds)
11351135
*/
11361136
ds->untag_bridge_pvid = dev->tag_protocol == DSA_TAG_PROTO_NONE;
11371137

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

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

0 commit comments

Comments
 (0)