summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/mlx5/main.c
diff options
context:
space:
mode:
authorYishai Hadas <yishaih@nvidia.com>2024-09-09 20:47:33 +0200
committerLeon Romanovsky <leon@kernel.org>2024-09-13 07:27:40 +0200
commitc77aec65e828bd82726f664585e3bb425d17be7f (patch)
treec11e07ce3638aa76b68f31a953d7d3dafebda15f /drivers/infiniband/hw/mlx5/main.c
parentnet/mlx5: Handle memory scheme ODP capabilities (diff)
downloadlinux-c77aec65e828bd82726f664585e3bb425d17be7f.tar.xz
linux-c77aec65e828bd82726f664585e3bb425d17be7f.zip
RDMA/mlx5: Consider the query_vuid cap for data_direct
Consider also the query_vuid cap before enabling the data_direct functionality. This may prevent a syndrome from the FW in case the query_vuid command is not supported. (e.g. migratable VF) Signed-off-by: Yishai Hadas <yishaih@nvidia.com> Reviewed-by: Gal Shalom <galshalom@nvidia.com> Link: https://patch.msgid.link/274c4f6f1ac0b1078243dd296695a49dbe58e7d1.1725907637.git.leonro@nvidia.com Signed-off-by: Leon Romanovsky <leon@kernel.org>
Diffstat (limited to 'drivers/infiniband/hw/mlx5/main.c')
-rw-r--r--drivers/infiniband/hw/mlx5/main.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c
index b85ad3c0bfa1..af9ccae684ba 100644
--- a/drivers/infiniband/hw/mlx5/main.c
+++ b/drivers/infiniband/hw/mlx5/main.c
@@ -3479,7 +3479,8 @@ static int mlx5_ib_data_direct_init(struct mlx5_ib_dev *dev)
char vuid[MLX5_ST_SZ_BYTES(array1024_auto) + 1] = {};
int ret;
- if (!MLX5_CAP_GEN(dev->mdev, data_direct))
+ if (!MLX5_CAP_GEN(dev->mdev, data_direct) ||
+ !MLX5_CAP_GEN_2(dev->mdev, query_vuid))
return 0;
ret = mlx5_cmd_query_vuid(dev->mdev, true, vuid);
@@ -3500,7 +3501,8 @@ static int mlx5_ib_data_direct_init(struct mlx5_ib_dev *dev)
static void mlx5_ib_data_direct_cleanup(struct mlx5_ib_dev *dev)
{
- if (!MLX5_CAP_GEN(dev->mdev, data_direct))
+ if (!MLX5_CAP_GEN(dev->mdev, data_direct) ||
+ !MLX5_CAP_GEN_2(dev->mdev, query_vuid))
return;
mlx5_data_direct_ib_unreg(dev);