mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 21:38:32 +08:00
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: Jason Gunthorpe <jgunthorpe@obsidianresearch.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
This commit is contained in:
parent
7dd9757628
commit
b37c788f59
@ -1123,7 +1123,6 @@ static void destroy_umrc_res(struct mlx5_ib_dev *dev)
|
||||
|
||||
mlx5_ib_destroy_qp(dev->umrc.qp);
|
||||
ib_destroy_cq(dev->umrc.cq);
|
||||
ib_dereg_mr(dev->umrc.mr);
|
||||
ib_dealloc_pd(dev->umrc.pd);
|
||||
}
|
||||
|
||||
@ -1138,7 +1137,6 @@ static int create_umr_res(struct mlx5_ib_dev *dev)
|
||||
struct ib_pd *pd;
|
||||
struct ib_cq *cq;
|
||||
struct ib_qp *qp;
|
||||
struct ib_mr *mr;
|
||||
struct ib_cq_init_attr cq_attr = {};
|
||||
int ret;
|
||||
|
||||
@ -1156,13 +1154,6 @@ static int create_umr_res(struct mlx5_ib_dev *dev)
|
||||
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 = ib_create_cq(&dev->ib_dev, mlx5_umr_cq_handler, NULL, NULL,
|
||||
&cq_attr);
|
||||
@ -1220,7 +1211,6 @@ static int create_umr_res(struct mlx5_ib_dev *dev)
|
||||
|
||||
dev->umrc.qp = qp;
|
||||
dev->umrc.cq = cq;
|
||||
dev->umrc.mr = mr;
|
||||
dev->umrc.pd = pd;
|
||||
|
||||
sema_init(&dev->umrc.sem, MAX_UMR_WR);
|
||||
@ -1242,9 +1232,6 @@ error_3:
|
||||
ib_destroy_cq(cq);
|
||||
|
||||
error_2:
|
||||
ib_dereg_mr(mr);
|
||||
|
||||
error_1:
|
||||
ib_dealloc_pd(pd);
|
||||
|
||||
error_0:
|
||||
|
@ -349,7 +349,6 @@ struct umr_common {
|
||||
struct ib_pd *pd;
|
||||
struct ib_cq *cq;
|
||||
struct ib_qp *qp;
|
||||
struct ib_mr *mr;
|
||||
/* control access to UMR QP
|
||||
*/
|
||||
struct semaphore sem;
|
||||
|
@ -687,12 +687,11 @@ static void prep_umr_reg_wqe(struct ib_pd *pd, struct ib_send_wr *wr,
|
||||
int access_flags)
|
||||
{
|
||||
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;
|
||||
|
||||
sg->addr = dma;
|
||||
sg->length = ALIGN(sizeof(u64) * n, 64);
|
||||
sg->lkey = mr->lkey;
|
||||
sg->lkey = dev->umrc.pd->local_dma_lkey;
|
||||
|
||||
wr->next = NULL;
|
||||
wr->send_flags = 0;
|
||||
@ -923,7 +922,7 @@ int mlx5_ib_update_mtt(struct mlx5_ib_mr *mr, u64 start_page_index, int npages,
|
||||
sg.addr = dma;
|
||||
sg.length = ALIGN(npages * sizeof(u64),
|
||||
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 |
|
||||
MLX5_IB_SEND_UMR_UPDATE_MTT;
|
||||
|
Loading…
Reference in New Issue
Block a user