• Ido Schimmel's avatar
    mlxsw: spectrum_switchdev: Release multicast groups during fini · 852cfeed
    Ido Schimmel authored
    Each multicast group (MID) stores a bitmap of ports to which a packet
    should be forwarded to in case an MDB entry associated with the MID is
    hit.
    
    Since the initial introduction of IGMP snooping in commit 3a49b4fd
    ("mlxsw: Adding layer 2 multicast support") the driver didn't correctly
    free these multicast groups upon ungraceful situations such as the
    removal of the upper bridge device or module removal.
    
    The correct way to fix this is to associate each MID with the bridge
    ports member in it and then drop the reference in case the bridge port
    is destroyed, but this will result in a lot more code and will be fixed
    in net-next.
    
    For now, upon module removal, traverse the MID list and release each
    one.
    
    Fixes: 3a49b4fd ("mlxsw: Adding layer 2 multicast support")
    Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
    Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    852cfeed
spectrum_switchdev.c 55.6 KB