MLX5DV_DEVX_DESTROY_CMD_COMP(3)
π
mlx5dv_devx_create_cmd_comp, mlx5dv_devx_destroy_cmd_comp, mlx5dv_devx_get_async_cmd_comp β mlx5dv_devx_crea..._comp, get_async(3) β¨
okay so bestie, you're in the mlx5dv_devx_crea..._comp, get_async(3) corner of the manual (yes the name is literally truncated with ... in the header, that's just how it is, iconic honestly) and we're talking about DEVX async command completions. buckle up, it's giving "non-blocking but make it RDMA" π¦
πΈ NAME πΈ
mlx5dv_devx_create_cmd_compβ creates a command completion, which you then use for DEVX asynchronous commands β¨mlx5dv_devx_destroy_cmd_compβ destroys a devx command completion πmlx5dv_devx_get_async_cmd_compβ gets an asynchronous command completion π
β SYNOPSIS β
#include <infiniband/mlx5dv.h>
struct mlx5dv_devx_cmd_comp {
int fd;
};
struct mlx5dv_devx_cmd_comp *
mlx5dv_devx_create_cmd_comp(struct ibv_context *context)
void mlx5dv_devx_destroy_cmd_comp(struct mlx5dv_devx_cmd_comp *cmd_comp)
struct mlx5dv_devx_async_cmd_hdr {
uint64_t wr_id;
uint8_t out_data[];
};
int mlx5dv_devx_get_async_cmd_comp(struct mlx5dv_devx_cmd_comp *cmd_comp,
struct mlx5dv_devx_async_cmd_hdr *cmd_resp,
size_t cmd_resp_len)
π¦ DESCRIPTION π¦
So basically you either create or destroy a command completion, and that thing is what you use for DEVX asynchronous commands. periodt.
The create verb hands you back an mlx5dv_devx_cmd_comp object, and that object is exactly what you plug into asynchronous DEVX commands. the whole point? your application gets to run asynchronously β no blocking, no waiting around like a lost lamb π β and then, once the response is actually ready, you read it out of this object. main character energy tbh β¨
You read that response with the mlx5dv_devx_get_async_cmd_comp() API. when the response lands, the wr_id you supplied when you fired off the asynchronous command comes back to you, and out_data contains the data itself. π
β οΈ okay important one, do not skip: the application must supply a large enough buffer to match any command that was issued on thecmd_comp. the size of that buffer is given by the inputcmd_resp_lenparameter. too small = bad vibes, so size it right fr fr π
π ARGUMENTS π
contextβ the RDMA device context you're creating the action on π«Άcmd_compβ the command completion object itselfcmd_respβ the output data from the asynchronous command β¨cmd_resp_lenβ the output buffer size, i.e. how much room you're giving it to hold the response π
π₯ RETURN VALUE π₯
On success, mlx5dv_devx_create_cmd_comp returns a brand new struct mlx5dv_devx_cmd_comp object. on error it returns NULL and errno gets set. π
On success, mlx5dv_devx_get_async_cmd_comp returns 0. otherwise, errno is returned.
π SEE ALSO π
π AUTHOR π
Yishai Hadas <yishaih@mellanox.com> π«Ά
and that's the whole page bestie π this one lives in the mlx5dv_devx_crea..._comp, get_async(3) manual β same truncated name up top and down at the bottom, no cap β and yeah, the name really does get cut off with ... in both spots, iykyk π§
π¦ 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