]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
RDMA/mlx5: Implement DMABUF export ops
authorYishai Hadas <yishaih@nvidia.com>
Sun, 1 Feb 2026 14:34:06 +0000 (16:34 +0200)
committerLeon Romanovsky <leon@kernel.org>
Mon, 9 Feb 2026 04:50:41 +0000 (23:50 -0500)
commitd6c58f4eb3d00a695f5a610ea780cad322ec714e
tree46fae564630e8c006f49371dc84b3cd10bfcd1ca
parent0ac6f4056c4a257f4b230b910e3e6fee6c6fc9b9
RDMA/mlx5: Implement DMABUF export ops

Enable p2pdma on the mlx5 PCI device to allow DMABUF-based peer-to-peer
DMA mappings.

Add implementation of the mmap_get_pfns and pgoff_to_mmap_entry device
operations required for DMABUF support in the mlx5 RDMA driver.

The pgoff_to_mmap_entry operation converts a page offset to the
corresponding rdma_user_mmap_entry by extracting the command and index
from the offset and looking it up in the ucontext's mmap_xa.

The mmap_get_pfns operation retrieves the physical address and length
from the mmap entry and obtains the p2pdma provider for the underlying
PCI device, which is needed for peer-to-peer DMA operations with
DMABUFs.

Signed-off-by: Yishai Hadas <yishaih@nvidia.com>
Signed-off-by: Edward Srouji <edwards@nvidia.com>
Link: https://patch.msgid.link/20260201-dmabuf-export-v3-3-da238b614fe3@nvidia.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
drivers/infiniband/hw/mlx5/main.c