]> git.baikalelectronics.ru Git - kernel.git/commit
mlxsw: spectrum: Clear VLAN filters during port initialization
authorIdo Schimmel <idosch@mellanox.com>
Thu, 26 Sep 2019 11:43:38 +0000 (14:43 +0300)
committerDavid S. Miller <davem@davemloft.net>
Fri, 27 Sep 2019 18:33:19 +0000 (20:33 +0200)
commit9bf83e2f8986e7eacfee79beccfed0acdc6ca796
treefbc6206678f3a9c8a8316ff093fd1715201e452d
parent71d784265fef61e8d785e3d3df4bbcb56263f4c2
mlxsw: spectrum: Clear VLAN filters during port initialization

When a port is created, its VLAN filters are not cleared by the
firmware. This causes tagged packets to be later dropped by the ingress
STP filters, which default to DISCARD state.

The above did not matter much until commit f313c87b4f4e ("mlxsw:
spectrum: Add devlink-trap support") where we exposed the drop reason to
users.

Without this patch, the drop reason users will see is not consistent. If
a port is enslaved to a VLAN-aware bridge and a packet with an invalid
VLAN tries to ingress the bridge, it will be dropped due to ingress STP
filter. If the VLAN is later enabled and then disabled, the packet will
be dropped by the ingress VLAN filter despite the above being a
seemingly NOP operation.

Fix this by clearing all the VLAN filters during port initialization.
Adjust the test accordingly.

Fixes: f313c87b4f4e ("mlxsw: spectrum: Add devlink-trap support")
Reported-by: Alex Kushnarov <alexanderk@mellanox.com>
Tested-by: Alex Kushnarov <alexanderk@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum.c
tools/testing/selftests/drivers/net/mlxsw/devlink_trap_l2_drops.sh