]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
RDMA/mlx5: Disable IB_DEVICE_MEM_MGT_EXTENSIONS if IB_WR_REG_MR can't work
authorJason Gunthorpe <jgg@nvidia.com>
Mon, 14 Sep 2020 11:26:52 +0000 (14:26 +0300)
committerJason Gunthorpe <jgg@nvidia.com>
Fri, 18 Sep 2020 16:02:43 +0000 (13:02 -0300)
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: 841b07f99a47 ("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>
drivers/infiniband/hw/mlx5/main.c

index 8963b806ad1965c02382ca183d072b76813fba0e..cd8e636690b31991e544682983ce86ad87e59ad7 100644 (file)
@@ -840,7 +840,9 @@ static int mlx5_ib_query_device(struct ib_device *ibdev,
                /* We support 'Gappy' memory registration too */
                props->device_cap_flags |= IB_DEVICE_SG_GAPS_REG;
        }
-       props->device_cap_flags |= IB_DEVICE_MEM_MGT_EXTENSIONS;
+       /* IB_WR_REG_MR always requires changing the entity size with UMR */
+       if (!MLX5_CAP_GEN(dev->mdev, umr_modify_entity_size_disabled))
+               props->device_cap_flags |= IB_DEVICE_MEM_MGT_EXTENSIONS;
        if (MLX5_CAP_GEN(mdev, sho)) {
                props->device_cap_flags |= IB_DEVICE_INTEGRITY_HANDOVER;
                /* At this stage no support for signature handover */