Skip to content

Commit ca89319

Browse files
ffainellidavem330
authored andcommitted
net: dsa: b53: Keep CPU port as tagged in all VLANs
Commit c499696 ("net: dsa: b53: Stop using dev->cpu_port incorrectly") was a bit too trigger happy in removing the CPU port from the VLAN membership because we rely on DSA to program the CPU port VLAN, which it does, except it does not bother itself with tagged/untagged and just usese untagged. Having the CPU port "follow" the user ports tagged/untagged is not great and does not allow for properly differentiating, so keep the CPU port tagged in all VLANs. Reported-by: Gerhard Wiesinger <lists@wiesinger.com> Fixes: c499696 ("net: dsa: b53: Stop using dev->cpu_port incorrectly") Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 17c357e commit ca89319

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/net/dsa/b53/b53_common.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1107,7 +1107,7 @@ void b53_vlan_add(struct dsa_switch *ds, int port,
11071107
b53_get_vlan_entry(dev, vid, vl);
11081108

11091109
vl->members |= BIT(port);
1110-
if (untagged)
1110+
if (untagged && !dsa_is_cpu_port(ds, port))
11111111
vl->untag |= BIT(port);
11121112
else
11131113
vl->untag &= ~BIT(port);
@@ -1149,7 +1149,7 @@ int b53_vlan_del(struct dsa_switch *ds, int port,
11491149
pvid = 0;
11501150
}
11511151

1152-
if (untagged)
1152+
if (untagged && !dsa_is_cpu_port(ds, port))
11531153
vl->untag &= ~(BIT(port));
11541154

11551155
b53_set_vlan_entry(dev, vid, vl);

0 commit comments

Comments
 (0)