diff options
| author | Jason Gunthorpe <[email protected]> | 2020-10-26 13:19:36 +0000 |
|---|---|---|
| committer | Jason Gunthorpe <[email protected]> | 2020-11-02 18:52:26 +0000 |
| commit | f8fb3110635c91a375399450dc5a4a79a83b0414 (patch) | |
| tree | 1b1815753d6c0a4c4a2c2df4a79d93073dc244e6 /drivers/infiniband/hw/mlx5/mr.c | |
| parent | RDMA/mlx5: Remove ncont from mlx5_ib_cont_pages() (diff) | |
| download | kernel-f8fb3110635c91a375399450dc5a4a79a83b0414.tar.gz kernel-f8fb3110635c91a375399450dc5a4a79a83b0414.zip | |
RDMA/mlx5: Remove npages from mlx5_ib_cont_pages()
Most callers don't need this, and the few that do can get it as
ib_umem_num_pages(umem).
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Leon Romanovsky <[email protected]>
Signed-off-by: Jason Gunthorpe <[email protected]>
Diffstat (limited to 'drivers/infiniband/hw/mlx5/mr.c')
| -rw-r--r-- | drivers/infiniband/hw/mlx5/mr.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/infiniband/hw/mlx5/mr.c b/drivers/infiniband/hw/mlx5/mr.c index 305520bb0863..49484a9e64cd 100644 --- a/drivers/infiniband/hw/mlx5/mr.c +++ b/drivers/infiniband/hw/mlx5/mr.c @@ -957,11 +957,9 @@ static struct mlx5_ib_mr *alloc_mr_from_cache(struct ib_pd *pd, struct mlx5_ib_dev *dev = to_mdev(pd->device); struct mlx5_cache_ent *ent; struct mlx5_ib_mr *mr; - int npages; int page_shift; - mlx5_ib_cont_pages(umem, iova, MLX5_MKEY_PAGE_SHIFT_MASK, &npages, - &page_shift); + mlx5_ib_cont_pages(umem, iova, MLX5_MKEY_PAGE_SHIFT_MASK, &page_shift); ent = mr_cache_ent_from_order(dev, order_base_2(ib_umem_num_dma_blocks( umem, 1UL << page_shift))); if (!ent) @@ -1151,7 +1149,6 @@ static struct mlx5_ib_mr *reg_create(struct ib_mr *ibmr, struct ib_pd *pd, struct mlx5_ib_mr *mr; int page_shift; __be64 *pas; - int npages; void *mkc; int inlen; u32 *in; @@ -1162,8 +1159,7 @@ static struct mlx5_ib_mr *reg_create(struct ib_mr *ibmr, struct ib_pd *pd, if (!mr) return ERR_PTR(-ENOMEM); - mlx5_ib_cont_pages(umem, iova, MLX5_MKEY_PAGE_SHIFT_MASK, &npages, - &page_shift); + mlx5_ib_cont_pages(umem, iova, MLX5_MKEY_PAGE_SHIFT_MASK, &page_shift); mr->page_shift = page_shift; mr->ibmr.pd = pd; @@ -1171,7 +1167,7 @@ static struct mlx5_ib_mr *reg_create(struct ib_mr *ibmr, struct ib_pd *pd, inlen = MLX5_ST_SZ_BYTES(create_mkey_in); if (populate) - inlen += sizeof(*pas) * roundup(npages, 2); + inlen += sizeof(*pas) * roundup(ib_umem_num_pages(umem), 2); in = kvzalloc(inlen, GFP_KERNEL); if (!in) { err = -ENOMEM; |
