Skip to content

Commit 0ec52f0

Browse files
committed
RDMA/mlx5: Disable IB_DEVICE_MEM_MGT_EXTENSIONS if IB_WR_REG_MR can't work
set_reg_wr() always fails if !umr_modify_entity_size_disabled because mlx5_ib_can_use_umr() always fails. Without set_reg_wr() IB_WR_REG_MR doesn't work and that means the device should not advertise IB_DEVICE_MEM_MGT_EXTENSIONS. Fixes: 841b07f ("IB/mlx5: Block MR WR if UMR is not possible") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Leon Romanovsky <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent 5eb29f0 commit 0ec52f0

File tree

1 file changed

+3
-1
lines changed
  • drivers/infiniband/hw/mlx5

1 file changed

+3
-1
lines changed

drivers/infiniband/hw/mlx5/main.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -840,7 +840,9 @@ static int mlx5_ib_query_device(struct ib_device *ibdev,
840840
/* We support 'Gappy' memory registration too */
841841
props->device_cap_flags |= IB_DEVICE_SG_GAPS_REG;
842842
}
843-
props->device_cap_flags |= IB_DEVICE_MEM_MGT_EXTENSIONS;
843+
/* IB_WR_REG_MR always requires changing the entity size with UMR */
844+
if (!MLX5_CAP_GEN(dev->mdev, umr_modify_entity_size_disabled))
845+
props->device_cap_flags |= IB_DEVICE_MEM_MGT_EXTENSIONS;
844846
if (MLX5_CAP_GEN(mdev, sho)) {
845847
props->device_cap_flags |= IB_DEVICE_INTEGRITY_HANDOVER;
846848
/* At this stage no support for signature handover */

0 commit comments

Comments
 (0)