]> git.ipfire.org Git - thirdparty/linux.git/commit
RDMA/core: Introduce a DMAH object and its alloc/free APIs
authorYishai Hadas <yishaih@nvidia.com>
Thu, 17 Jul 2025 12:17:29 +0000 (15:17 +0300)
committerLeon Romanovsky <leon@kernel.org>
Wed, 23 Jul 2025 05:42:10 +0000 (01:42 -0400)
commitd83edab562a496a42720902a1d2effccd05c37c5
tree2b49fa4d30b2e4018f74ca45c3ea5dc3e44c5a59
parent5b2e45049dc06a876bc6b138218ddeb0814502ef
RDMA/core: Introduce a DMAH object and its alloc/free APIs

Introduce a new DMA handle (DMAH) object along with its corresponding
allocation and deallocation APIs.

This DMAH object encapsulates attributes intended for use in DMA
transactions.

While its initial purpose is to support TPH functionality, it is
designed to be extensible for future features such as DMA PCI multipath,
PCI UIO configurations, PCI traffic class selection, and more.

Further details:
----------------
We ensure that a caller requesting a DMA handle for a specific CPU ID is
permitted to be scheduled on it. This prevent a potential security issue
where a non privilege user may trigger DMA operations toward a CPU that
it's not allowed to run on.

We manage reference counting for the DMAH object and its consumers
(e.g., memory regions) as will be detailed in subsequent patches in the
series.

Signed-off-by: Yishai Hadas <yishaih@nvidia.com>
Reviewed-by: Edward Srouji <edwards@nvidia.com>
Link: https://patch.msgid.link/2cad097e849597e49d6b61e6865dba878257f371.1752752567.git.leon@kernel.org
Signed-off-by: Leon Romanovsky <leon@kernel.org>
drivers/infiniband/core/Makefile
drivers/infiniband/core/device.c
drivers/infiniband/core/rdma_core.h
drivers/infiniband/core/restrack.c
drivers/infiniband/core/uverbs_std_types_dmah.c [new file with mode: 0644]
drivers/infiniband/core/uverbs_uapi.c
include/rdma/ib_verbs.h
include/rdma/restrack.h
include/uapi/rdma/ib_user_ioctl_cmds.h