]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: felix: send VLANs on CPU port as egress-tagged
authorVladimir Oltean <vladimir.oltean@nxp.com>
Wed, 27 May 2020 16:48:03 +0000 (19:48 +0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 27 May 2020 18:40:38 +0000 (11:40 -0700)
commitc5982a283931313b572e2ae7ac59167d0c1374cf
treeda46b2e726e23fb7a142eb6ba697a11a1c09db5c
parent333988cc6d7a64d3ab35ce4dea6cb66882a3f7c7
net: dsa: felix: send VLANs on CPU port as egress-tagged

As explained in other commits before (57c416d949f8 and 437a28517003),
ocelot switches have a single egress-untagged VLAN per port, and the
driver would deny adding a second one while an egress-untagged VLAN
already exists.

But on the CPU port (where the VLAN configuration is implicit, because
there is no net device for the bridge to control), the DSA core attempts
to add a VLAN using the same flags as were used for the front-panel
port. This would make adding any untagged VLAN fail due to the CPU port
rejecting the configuration:

bridge vlan add dev swp0 vid 100 pvid untagged
[ 1865.854253] mscc_felix 0000:00:00.5: Port already has a native VLAN: 1
[ 1865.860824] mscc_felix 0000:00:00.5: Failed to add VLAN 100 to port 5: -16

(note that port 5 is the CPU port and not the front-panel swp0).

So this hardware will send all VLANs as tagged towards the CPU.

Fixes: 620a56f56947 ("net: dsa: ocelot: add driver for Felix switch family")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/ocelot/felix.c