]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: mv88e6xxx: flush switchdev FDB workqueue before removing VLAN
authorVladimir Oltean <vladimir.oltean@nxp.com>
Fri, 11 Feb 2022 17:45:06 +0000 (19:45 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 14 Feb 2022 13:31:12 +0000 (13:31 +0000)
commit7ca57a85cdc5ebe560597045e76938368fbdcb98
tree669fc14cf6712ffa500647b23f5454653ce95524
parent50609c069a0221aeebf1b93a24a3847183a79d04
net: dsa: mv88e6xxx: flush switchdev FDB workqueue before removing VLAN

mv88e6xxx is special among DSA drivers in that it requires the VTU to
contain the VID of the FDB entry it modifies in
mv88e6xxx_port_db_load_purge(), otherwise it will return -EOPNOTSUPP.

Sometimes due to races this is not always satisfied even if external
code does everything right (first deletes the FDB entries, then the
VLAN), because DSA commits to hardware FDB entries asynchronously since
commit 9a65c3fb3351 ("net: dsa: Add support for learning FDB through
notification").

Therefore, the mv88e6xxx driver must close this race condition by
itself, by asking DSA to flush the switchdev workqueue of any FDB
deletions in progress, prior to exiting a VLAN.

Fixes: 9a65c3fb3351 ("net: dsa: Add support for learning FDB through notification")
Reported-by: Rafael Richter <rafael.richter@gin.de>
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/mv88e6xxx/chip.c
include/net/dsa.h
net/dsa/dsa.c
net/dsa/dsa_priv.h