mlx5dv_create_mk...5dv_destroy_mkey(3)
π NAME π
mlx5dv_create_mk...5dv_destroy_mkey(3) β okay bestie, welcome to the mlx5dv manual page for indirect mkeys. Itβs giving create/destroy energy, and the facts are staying exactly where they belong. β¨
mlx5dv_create_mkeyβ Creates an indirect mkey πmlx5dv_destroy_mkeyβ Destroys an indirect mkey π
π SYNOPSIS π
#include <infiniband/mlx5dv.h>
struct mlx5dv_mkey_init_attr {
struct ibv_pd *pd;
uint32_t create_flags;
uint16_t max_entries;
};
struct mlx5dv_mkey {
uint32_t lkey;
uint32_t rkey;
};
struct mlx5dv_mkey *
mlx5dv_create_mkey(struct mlx5dv_mkey_init_attr *mkey_init_attr);
int mlx5dv_destroy_mkey(struct mlx5dv_mkey *mkey);
π¦ DESCRIPTION π¦
Create / destroy an indirect mkey.
Create an indirect mkey so an application can use its specific device functionality. Thatβs the whole point, bestie β it unlocks your appβs specific device functionality.
π ARGUMENTS π
mkey_init_attr
pdβ ibv protection domain. Your PD, your people.create_flagsβ the flags, and yes there are several. Hereβs the whole menu:MLX5DV_MKEY_INIT_ATTR_FLAGS_INDIRECTβ Indirect mkey is being created. π¦MLX5DV_MKEY_INIT_ATTR_FLAGS_BLOCK_SIGNATUREβ Enable block signature offload support for mkey.MLX5DV_MKEY_INIT_ATTR_FLAGS_CRYPTOβ Enable crypto offload support for mkey. Setting this flag means that crypto operations will be done and hence, must be configured. I.e. if this flag is set and the MKey was not configured for crypto properties usingmlx5dv_wr_set_mkey_crypto(), then running traffic with the MKey will fail, generating a CQE with error. πMLX5DV_MKEY_INIT_ATTR_FLAGS_UPDATE_TAGβ Enable update tag support for mkey. Setting this flag allows an application to set the mkey tag post of creating the mkey. If the kernel does not support updating the mkey tag, mkey creation will fail. πMLX5DV_MKEY_INIT_ATTR_FLAGS_REMOTE_INVALIDATEβ Enable remote invalidation support for mkey.
max_entriesβ Requested max number of pointed entries by this indirect mkey. The function will updatemkey_init_attr->max_entrieswith the actual mkey value that was created; it will be greater than or equal to the value requested. So you ask for a number, and it comes back with at least that. Slay.
β RETURN VALUE β
mlx5dv_create_mkeyβ upon success, returns a newstruct mlx5dv_mkey; on error,NULLis returned anderrnowill be set.mlx5dv_destroy_mkeyβ upon success,0is returned; on failure, the value oferrno.
πΈ Notes πΈ
Heads up, bestie: to let this functionality work, a DEVX context should be opened by using mlx5dv_open_device.
- The created indirect mkey canβt work with the scatter to CQE feature. For small messages, consider
mlx5dv_create_qp()withMLX5DV_QP_CREATE_DISABLE_SCATTER_TO_CQE.
π₯ SEE ALSO π₯
#AUTHOR
Yishai Hadas <yishaih@mellanox.com> π«Ά
π Thatβs the page, bestie. Cute little sign-off: the footer/source label is mlx5dv_create_mk...5dv_destroy_mkey(3), and the original doesnβt show a separate version or date line beyond that. π
π¦ where this page comes from
- alpine 3.24: rdma-core-doc 61.0-r0 Β· GPL-2.0-only OR BSD-2-Clause
- centos-stream 10: rdma-core-devel 62.0-3.el10 Β· GPLv2 or BSD
- centos-stream 9: rdma-core-devel 61.0-3.el9 Β· GPLv2 or BSD
- centos-stream 9: rdma-core-devel 61.0-3.el9 Β· GPLv2 or BSD
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms