MLX5DV_PP_ALLOC(3)

✨ mlx5dv_pp_alloc / mlx5dv_pp_free(3) ✨

okay bestie, welcome to the manual page for mlx5dv_pp_alloc and mlx5dv_pp_free, which are section 3 (library functions) of the manual. these two are your packet pacing girlies and honestly the way they just work is giving iconic. let's get into it πŸŽ€


πŸ’… NAME πŸ’…

  • mlx5dv_pp_alloc β€” allocates a packet pacing entry ✨
  • mlx5dv_pp_free β€” frees a packet pacing entry πŸ¦‹

🌸 SYNOPSIS 🌸

#include <infiniband/mlx5dv.h>

struct mlx5dv_pp *
mlx5dv_pp_alloc(struct ibv_context *context,
        size_t pp_context_sz,
        const void *pp_context,
        uint32_t flags);

void mlx5dv_pp_free(struct mlx5dv_pp *dv_pp);

like just look at those signatures. chef's kiss. πŸ”₯

🫢 DESCRIPTION 🫢

so what we're doing here is creating / freeing a packet pacing entry, and that entry can be used for some device commands over the DEVX interface. that's the whole vibe. main character energy, no notes. πŸ‘‘

the DEVX API enables direct access from the user space area to the mlx5 device driver β€” and the packet pacing information is needed for a few commands where a packet pacing index is needed. iykyk. like, not every command needs it, but the ones that do really do. πŸ’€

🧚 ARGUMENTS 🧚

  • context β€” the RDMA device context you're working on. plot twist: it needs to be opened with DEVX support by using mlx5dv_open_device(). so like, don't just roll up with any old context, she has to be the right one πŸ’–
  • pp_context_sz β€” length of the pp_context input buffer. literally just the size. no cap. πŸ“
  • pp_context β€” the packet pacing context, according to the device specification. (read the spec, bestie, it's giving homework but it's important πŸ™ˆ)
  • flags β€” MLX5DV_PP_ALLOC_FLAGS_DEDICATED_INDEX: allocate a dedicated index. that's the flag. she's the only one listed, she's the moment. ⭐

and then, nested right up in there:

dv_pp

struct mlx5dv_pp {
    uint16_t index;
};
  • index β€” the device index to be used. that's it. that's the field. 🌈
lowkey important: dv_pp is listed under ARGUMENTS in this page, so that's exactly where we're keeping her. do not move her. 😀

πŸ‘‘ RETURN VALUE πŸ‘‘

upon success, mlx5dv_pp_alloc returns a pointer to the created packet pacing object. slay. ✨

on error, NULL will be returned and errno will be set. so like, check your return value and check your errno, bestie β€” she's telling you what went wrong if you actually listen πŸ’€

πŸ¦‹ SEE ALSO πŸ¦‹

  • mlx5dv_open_device
  • mlx5dv_devx_obj_create

go read those too, they're part of the friend group 🫢

πŸ’œ AUTHOR πŸ’œ

Yishai Hadas <yishaih@mellanox.com> β€” thank you for the lore, king πŸŽ€


and that's the whole page bestie!! this one is filed as mlx5dv_pp_alloc / mlx5dv_pp_free(3) from the source/version line of the same name β€” no extra date on this one, so that's all she wrote πŸ’–βœ¨πŸŒΈ

πŸ“¦ where this page comes from