Skip to content

Commit f1a090f

Browse files
aharonl-nvidiajgunthorpe
authored andcommitted
RDMA/core: Require the driver to set the IOVA correctly during rereg_mr
If the driver returns a new MR during rereg it has to fill it with the IOVA from the proper source. If IB_MR_REREG_TRANS is set then the IOVA is cmd.hca_va, otherwise the IOVA comes from the old MR. mlx5 for example has two calls inside rereg_mr: return create_real_mr(new_pd, umem, mr->ibmr.iova, new_access_flags); and return create_real_mr(new_pd, new_umem, iova, new_access_flags); Unconditionally overwriting the iova in the newly allocated MR will corrupt the iova if the first path is used. Remove the redundant initializations from ib_uverbs_rereg_mr(). Fixes: 6e0954b ("RDMA/uverbs: Allow drivers to create a new HW object during rereg_mr") Link: https://lore.kernel.org/r/4b0a31bbc372842613286a10d7a8cbb0ee6069c7.1635400472.git.leonro@nvidia.com Signed-off-by: Aharon Landau <[email protected]> Signed-off-by: Leon Romanovsky <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent dd83f48 commit f1a090f

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

drivers/infiniband/core/uverbs_cmd.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -837,11 +837,8 @@ static int ib_uverbs_rereg_mr(struct uverbs_attr_bundle *attrs)
837837
new_mr->device = new_pd->device;
838838
new_mr->pd = new_pd;
839839
new_mr->type = IB_MR_TYPE_USER;
840-
new_mr->dm = NULL;
841-
new_mr->sig_attrs = NULL;
842840
new_mr->uobject = uobj;
843841
atomic_inc(&new_pd->usecnt);
844-
new_mr->iova = cmd.hca_va;
845842
new_uobj->object = new_mr;
846843

847844
rdma_restrack_new(&new_mr->res, RDMA_RESTRACK_MR);

0 commit comments

Comments
 (0)