• Ido Schimmel's avatar
    mlxsw: spectrum_router: Flush FIB tables during fini · ac571de9
    Ido Schimmel authored
    Since commit b45f64d1 ("mlxsw: spectrum_router: Use FIB notifications
    instead of switchdev calls") we reflect to the device the entire FIB
    table and not only FIBs that point to netdevs created by the driver.
    
    During module removal, FIBs of the second type are removed following
    NETDEV_UNREGISTER events sent. The other FIBs are still present in both
    the driver's cache and the device's table.
    
    Fix this by iterating over all the FIB tables in the device and flush
    them. There's no need to take locks, as we're the only writer.
    
    Fixes: b45f64d1 ("mlxsw: spectrum_router: Use FIB notifications instead of switchdev calls")
    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>
    ac571de9
spectrum_router.c 54.3 KB