• Bodong Wang's avatar
    net/mlx5: E-Switch, Hold mutex when querying drop counter in legacy mode · 14c844cb
    Bodong Wang authored
    Consider scenario below, CPU 1 is at risk to query already destroyed
    drop counters. Need to apply the same state mutex when disabling vport.
    
    +-------------------------------+-------------------------------------+
    | CPU 0                         | CPU 1                               |
    +-------------------------------+-------------------------------------+
    | mlx5_device_disable_sriov     | mlx5e_get_vf_stats                  |
    | mlx5_eswitch_disable          | mlx5_eswitch_get_vport_stats        |
    | esw_disable_vport             | mlx5_eswitch_query_vport_drop_stats |
    | mlx5_fc_destroy(drop_counter) | mlx5_fc_query(drop_counter)         |
    +-------------------------------+-------------------------------------+
    
    Fixes: b8a0dbe3 ("net/mlx5e: E-switch, Add steering drop counters")
    Signed-off-by: default avatarBodong Wang <bodong@mellanox.com>
    Reviewed-by: default avatarParav Pandit <parav@mellanox.com>
    Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
    14c844cb
eswitch.c 76.8 KB