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 usingmlx5dv_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 thepp_contextinput 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_devicemlx5dv_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
- 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