1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120
|
.\" Automatically generated by Pandoc 2.9.2.1
.\"
.TH "mlx5dv_devx_umem_reg, mlx5dv_devx_umem_dereg" "3" "" "" ""
.hy
.SH NAME
.PP
mlx5dv_devx_umem_reg - Register a user memory to be used by the devx
interface
.PP
mlx5dv_devx_umem_reg_ex - Register a user memory to be used by the devx
interface
.PP
mlx5dv_devx_umem_dereg - Deregister a devx umem object
.SH SYNOPSIS
.IP
.nf
\f[C]
#include <infiniband/mlx5dv.h>
struct mlx5dv_devx_umem {
uint32_t umem_id;
};
struct mlx5dv_devx_umem *
mlx5dv_devx_umem_reg(struct ibv_context *context, void *addr, size_t size,
uint32_t access)
struct mlx5dv_devx_umem_in {
void *addr;
size_t size;
uint32_t access;
uint64_t pgsz_bitmap;
uint64_t comp_mask;
int dmabuf_fd;
};
struct mlx5dv_devx_umem *
mlx5dv_devx_umem_reg_ex(struct ibv_context *ctx, struct mlx5dv_devx_umem_in *umem_in);
int mlx5dv_devx_umem_dereg(struct mlx5dv_devx_umem *dv_devx_umem)
\f[R]
.fi
.SH DESCRIPTION
.PP
Register or deregister a user memory to be used by the devx interface.
.PP
The register verb exposes a UMEM DEVX object for user memory
registration for DMA.
The API to register the user memory gets as input the user address,
length and access flags, and provides to the user as output an object
which holds the UMEM ID returned by the firmware to this registered
memory.
.PP
The user can ask for specific page sizes for the given address and
length, in that case \f[I]mlx5dv_devx_umem_reg_ex()\f[R] should be used.
In case the kernel couldn\[cq]t find a matching page size from the given
\f[I]umem_in->pgsz_bitmap\f[R] bitmap the API will fail.
.PP
The user will use that UMEM ID in device direct commands that use this
memory instead of the physical addresses list, for example upon
\f[I]mlx5dv_devx_obj_create\f[R] to create a QP.
.SH ARGUMENTS
.TP
\f[I]context\f[R]
.IP
.nf
\f[C]
RDMA device context to create the action on.
\f[R]
.fi
.TP
\f[I]addr\f[R]
The memory start address to register.
.TP
\f[I]size\f[R]
.IP
.nf
\f[C]
The size of *addr* buffer.
\f[R]
.fi
.TP
\f[I]access\f[R]
The desired memory protection attributes; it is either 0 or the bitwise
OR of one or more of \f[I]enum ibv_access_flags\f[R].
.TP
\f[I]umem_in\f[R]
A structure holds the argument bundle.
.TP
\f[I]pgsz_bitmap\f[R]
Represents the required page sizes.
umem creation will fail if it cannot be created with these page sizes.
.TP
\f[I]comp_mask\f[R]
Flags indicating the additional fields.
.TP
\f[I]dmabuf_fd\f[R]
If MLX5DV_UMEM_MASK_DMABUF is set in \f[I]comp_mask\f[R] then this value
must be a FD of a dmabuf.
In this mode the dmabuf is used as the backing memory to create the umem
out of.
The dmabuf must be pinnable.
\f[I]addr\f[R] is interpreted as the starting offset of the dmabuf.
.SH RETURN VALUE
.PP
Upon success \f[I]mlx5dv_devx_umem_reg\f[R] /
\f[I]mlx5dv_devx_umem_reg_ex\f[R] will return a new \f[I]struct
mlx5dv_devx_umem\f[R] object, on error NULL will be returned and errno
will be set.
.PP
\f[I]mlx5dv_devx_umem_dereg\f[R] returns 0 on success, or the value of
errno on failure (which indicates the failure reason).
.SH SEE ALSO
.PP
\f[I]mlx5dv_open_device(3)\f[R], \f[I]ibv_reg_mr(3)\f[R],
\f[I]mlx5dv_devx_obj_create(3)\f[R]
.PP
#AUTHOR
.PP
Yishai Hadas <yishaih@mellanox.com>
|