• Eran Ben Elisha's avatar
    net/mlx5: Fix a race when moving command interface to polling mode · 432161ea
    Eran Ben Elisha authored
    As part of driver unload, it destroys the commands EQ (via FW command).
    As the commands EQ is destroyed, FW will not generate EQEs for any command
    that driver sends afterwards. Driver should poll for later commands status.
    
    Driver commands mode metadata is updated before the commands EQ is
    actually destroyed. This can lead for double completion handle by the
    driver (polling and interrupt), if a command is executed and completed by
    FW after the mode was changed, but before the EQ was destroyed.
    
    Fix that by using the mlx5_cmd_allowed_opcode mechanism to guarantee
    that only DESTROY_EQ command can be executed during this time period.
    
    Fixes: e126ba97 ("mlx5: Add driver for Mellanox Connect-IB adapters")
    Signed-off-by: default avatarEran Ben Elisha <eranbe@mellanox.com>
    Reviewed-by: default avatarMoshe Shemesh <moshe@mellanox.com>
    Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
    432161ea
eq.c 22.9 KB