Skip to content

ehca: remove use of do_mmap() from kernel space

Hoang-Nam Nguyen linuxppc-dev lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 13 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5ehca: declaration of queue structuresdrivers/infiniband/hw/ehca/ehca_classes.h drivers/infiniband/hw/ehca/ehca_iverbs.h+8 -313 replies
2/5ehca: ehca_uverbs.c: "proper" use of mmapdrivers/infiniband/hw/ehca/ehca_uverbs.c+80 -1733 replies
3/5ehca: completion queue: remove use of do_mmap()drivers/infiniband/hw/ehca/ehca_cq.c+16 -496 replies
4/5ehca: queue pair: remove use of do_mmap()drivers/infiniband/hw/ehca/ehca_qp.c+14 -641 reply
5/5ehca: ehca_main.c: version numberingdrivers/infiniband/hw/ehca/ehca_main.c+3 -30 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [PATCH/RFC 2.6.21 0/5] ehca: remove use of do_mmap() from kernel space

Hello Roland and Christoph H.!
Here is a set of patches for ehca, whose main purpose is to remove unproper use of do_mmap() in ehca kernel space as suggested by Christoph H. Other "small" changes are:
* Remove "dead" prototype declarations (those without code implementation)

Now detail on mmap() rework:
- For eHCA hardware register block we use remap_pfn_range() as previously.
- For queue pages we call pattern vm_insert_page() to register each allocated kernel page.
- For each mmap-ed resource (hardware register block, send/recv and completion queue) we introduce a use counter that is incremented and decremented by the call-backs open()/close(). Destroying a completion queue or queue pair will succeed only if all associated counters are zero. That means those resources must be mmap-ed and munmap-ed properly in user space.
The actual calls of mmap64() and munmap() are done then in ehca user space lib, ie. libehca, for which I will send a separate patch for another review (by ofed group).

Thanks
Nam

 ehca_classes.h |   29 +-----
 ehca_cq.c      |   65 +++-----------
 ehca_iverbs.h  |   10 --
 ehca_main.c    |    6 -
 ehca_qp.c      |   78 +++--------------
 ehca_uverbs.c  |  253 ++++++++++++++++++---------------------------------------
 6 files changed, 121 insertions(+), 320 deletions(-)