Skip to content

Use only a umem and HW page_shift to calculate MR sizes

Leon Romanovsky linux-rdma 1 version Applied

Status from this message: Applied to for-next, thanks

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest7 patches 1 replyApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/7RDMA/mlx5: Remove mlx5_ib_mr->orderdrivers/infiniband/hw/mlx5/mlx5_ib.h drivers/infiniband/hw/mlx5/mr.c+3 -30 replies
2/7RDMA/mlx5: Fix corruption of reg_pages in mlx5_ib_rereg_user_mr()drivers/infiniband/hw/mlx5/mr.c+11 -90 replies
3/7RDMA/mlx5: Remove mlx5_ib_mr->npagesdrivers/infiniband/hw/mlx5/mlx5_ib.h drivers/infiniband/hw/mlx5/mr.c+14 -130 replies
4/7RDMA/mlx5: Move mlx5_ib_cont_pages() to the creation of the mlx5_ib_mrdrivers/infiniband/hw/mlx5/mem.c drivers/infiniband/hw/mlx5/mlx5_ib.h drivers/infiniband/hw/mlx5/mr.c+69 -780 replies
5/7RDMA/mlx5: Remove order from mlx5_ib_cont_pages()drivers/infiniband/hw/mlx5/cq.c drivers/infiniband/hw/mlx5/devx.c drivers/infiniband/hw/mlx5/mem.c +4 more+12 -240 replies
6/7RDMA/mlx5: Remove ncont from mlx5_ib_cont_pages()drivers/infiniband/hw/mlx5/cq.c drivers/infiniband/hw/mlx5/devx.c drivers/infiniband/hw/mlx5/mem.c +4 more+46 -520 replies
7/7RDMA/mlx5: Remove npages from mlx5_ib_cont_pages()drivers/infiniband/hw/mlx5/cq.c drivers/infiniband/hw/mlx5/devx.c drivers/infiniband/hw/mlx5/mem.c +4 more+27 -450 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH rdma-next 0/7] Use only a umem and HW page_shift to calculate MR sizes

From: Leon Romanovsky <[email protected]>

From Jason:

The MR code computes and passes around a tuple of (npages, page_shift, ncont, order) to represent the size of the MR in various terms.

This is quite confusing about what term refers to what, and overlaps with data already stored and computed inside the umem. Rework all of this to be more umem centric and use these identities instead:

      npages == ib_umem_num_pages(mr->umem)
      page_shift == mr->page_shift
      ncont == ib_umem_num_dma_blocks(mr->umem, 1 << mr->page_shift)
      order == order_base_2(ncont)

By storing the page_shift inside the mlx5_ib_mr it becomes nearly self describing.

Thanks

Jason Gunthorpe (7):
RDMA/mlx5: Remove mlx5_ib_mr->order
RDMA/mlx5: Fix corruption of reg_pages in mlx5_ib_rereg_user_mr() RDMA/mlx5: Remove mlx5_ib_mr->npages
RDMA/mlx5: Move mlx5_ib_cont_pages() to the creation of the mlx5_ib_mr RDMA/mlx5: Remove order from mlx5_ib_cont_pages() RDMA/mlx5: Remove ncont from mlx5_ib_cont_pages() RDMA/mlx5: Remove npages from mlx5_ib_cont_pages()

 drivers/infiniband/hw/mlx5/cq.c      |  39 ++++---
 drivers/infiniband/hw/mlx5/devx.c    |  20 ++--
 drivers/infiniband/hw/mlx5/mem.c     |  30 ++---
 drivers/infiniband/hw/mlx5/mlx5_ib.h |   6 +-
 drivers/infiniband/hw/mlx5/mr.c      | 168 ++++++++++++---------------
 drivers/infiniband/hw/mlx5/qp.c      |  39 +++----
 drivers/infiniband/hw/mlx5/srq.c     |   8 +-
 7 files changed, 134 insertions(+), 176 deletions(-)

--
2.26.2