]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net: dsa: tag_8021q: Change order of rx_vid setup
authorIoana Ciornei <ioana.ciornei@nxp.com>
Wed, 29 May 2019 21:42:30 +0000 (00:42 +0300)
committerDavid S. Miller <davem@davemloft.net>
Thu, 30 May 2019 21:47:14 +0000 (14:47 -0700)
commitd34d2baa9173f6e0c0f22d005d18e83d1cb54d8d
tree6faa3f16bcf1c7b9d598f3345fde3da5d11555dc
parent21808437214637952b61beaba6034d97880fbeb3
net: dsa: tag_8021q: Change order of rx_vid setup

The 802.1Q tagging performs an unbalanced setup in terms of RX VIDs on
the CPU port. For the ingress path of a 802.1Q switch to work, the RX
VID of a port needs to be seen as tagged egress on the CPU port.

While configuring the other front-panel ports to be part of this VID,
for bridge scenarios, the untagged flag is applied even on the CPU port
in dsa_switch_vlan_add.  This happens because DSA applies the same flags
on the CPU port as on the (bridge-controlled) slave ports, and the
effect in this case is that the CPU port tagged settings get deleted.

Instead of fixing DSA by introducing a way to control VLAN flags on the
CPU port (and hence stop inheriting from the slave ports) - a hard,
perhaps intractable problem - avoid this situation by moving the setup
part of the RX VID on the CPU port after all the other front-panel ports
have been added to the VID.

Fixes: f9bbe4477c30 ("net: dsa: Optional VLAN-based port separation for switches without tagging")
Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: Vladimir Oltean <olteanv@gmail.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/dsa/tag_8021q.c