• Eran Ben Elisha's avatar
    net/mlx5: poll cmd EQ in case of command timeout · 1d5558b1
    Eran Ben Elisha authored
    Once driver detects a command interface command timeout, it warns the
    user and returns timeout error to the caller. In such case, the entry of
    the command is not evacuated (because only real event interrupt is allowed
    to clear command interface entry). If the HW event interrupt
    of this entry will never arrive, this entry will be left unused forever.
    Command interface entries are limited and eventually we can end up without
    the ability to post a new command.
    
    In addition, if driver will not consume the EQE of the lost interrupt and
    rearm the EQ, no new interrupts will arrive for other commands.
    
    Add a resiliency mechanism for manually polling the command EQ in case of
    a command timeout. In case resiliency mechanism will find non-handled EQE,
    it will consume it, and the command interface will be fully functional
    again. Once the resiliency flow finished, wait another 5 seconds for the
    command interface to complete for this command entry.
    
    Define mlx5_cmd_eq_recover() to manage the cmd EQ polling resiliency flow.
    Add an async EQ spinlock to avoid races between resiliency flows and real
    interrupts that might run simultaneously.
    
    Fixes: e126ba97 ("mlx5: Add driver for Mellanox Connect-IB adapters")
    Signed-off-by: default avatarEran Ben Elisha <eranbe@mellanox.com>
    Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
    1d5558b1
eq.h 3.19 KB