• Ido Schimmel's avatar
    mlxsw: spectrum: Add FDB lock to prevent session interleaving · 366ce603
    Ido Schimmel authored
    Dumping the FDB (invoked with a process context) or handling FDB
    notifications (polled periodicly in delayed work) might each entail
    multiple EMAD transcations due to the number of entries.
    
    While we only allow one EMAD transaction at a time, there is nothing
    stopping the dump and notification processing sessions from
    interleaving. However, this is forbidden by the hardware, so we need to
    make sure only one of these sessions can run at a time.
    
    Solve this by adding a mutex ('fdb_lock'), as both kernel threads can
    sleep while waiting for the response EMAD.
    
    Fixes: 56ade8fe ("mlxsw: spectrum: Add initial support for Spectrum ASIC")
    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>
    366ce603
spectrum.h 4.32 KB