• Vladimir Oltean's avatar
    net: dsa: replay a deletion of switchdev objects for ports leaving a bridged LAG · 74918945
    Vladimir Oltean authored
    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: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    74918945
port.c 26.9 KB