Skip to content

Commit 1b881ba

Browse files
jgunthorpegregkh
authored andcommitted
RDMA/mlx5: Disable IB_DEVICE_MEM_MGT_EXTENSIONS if IB_WR_REG_MR can't work
[ Upstream commit 0ec52f0 ] 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/20200914112653.345244-5-leon@kernel.org Signed-off-by: Leon Romanovsky <leonro@nvidia.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 0057c07 commit 1b881ba

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

  • drivers/infiniband/hw/mlx5

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)