RDMA/umem: Support importing dma-buf as user memory region
authorJianxin Xiong <jianxin.xiong@intel.com>
Tue, 15 Dec 2020 21:27:13 +0000 (13:27 -0800)
committerJason Gunthorpe <jgg@nvidia.com>
Wed, 20 Jan 2021 20:07:52 +0000 (16:07 -0400)
commit368c0159d492d7fbdb5791b40c9263ec4e97a10f
treecd16d9c4358935b05f317e4e2ed096d3e61e74f9
parentabfa456555f4c2bde191cf12064168a05a2865a1
RDMA/umem: Support importing dma-buf as user memory region

Dma-buf is a standard cross-driver buffer sharing mechanism that can be
used to support peer-to-peer access from RDMA devices.

Device memory exported via dma-buf is associated with a file descriptor.
This is passed to the user space as a property associated with the buffer
allocation. When the buffer is registered as a memory region, the file
descriptor is passed to the RDMA driver along with other parameters.

Implement the common code for importing dma-buf object and mapping dma-buf
pages.

Link: https://lore.kernel.org/r/1608067636-98073-2-git-send-email-jianxin.xiong@intel.com
Signed-off-by: Jianxin Xiong <jianxin.xiong@intel.com>
Reviewed-by: Sean Hefty <sean.hefty@intel.com>
Acked-by: Michael J. Ruhl <michael.j.ruhl@intel.com>
Acked-by: Christian Koenig <christian.koenig@amd.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/Kconfig
drivers/infiniband/core/Makefile
drivers/infiniband/core/umem.c
drivers/infiniband/core/umem_dmabuf.c [new file with mode: 0644]
include/rdma/ib_umem.h