verbs: Add support for exporting dma-buf file descriptors#1678
Open
yishaih wants to merge 5 commits intolinux-rdma:masterfrom
Open
verbs: Add support for exporting dma-buf file descriptors#1678yishaih wants to merge 5 commits intolinux-rdma:masterfrom
yishaih wants to merge 5 commits intolinux-rdma:masterfrom
Conversation
To commit: b665ed7ad7cc ("RDMA/mlx5: Implement DMABUF export ops").
Signed-off-by: Yishai Hadas <yishaih@nvidia.com>
This API exports a dmabuf fd that is associated with a given ibv_dm. Upon success the returned fd can be used for DMA and RDMA operations associated with it. Once the usage has been ended, close() should be called while supplying the fd. This call will release the resources that were earlier allocated using the ibv_dm_export_dmabuf_fd() API. A detailed man page was added as well. Signed-off-by: Yishai Hadas <yishaih@nvidia.com>
Expose ibv_cmd_export_dmabuf_fd() to be used by drivers to call the kernel for executing the command. Signed-off-by: Yishai Hadas <yishaih@nvidia.com>
Add support for DM export DMABUF fd. Upon the allocation flow of the DM the driver may save the pg_off on its internal mlx5_dm structure. This data will be used upon exporting a DMABUF fd for the DM by calling ibv_cmd_export_dmabuf_fd(). Signed-off-by: Yishai Hadas <yishaih@nvidia.com>
This API exports a dmabuf fd that is associated with a given mlx5dv_devx_uar. Upon success the returned fd can be used for DMA and RDMA operations associated with it. Once the usage has been ended, close() should be called while supplying the fd. This call will release the resources that were earlier allocated using the mlx5dv_devx_uar_export_dmabuf_fd() API. A detailed man page was added as well. Signed-off-by: Yishai Hadas <yishaih@nvidia.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This series adds support for exporting dma-buf file descriptors for both ibv_dm and mlx5dv_devx_uar objects.
This allows PCI device memory to be shared with other kernel subsystems (e.g., graphics or media) or between userspace processes, via the standard dma-buf interface, avoiding unnecessary copies and enabling efficient peer-to-peer (P2P) DMA transfers. See [1] for background on dma-buf.
For that the below APIs were exposed:
ibv_dm_export_dmabuf_fd() - for exporting an fd for ib_dm.
mlx5dv_devx_uar_export_dmabuf_fd() - for exporting an fd for mlx5dv_devx_uar.
Detailed man pages exist as part of the series.
The matching kernel code was sent to rdma-next.
[1] https://docs.kernel.org/driver-api/dma-buf.html