MLX5DV_ALLOC_VAR(3)
NAME π
okay so this is the manual page for mlx5dv_alloc_var / mlx5dv_free_var(3) β bestie, it's literally two functions: one allocates a VAR, the other frees a VAR. β¨
mlx5dv_alloc_varβ allocates a VAR. πmlx5dv_free_varβ frees a VAR. π¦
SYNOPSIS πΈ
#include <infiniband/mlx5dv.h>
struct mlx5dv_var *
mlx5dv_alloc_var(struct ibv_context *context, uint32_t flags);
void
mlx5dv_free_var(struct mlx5dv_var *dv_var);
DESCRIPTION π§
So you create / free a VAR, and that VAR can be used for some device commands over the DEVX interface. That's the whole vibe. π
The DEVX API enables direct access from the user space area to the mlx5 device driver, and the VAR information is needed for few commands related to Virtio. iykyk. π₯
ARGUMENTS π«Ά
contextβ RDMA device context to work on.flagsβ allocation flags for the UAR.
dv_var β the struct involved, and here's exactly how it looks:
struct mlx5dv_var {
uint32_t page_id;
uint32_t length;
off_t mmap_off;
uint64_t comp_mask;
};
Its members are:
page_idβ the device page id to be used.lengthβ the mmap length parameter to be used for mapping a VA to the allocated VAR entry.mmap_offβ the mmap offset parameter to be used for mapping a VA to the allocated VAR entry.
comp_mask is in the struct too, but the page doesn't give it its own description β not me inventing lore. π
RETURN VALUE π
Upon success, mlx5dv_alloc_var returns a pointer to the created VAR. On error, NULL will be returned and errno will be set. That's the rule, bestie β check that pointer. π«Ά
SEE ALSO π
mlx5dv_open_devicemlx5dv_devx_obj_create
AUTHOR π
Yishai Hadas <yishaih@mellanox.com>
That's the page, bestie! The original footer doesn't list a source, version, or date β no extra tea there β so this cute sign-off is just me confirming there's no source/version/date info in the footer to report. ππβ¨
π¦ 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
- ubuntu jammy: libibverbs-dev 39.0-1 Β· BSD-MIT OR GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms