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_device
  • mlx5dv_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