• Vladimir Oltean's avatar
    net: bridge: allow the switchdev replay functions to be called for deletion · 7e8c1858
    Vladimir Oltean authored
    When a switchdev port leaves a LAG that is a bridge port, the switchdev
    objects and port attributes offloaded to that port are not removed:
    
    ip link add br0 type bridge
    ip link add bond0 type bond mode 802.3ad
    ip link set swp0 master bond0
    ip link set bond0 master br0
    bridge vlan add dev bond0 vid 100
    ip link set swp0 nomaster
    
    VLAN 100 will remain installed on swp0 despite it going into standalone
    mode, because as far as the bridge is concerned, nothing ever happened
    to its bridge port.
    
    Let's extend the bridge vlan, fdb and mdb replay functions to take a
    'bool adding' argument, and make DSA and ocelot call the replay
    functions with 'adding' as false from the switchdev unsync path, for the
    switch port that leaves the bridge.
    
    Note that this patch in itself does not salvage anything, because in the
    current pull mode of operation, DSA still needs to call the replay
    helpers with adding=false. This will be done in another patch.
    Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
    Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    7e8c1858
br_fdb.c 33.8 KB