Skip to content

Commit 911e5ca

Browse files
committed
RDMA/mlx4: Restrict external umem for CQ when copy_to_user() is used
When the mlx4 firmware reports the MLX4_DEV_CAP_FLAG2_SW_CQ_INIT capability, libmlx4 from the rdma-core package expects the driver to initialize memory at the address provided in the buf_addr parameter of ucmd. This behavior cannot be supported by any external umem implementation, so restrict it accordingly. Fixes: f45f195 ("RDMA/mlx4: Introduce a modern CQ creation interface") Reported-by: Jiri Pirko <jiri@nvidia.com> Link: https://patch.msgid.link/20260325-fix-mlx4-external-umem-v1-1-1c7c0e779329@nvidia.com Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
1 parent 179b320 commit 911e5ca

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

  • drivers/infiniband/hw/mlx4

drivers/infiniband/hw/mlx4/cq.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,10 @@ int mlx4_ib_create_user_cq(struct ib_cq *ibcq,
173173
goto err_cq;
174174
}
175175

176+
if (ibcq->umem &&
177+
(dev->dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_SW_CQ_INIT))
178+
return -EOPNOTSUPP;
179+
176180
buf_addr = (void *)(unsigned long)ucmd.buf_addr;
177181

178182
if (!ibcq->umem)

0 commit comments

Comments
 (0)