History

net/mlx5: cmdif, Avoid skipping reclaim pages if FW is not accessible

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().

Saeed Mahameed committed 6 years ago

Commit b898ce71 parent 410bd753 files · +11 −9Browse files

Showing the changes to include (1 of 3 files). Show all

Unified · Split

include/linux/mlx5/driver.h+1−0
@@ -935,6 +935,7 @@ int mlx5_cmd_exec(struct mlx5_core_dev *dev, void *in, int in_size, void *out, · 934 unmodified lines
935935 int mlx5_cmd_exec_polling(struct mlx5_core_dev *dev, void *in, int in_size,
936936 void *out, int out_size);
937937 void mlx5_cmd_mbox_status(void *out, u8 *status, u32 *syndrome);
938+bool mlx5_cmd_is_down(struct mlx5_core_dev *dev);
938939
939940 int mlx5_core_get_caps(struct mlx5_core_dev *dev, enum mlx5_cap_type cap_type);
940941 int mlx5_cmd_alloc_uar(struct mlx5_core_dev *dev, u32 *uarn);