Commit b37c788f authored by Jason Gunthorpe's avatar Jason Gunthorpe Committed by Doug Ledford

IB/mlx5: Remove ib_get_dma_mr calls

The pd now has a local_dma_lkey member which completely replaces
ib_get_dma_mr, use it instead.
Signed-off-by: default avatarJason Gunthorpe <jgunthorpe@obsidianresearch.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent 7dd97576
...@@ -1123,7 +1123,6 @@ static void destroy_umrc_res(struct mlx5_ib_dev *dev) ...@@ -1123,7 +1123,6 @@ static void destroy_umrc_res(struct mlx5_ib_dev *dev)
mlx5_ib_destroy_qp(dev->umrc.qp); mlx5_ib_destroy_qp(dev->umrc.qp);
ib_destroy_cq(dev->umrc.cq); ib_destroy_cq(dev->umrc.cq);
ib_dereg_mr(dev->umrc.mr);
ib_dealloc_pd(dev->umrc.pd); ib_dealloc_pd(dev->umrc.pd);
} }
...@@ -1138,7 +1137,6 @@ static int create_umr_res(struct mlx5_ib_dev *dev) ...@@ -1138,7 +1137,6 @@ static int create_umr_res(struct mlx5_ib_dev *dev)
struct ib_pd *pd; struct ib_pd *pd;
struct ib_cq *cq; struct ib_cq *cq;
struct ib_qp *qp; struct ib_qp *qp;
struct ib_mr *mr;
struct ib_cq_init_attr cq_attr = {}; struct ib_cq_init_attr cq_attr = {};
int ret; int ret;
...@@ -1156,13 +1154,6 @@ static int create_umr_res(struct mlx5_ib_dev *dev) ...@@ -1156,13 +1154,6 @@ static int create_umr_res(struct mlx5_ib_dev *dev)
goto error_0; goto error_0;
} }
mr = ib_get_dma_mr(pd, IB_ACCESS_LOCAL_WRITE);
if (IS_ERR(mr)) {
mlx5_ib_dbg(dev, "Couldn't create DMA MR for sync UMR QP\n");
ret = PTR_ERR(mr);
goto error_1;
}
cq_attr.cqe = 128; cq_attr.cqe = 128;
cq = ib_create_cq(&dev->ib_dev, mlx5_umr_cq_handler, NULL, NULL, cq = ib_create_cq(&dev->ib_dev, mlx5_umr_cq_handler, NULL, NULL,
&cq_attr); &cq_attr);
...@@ -1220,7 +1211,6 @@ static int create_umr_res(struct mlx5_ib_dev *dev) ...@@ -1220,7 +1211,6 @@ static int create_umr_res(struct mlx5_ib_dev *dev)
dev->umrc.qp = qp; dev->umrc.qp = qp;
dev->umrc.cq = cq; dev->umrc.cq = cq;
dev->umrc.mr = mr;
dev->umrc.pd = pd; dev->umrc.pd = pd;
sema_init(&dev->umrc.sem, MAX_UMR_WR); sema_init(&dev->umrc.sem, MAX_UMR_WR);
...@@ -1242,9 +1232,6 @@ static int create_umr_res(struct mlx5_ib_dev *dev) ...@@ -1242,9 +1232,6 @@ static int create_umr_res(struct mlx5_ib_dev *dev)
ib_destroy_cq(cq); ib_destroy_cq(cq);
error_2: error_2:
ib_dereg_mr(mr);
error_1:
ib_dealloc_pd(pd); ib_dealloc_pd(pd);
error_0: error_0:
......
...@@ -349,7 +349,6 @@ struct umr_common { ...@@ -349,7 +349,6 @@ struct umr_common {
struct ib_pd *pd; struct ib_pd *pd;
struct ib_cq *cq; struct ib_cq *cq;
struct ib_qp *qp; struct ib_qp *qp;
struct ib_mr *mr;
/* control access to UMR QP /* control access to UMR QP
*/ */
struct semaphore sem; struct semaphore sem;
......
...@@ -687,12 +687,11 @@ static void prep_umr_reg_wqe(struct ib_pd *pd, struct ib_send_wr *wr, ...@@ -687,12 +687,11 @@ static void prep_umr_reg_wqe(struct ib_pd *pd, struct ib_send_wr *wr,
int access_flags) int access_flags)
{ {
struct mlx5_ib_dev *dev = to_mdev(pd->device); struct mlx5_ib_dev *dev = to_mdev(pd->device);
struct ib_mr *mr = dev->umrc.mr;
struct mlx5_umr_wr *umrwr = (struct mlx5_umr_wr *)&wr->wr.fast_reg; struct mlx5_umr_wr *umrwr = (struct mlx5_umr_wr *)&wr->wr.fast_reg;
sg->addr = dma; sg->addr = dma;
sg->length = ALIGN(sizeof(u64) * n, 64); sg->length = ALIGN(sizeof(u64) * n, 64);
sg->lkey = mr->lkey; sg->lkey = dev->umrc.pd->local_dma_lkey;
wr->next = NULL; wr->next = NULL;
wr->send_flags = 0; wr->send_flags = 0;
...@@ -923,7 +922,7 @@ int mlx5_ib_update_mtt(struct mlx5_ib_mr *mr, u64 start_page_index, int npages, ...@@ -923,7 +922,7 @@ int mlx5_ib_update_mtt(struct mlx5_ib_mr *mr, u64 start_page_index, int npages,
sg.addr = dma; sg.addr = dma;
sg.length = ALIGN(npages * sizeof(u64), sg.length = ALIGN(npages * sizeof(u64),
MLX5_UMR_MTT_ALIGNMENT); MLX5_UMR_MTT_ALIGNMENT);
sg.lkey = dev->umrc.mr->lkey; sg.lkey = dev->umrc.pd->local_dma_lkey;
wr.send_flags = MLX5_IB_SEND_UMR_FAIL_IF_FREE | wr.send_flags = MLX5_IB_SEND_UMR_FAIL_IF_FREE |
MLX5_IB_SEND_UMR_UPDATE_MTT; MLX5_IB_SEND_UMR_UPDATE_MTT;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment