RDMA/mlx5: Add DMAH support for reg_user_mr/reg_user_dmabuf_mr
authorYishai Hadas <yishaih@nvidia.com>
Thu, 17 Jul 2025 12:17:32 +0000 (15:17 +0300)
committerLeon Romanovsky <leon@kernel.org>
Wed, 23 Jul 2025 05:42:11 +0000 (01:42 -0400)
commite1bed9a94da86a7c01b985c2e9a030207269cbc7
treeac27a14a6c4428d82cdcf95394b987eec242e462
parenta272019a46c918575f10cc529c893585d46b3b55
RDMA/mlx5: Add DMAH support for reg_user_mr/reg_user_dmabuf_mr

As part of this enhancement, allow the creation of an MKEY associated
with a DMA handle.

Additional notes:

MKEYs with TPH (i.e. TLP Processing Hints) attributes are currently not
UMR-capable unless explicitly enabled by firmware or hardware.
Therefore, to maintain such MKEYs in the MR cache, the TPH fields have
been added to the rb_key structure, with a dedicated hash bucket.

The ability to bypass the kernel verbs flow and create an MKEY with TPH
attributes using DEVX has been restricted. TPH must follow the standard
InfiniBand flow, where a DMAH is created with the appropriate security
checks and management mechanisms in place.

DMA handles are currently not supported in conjunction with On-Demand
Paging (ODP).

Re-registration of memory regions originally created with TPH attributes
is currently not supported.

Signed-off-by: Yishai Hadas <yishaih@nvidia.com>
Reviewed-by: Edward Srouji <edwards@nvidia.com>
Link: https://patch.msgid.link/1c485651cf8417694ddebb80446c5093d5a791a9.1752752567.git.leon@kernel.org
Signed-off-by: Leon Romanovsky <leon@kernel.org>
drivers/infiniband/hw/mlx5/devx.c
drivers/infiniband/hw/mlx5/mlx5_ib.h
drivers/infiniband/hw/mlx5/mr.c
drivers/infiniband/hw/mlx5/odp.c