RDMA/irdma: Add support for dmabuf pin memory regions
authorZhu Yanjun <yanjun.zhu@linux.dev>
Fri, 17 Feb 2023 01:14:25 +0000 (09:14 +0800)
committerJason Gunthorpe <jgg@nvidia.com>
Fri, 17 Feb 2023 20:36:14 +0000 (16:36 -0400)
commitd2225b838ccad126045e048471441693c7bca217
treeefc994898c7c214eb8a48e05d89ca9dced51604b
parent5ef17179da7b779b3029d9a7d3871ba09279d56c
RDMA/irdma: Add support for dmabuf pin memory regions

This is a followup to the EFA dmabuf[1]. Irdma driver currently does
not support on-demand-paging(ODP). So it uses habanalabs as the
dmabuf exporter, and irdma as the importer to allow for peer2peer
access through libibverbs.

In this commit, the function ib_umem_dmabuf_get_pinned() is used.
This function is introduced in EFA dmabuf[1] which allows the driver
to get a dmabuf umem which is pinned and does not require move_notify
callback implementation. The returned umem is pinned and DMA mapped
like standard cpu umems, and is released through ib_umem_release().

[1]https://lore.kernel.org/lkml/20211007114018.GD2688930@ziepe.ca/t/

Link: https://lore.kernel.org/r/20230217011425.498847-1-yanjun.zhu@intel.com
Reviewed-by: Shiraz Saleem <shiraz.saleem@intel.com>
Signed-off-by: Zhu Yanjun <yanjun.zhu@linux.dev>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/hw/irdma/verbs.c