mlx5dv_devx_get_event(3)
β¨ NAME β¨
mlx5dv_devx_get_event(3) β get an asynchronous event. Like, that's the whole vibe: grabbing an async event from an mlx5 event channel, and honestly? iconic little kernel-adjacent main character behavior π
π SYNOPSIS π
#include <infiniband/mlx5dv.h>
struct mlx5dv_devx_async_event_hdr {
uint64_t cookie;
uint8_t out_data[];
};
ssize_t mlx5dv_devx_get_event(struct mlx5dv_devx_event_channel *event_channel,
struct mlx5dv_devx_async_event_hdr *event_data,
size_t event_resp_len)
πΈ DESCRIPTION πΈ
Okay so bestie, mlx5dv_devx_get_event() gets a device event on the event_channel you pass in. Once you've posted a successful subscription over the event channel by calling mlx5dv_devx_subscribe_devx_event(), the application should use this API to get the response when an event has occurred. No cap.
When the response comes back, the cookie that you supplied during the subscription is returned, and out_data includes the data itself. Tiny plot twist: out_data may be omitted if the channel was created with the omit data flag π
The application must supply a large enough buffer to hold the event according to the device specification. The buffer size is given by the input event_resp_len parameter. So size it correctly, bestie β this is not a vibes-only situation β¨
π¦ ARGUMENTS π¦
event_channelβ the channel to get the event over. That's the event portal, the runway, the whole access point π«event_dataβ the output data from the asynchronous event.event_resp_lenβ the output buffer size to hold the response.
π₯ RETURN VALUE π₯
On success, mlx5dv_devx_get_event returns the number of bytes read. Otherwise, it returns -1, and errno was set. Simple as that, bestie π
π NOTES π
If the event_channel was created with the omit data flag, events having the same type may be combined per subscription and be reported once with the matching cookie. In that mode of work, ordering is not preserved between those events and other ones on this channel. Iykyk β same-type events can get bundled, but don't expect the timeline to stay ordered π
On the other hand, when each event should hold the device data, ordering is preserved. However, events might be loose as of lack of kernel memory β and in that case EOVERFLOW will be reported. So if you see EOVERFLOW, that's the kernel-memory shortage vibe check, not a drill π«Ά
π SEE ALSO π
π AUTHOR π
Yishai Hadas <yishaih@mellanox.com>
π Source/version vibes: mlx5dv_devx_get_event(3) in the mlx5dv manual. Date: not printed in the original footer, bestie β so we're not inventing one. Periodt. π
π¦ 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