.\" Automatically generated by Pandoc 1.19.2.4
.\"
.TH "mlx5dv_create_mkey / mlx5dv_destroy_mkey" "3" "" "" ""
.hy
.SH NAME
.PP
mlx5dv_create_mkey \- Creates an indirect mkey
.PP
mlx5dv_create_mkey \- Destroys an indirect mkey
.SH SYNOPSIS
.IP
.nf
\f[C]
#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);
\f[]
.fi
.SH DESCRIPTION
.PP
Create / destroy an indirect mkey.
.PP
Create an indirect mkey to enable application uses its specific device
functionality.
.SH ARGUMENTS
.SS mkey_init_attr
.TP
.B \f[I]pd\f[]
ibv protection domain.
.RS
.RE
.TP
.B \f[I]create_flags\f[]
MLX5DV_MKEY_INIT_ATTR_FLAGS_INDIRECT: Indirect mkey is being created.
.RS
.RE
.TP
.B \f[I]max_entries\f[]
Requested max number of pointed entries by this indirect mkey.
The function will update the \f[I]mkey_init_attr\->max_entries\f[] with
the actual mkey value that was created; it will be greater than or equal
to the value requested.
.RS
.RE
.SH RETURN VALUE
.PP
Upon success \f[I]mlx5dv_create_mkey\f[] will return a new \f[I]struct
mlx5dv_mkey\f[] on error NULL will be returned and errno will be set.
.PP
Upon success destroy 0 is returned or the value of errno on a failure.
.SH Notes
.PP
To let this functionality works a DEVX context should be opened by using
\f[I]mlx5dv_open_device\f[].
.PP
The created indirect mkey can`t work with scatter to CQE feature,
consider \f[I]mlx5dv_create_qp()\f[] with
MLX5DV_QP_CREATE_DISABLE_SCATTER_TO_CQE for small messages.
.SH SEE ALSO
.PP
\f[B]mlx5dv_open_device\f[](3), \f[B]mlx5dv_create_qp\f[](3)
.SH AUTHOR
.PP
Yishai Hadas <yishaih@mellanox.com>
