• Saeed Mahameed's avatar
    net/mlx5: cmdif, Avoid skipping reclaim pages if FW is not accessible · b898ce7b
    Saeed Mahameed authored
    In case of pci is offline reclaim_pages_cmd() will still try to call
    the FW to release FW pages, cmd_exec() in this case will return a silent
    success without actually calling the FW.
    
    This is wrong and will cause page leaks, what we should do is to detect
    pci offline or command interface un-available before tying to access the
    FW and manually release the FW pages in the driver.
    
    In this patch we share the code to check for FW command interface
    availability and we call it in sensitive places e.g. reclaim_pages_cmd().
    
    Alternative fix:
     1. Remove MLX5_CMD_OP_MANAGE_PAGES form mlx5_internal_err_ret_value,
        command success simulation list.
     2. Always Release FW pages even if cmd_exec fails in reclaim_pages_cmd().
    Reviewed-by: default avatarMoshe Shemesh <moshe@nvidia.com>
    Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
    b898ce7b
cmd.c 58 KB