net/mlx5: Don't overwrite HCA capabilities when setting MSI-X count
authorLeon Romanovsky <leonro@nvidia.com>
Sun, 25 Apr 2021 10:28:10 +0000 (13:28 +0300)
committerSaeed Mahameed <saeedm@nvidia.com>
Wed, 19 May 2021 06:01:51 +0000 (23:01 -0700)
commit75e8564e919f369cafb3d2b8fd11ec5af7b37416
tree8f56b568dc4539be74cff6f7f2e7c93fb770a98e
parent7c9f131f366ab414691907fa0407124ea2b2f3bc
net/mlx5: Don't overwrite HCA capabilities when setting MSI-X count

During driver probe of device that has dynamic MSI-X feature enabled,
the following error is printed in some FW flavour (not released yet).

 mlx5_core 0000:06:00.0: firmware version: 4.7.4387
 mlx5_core 0000:06:00.0: 126.016 Gb/s available PCIe bandwidth (8.0 GT/s PCIe x16 link)
 mlx5_core 0000:06:00.0: mlx5_cmd_check:777:(pid 70599): SET_HCA_CAP(0x109) op_mod(0x0) failed, status bad parameter(0x3), syndrome (0x0)
 mlx5_core 0000:06:00.0: set_hca_cap:622:(pid 70599): handle_hca_cap failed
 mlx5_core 0000:06:00.0: mlx5_function_setup:1045:(pid 70599): set_hca_cap failed
 mlx5_core 0000:06:00.0: probe_one:1465:(pid 70599): mlx5_init_one failed with error code -22
 mlx5_core: probe of 0000:06:00.0 failed with error -22

In order to make the setting capability of MSI-X future proof, let's
query the current capabilities first.

Fixes: 604774add516 ("net/mlx5: Dynamically assign MSI-X vectors count")
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c