]> git.baikalelectronics.ru Git - kernel.git/commit
Revert "net: dsa: sja1105: Clear VLAN filtering offload netdev feature"
authorVladimir Oltean <vladimir.oltean@nxp.com>
Sat, 20 Mar 2021 23:04:45 +0000 (01:04 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sun, 21 Mar 2021 02:17:05 +0000 (19:17 -0700)
commit3182e976bab3efa1275a558cc678a1c49fc506ae
tree9862cba478297531b01ed935f064b1dc60b97508
parent2de6f834db9f9567a0a41a08f7977ef11ab23bb2
Revert "net: dsa: sja1105: Clear VLAN filtering offload netdev feature"

This reverts commit 6246ffbe76246f6c6713d7de03948691d714c36f.

The topic of the reverted patch is the support for switches with global
VLAN filtering, added by commit 6ecf933fb3e9 ("net: dsa: Add
ndo_vlan_rx_{add, kill}_vid implementation"). Be there a switch with 4
ports swp0 -> swp3, and the following setup:

ip link add br0 type bridge vlan_filtering 1
ip link set swp0 master br0
ip link set swp1 master br0

What would happen with VLAN-tagged traffic received on standalone ports
swp2 and swp3? Well, it would get dropped, were it not for the
.ndo_vlan_rx_add_vid and .ndo_vlan_rx_kill_vid implementations (called
from vlan_vid_add and vlan_vid_del respectively). Basically, for DSA
switches where VLAN filtering is a global attribute, we enforce the
standalone ports to have 'rx-vlan-filter: off [fixed]' in their ethtool
features, which lets the user know that all VLAN-tagged packets that are
not explicitly added in the RX filtering list are dropped.

As for the sja1105 driver, at the time of the reverted patch, it was
operating in a pretty handicapped mode when it had ports under a bridge
with vlan_filtering=1. Specifically, it was unable to terminate traffic
through the CPU port (for further explanation see "Traffic support" in
Documentation/networking/dsa/sja1105.rst).

However, since then, the sja1105 driver has made considerable progress,
and that limitation is no longer as severe now. Specifically, since
commit 0b1c67331cc8 ("net: dsa: sja1105: add a new
best_effort_vlan_filtering devlink parameter"), the driver is able to
perform CPU termination even when some ports are under bridges with
vlan_filtering=1. Then, since commit 3091d75eabc0 ("net: dsa: sja1105:
make devlink property best_effort_vlan_filtering true by default"), this
even became the default operating mode.

So we can now take advantage of the logic in the DSA core.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/sja1105/sja1105_main.c