All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/14] RDMA: Improve use of umem in DMA drivers
@ 2020-09-02  0:43 Jason Gunthorpe
  2020-09-02  0:43 ` [PATCH 01/14] RDMA/umem: Fix ib_umem_find_best_pgsz() for mappings that cross a page boundary Jason Gunthorpe
                   ` (14 more replies)
  0 siblings, 15 replies; 42+ messages in thread
From: Jason Gunthorpe @ 2020-09-02  0:43 UTC (permalink / raw)
  To: Adit Ranadive, Ariel Elior, Potnuri Bharat Teja,
	Dennis Dalessandro, Devesh Sharma, Doug Ledford, Faisal Latif,
	Gal Pressman, Wei Hu(Xavier),
	Leon Romanovsky, linux-rdma, Weihang Li, Miguel Ojeda,
	Mike Marciniszyn, Michal Kalderon, Naresh Kumar PBS, Lijun Ou,
	VMware PV-Drivers, Selvin Xavier, Shiraz Saleem, Yossi Leybovich,
	Somnath Kotur, Sriharsha Basavapatna, Zhu Yanjun, Yishai Hadas

Most RDMA drivers rely on a linear table of DMA addresses organized in
some device specific page size.

For a while now the core code has had the rdma_for_each_block() SG
iterator to help break a umem into DMA blocks for use in the device lists.

Improve on this by adding rdma_umem_for_each_dma_block(),
ib_umem_dma_offset() and ib_umem_num_dma_blocks().

Replace open codings, or calls to fixed PAGE_SIZE APIs, in most of the
drivers with one of the above APIs.

Get rid of the really weird and duplicative ib_umem_page_count().

Fix two problems with ib_umem_find_best_pgsz().

At this point many of the driver have a clear path to call
ib_umem_find_best_pgsz() and replace hardcoded PAGE_SIZE or PAGE_SHIFT
values when constructing their DMA lists.

This is the first series in an effort to modernize the umem usage in all
the DMA drivers.

Jason Gunthorpe (14):
  RDMA/umem: Fix ib_umem_find_best_pgsz() for mappings that cross a page
    boundary
  RDMA/umem: Prevent small pages from being returned by
    ib_umem_find_best_pgsz()
  RDMA/umem: Use simpler logic for ib_umem_find_best_pgsz()
  RDMA/umem: Add rdma_umem_for_each_dma_block()
  RDMA/umem: Replace for_each_sg_dma_page with
    rdma_umem_for_each_dma_block
  RDMA/umem: Split ib_umem_num_pages() into ib_umem_num_dma_blocks()
  RDMA/qedr: Use rdma_umem_for_each_dma_block() instead of open-coding
  RDMA/qedr: Use ib_umem_num_dma_blocks() instead of
    ib_umem_page_count()
  RDMA/bnxt: Do not use ib_umem_page_count() or ib_umem_num_pages()
  RDMA/hns: Use ib_umem_num_dma_blocks() instead of opencoding
  RDMA/ocrdma: Use ib_umem_num_dma_blocks() instead of
    ib_umem_page_count()
  RDMA/pvrdma: Use ib_umem_num_dma_blocks() instead of
    ib_umem_page_count()
  RDMA/mlx5: Use ib_umem_num_dma_blocks()
  RDMA/umem: Rename ib_umem_offset() to ib_umem_dma_offset()

 .clang-format                                 |  1 +
 drivers/infiniband/core/umem.c                | 41 ++++++-----
 drivers/infiniband/hw/bnxt_re/ib_verbs.c      | 72 +++++++------------
 drivers/infiniband/hw/cxgb4/mem.c             |  8 +--
 drivers/infiniband/hw/efa/efa_verbs.c         |  3 +-
 drivers/infiniband/hw/hns/hns_roce_alloc.c    |  3 +-
 drivers/infiniband/hw/hns/hns_roce_mr.c       | 49 +++++--------
 drivers/infiniband/hw/i40iw/i40iw_verbs.c     |  3 +-
 drivers/infiniband/hw/mlx4/cq.c               |  8 +--
 drivers/infiniband/hw/mlx4/mlx4_ib.h          |  3 +-
 drivers/infiniband/hw/mlx4/mr.c               | 14 ++--
 drivers/infiniband/hw/mlx4/qp.c               | 17 ++---
 drivers/infiniband/hw/mlx4/srq.c              |  5 +-
 drivers/infiniband/hw/mlx5/mem.c              |  5 +-
 drivers/infiniband/hw/mthca/mthca_provider.c  |  8 +--
 drivers/infiniband/hw/ocrdma/ocrdma_verbs.c   | 26 +++----
 drivers/infiniband/hw/qedr/verbs.c            | 50 ++++++-------
 drivers/infiniband/hw/vmw_pvrdma/pvrdma_cq.c  |  2 +-
 .../infiniband/hw/vmw_pvrdma/pvrdma_misc.c    |  9 ++-
 drivers/infiniband/hw/vmw_pvrdma/pvrdma_mr.c  |  2 +-
 drivers/infiniband/hw/vmw_pvrdma/pvrdma_qp.c  |  6 +-
 drivers/infiniband/hw/vmw_pvrdma/pvrdma_srq.c |  2 +-
 drivers/infiniband/sw/rdmavt/mr.c             |  2 +-
 drivers/infiniband/sw/rxe/rxe_mr.c            |  2 +-
 include/rdma/ib_umem.h                        | 45 +++++++++---
 include/rdma/ib_verbs.h                       | 24 -------
 26 files changed, 184 insertions(+), 226 deletions(-)

-- 
2.28.0


^ permalink raw reply	[flat|nested] 42+ messages in thread

end of thread, other threads:[~2020-09-04 22:33 UTC | newest]

Thread overview: 42+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-02  0:43 [PATCH 00/14] RDMA: Improve use of umem in DMA drivers Jason Gunthorpe
2020-09-02  0:43 ` [PATCH 01/14] RDMA/umem: Fix ib_umem_find_best_pgsz() for mappings that cross a page boundary Jason Gunthorpe
2020-09-02  9:24   ` Leon Romanovsky
2020-09-03 14:11   ` Saleem, Shiraz
2020-09-04 22:30   ` Jason Gunthorpe
2020-09-02  0:43 ` [PATCH 02/14] RDMA/umem: Prevent small pages from being returned by ib_umem_find_best_pgsz() Jason Gunthorpe
2020-09-02 11:51   ` Leon Romanovsky
2020-09-02 11:59     ` Jason Gunthorpe
2020-09-02 12:05       ` Leon Romanovsky
2020-09-02 16:34         ` Jason Gunthorpe
2020-09-03 14:11   ` Saleem, Shiraz
2020-09-03 14:17     ` Jason Gunthorpe
2020-09-03 14:18       ` Saleem, Shiraz
2020-09-02  0:43 ` [PATCH 03/14] RDMA/umem: Use simpler logic for ib_umem_find_best_pgsz() Jason Gunthorpe
2020-09-02  0:43 ` [PATCH 04/14] RDMA/umem: Add rdma_umem_for_each_dma_block() Jason Gunthorpe
2020-09-02  3:10   ` Miguel Ojeda
2020-09-03 14:12   ` Saleem, Shiraz
2020-09-02  0:43 ` [PATCH 05/14] RDMA/umem: Replace for_each_sg_dma_page with rdma_umem_for_each_dma_block Jason Gunthorpe
2020-09-02  0:43 ` [PATCH 06/14] RDMA/umem: Split ib_umem_num_pages() into ib_umem_num_dma_blocks() Jason Gunthorpe
2020-09-03 14:12   ` Saleem, Shiraz
2020-09-03 14:14     ` Jason Gunthorpe
2020-09-04 22:32   ` Jason Gunthorpe
2020-09-02  0:43 ` [PATCH 07/14] RDMA/qedr: Use rdma_umem_for_each_dma_block() instead of open-coding Jason Gunthorpe
2020-09-02 15:36   ` [EXT] " Michal Kalderon
2020-09-02 18:44     ` Jason Gunthorpe
2020-09-02 19:53       ` Michal Kalderon
2020-09-02  0:43 ` [PATCH 08/14] RDMA/qedr: Use ib_umem_num_dma_blocks() instead of ib_umem_page_count() Jason Gunthorpe
2020-09-02 15:35   ` [EXT] " Michal Kalderon
2020-09-02  0:43 ` [PATCH 09/14] RDMA/bnxt: Do not use ib_umem_page_count() or ib_umem_num_pages() Jason Gunthorpe
2020-09-03  4:41   ` Selvin Xavier
2020-09-02  0:43 ` [PATCH 10/14] RDMA/hns: Use ib_umem_num_dma_blocks() instead of opencoding Jason Gunthorpe
2020-09-02  0:43 ` [PATCH 11/14] RDMA/ocrdma: Use ib_umem_num_dma_blocks() instead of ib_umem_page_count() Jason Gunthorpe
2020-09-02  0:43 ` [PATCH 12/14] RDMA/pvrdma: " Jason Gunthorpe
2020-09-02  0:43 ` [PATCH 13/14] RDMA/mlx5: Use ib_umem_num_dma_blocks() Jason Gunthorpe
2020-09-02  9:07   ` Gal Pressman
2020-09-03 15:14   ` Saleem, Shiraz
2020-09-02  0:43 ` [PATCH 14/14] RDMA/umem: Rename ib_umem_offset() to ib_umem_dma_offset() Jason Gunthorpe
2020-09-02  0:51   ` Zhu Yanjun
2020-09-02 15:36   ` [EXT] " Michal Kalderon
2020-09-03 18:48   ` Jason Gunthorpe
2020-09-02  9:09 ` [PATCH 00/14] RDMA: Improve use of umem in DMA drivers Gal Pressman
2020-09-02 12:00   ` Jason Gunthorpe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.