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