]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: replay a deletion of switchdev objects for ports leaving a bridged LAG
authorVladimir Oltean <vladimir.oltean@nxp.com>
Sun, 27 Jun 2021 11:54:29 +0000 (14:54 +0300)
committerDavid S. Miller <davem@davemloft.net>
Mon, 28 Jun 2021 21:09:03 +0000 (14:09 -0700)
commit37fb1fa4c8ea307b2a1c82566dc8237b7811224e
tree9ba8efa46dfb690c3076eb2d2c810484ba88cc03
parentaeb0d0591de6354c2b54d4893716ff78eeae4be3
net: dsa: replay a deletion of switchdev objects for ports leaving a bridged LAG

When a DSA switch port leaves a bonding interface that is under a
bridge, there might be dangling switchdev objects on that port left
behind, because the bridge is not aware that its lower interface (the
bond) changed state in any way.

Call the bridge replay helpers with adding=false before changing
dp->bridge_dev to NULL, because we need to simulate to
dsa_slave_port_obj_del() that these notifications were emitted by the
bridge.

We add this hook to the NETDEV_PRECHANGEUPPER event handler, because
we are calling into switchdev (and the __switchdev_handle_port_obj_del
fanout helpers expect the upper/lower adjacency lists to still be valid)
and PRECHANGEUPPER is the last moment in time when they still are.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/dsa/dsa_priv.h
net/dsa/port.c
net/dsa/slave.c