net/mlx5: FPGA, Abort FPGA init if the device reports no QP capability
In the case that the reported max number of QPs capability equals to zero, abort FPGA init. Signed-off-by: Yevgeny Kliteynik <kliteyn@mellanox.com> Signed-off-by: Adi Nissim <adin@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
This commit is contained in:
parent
98c90f6f10
commit
90275d809a
|
@ -170,6 +170,12 @@ int mlx5_fpga_device_start(struct mlx5_core_dev *mdev)
|
|||
MLX5_CAP_FPGA(fdev->mdev, sandbox_product_version));
|
||||
|
||||
max_num_qps = MLX5_CAP_FPGA(mdev, shell_caps.max_num_qps);
|
||||
if (!max_num_qps) {
|
||||
mlx5_fpga_err(fdev, "FPGA reports 0 QPs in SHELL_CAPS\n");
|
||||
err = -ENOTSUPP;
|
||||
goto out;
|
||||
}
|
||||
|
||||
err = mlx5_core_reserve_gids(mdev, max_num_qps);
|
||||
if (err)
|
||||
goto out;
|
||||
|
|
Loading…
Reference in New Issue