ibv_ack_async_event()
Contents
void ibv_ack_async_event(struct ibv_async_event *event); |
Description
ibv_ack_async_event() acknowledge an asynchronous event that was read using ibv_get_async_event().
In order to prevent races, all of the asynchronous events that were read using ibv_get_async_event() must be acknowledged using ibv_ack_async_event(). When calling to ibv_ack_async_event(), it is important to provide it the event that was read (or an exact copy of it), without any changes, otherwise internal data structures may contain bad information and calling verbs that destroy RDMA objects may never end.
Parameters
Name | Direction | Description |
---|---|---|
event | in | asynchronous event that was returned from ibv_get_async_event() |
Return Values
None (this function always succeeds).
Examples
Read an asynchronous event and acknowledge it:
struct ibv_async_event event; int ret; ret = ibv_get_async_event(ctx, &event); if (ret) { fprintf(stderr, "Error, ibv_get_async_event() failed\n"); return -1; } /* ack the event */ ibv_ack_async_event(&event); |
FAQs
Why do I need to call ibv_ack_async_event() anyway?
This verb is used in order to prevent internal races.
What will happen if I won't acknowledge all of the asynchronous events?
If one won't acknowledge all of the asynchronous events that he reads using ibv_get_async_event(), destroying the appropriate RDMA resource (QP for QP events, CQ for CQ events, SRQ for SRQ events) will be blocked forever. This behavior is used in order to prevent an acknowledgment on a resource that has already been destroyed.
What will happen if I read an asynchronous event and my process will be terminated intentionally (for example, by calling exit()) or unintentionally (for example, by segmentation fault) before I could acknowledge the event?
Even if there is any unacknowledged asynchronous event, when the process will be terminated, no matter the reason is, all of the resources will be cleaned.
Comments
Tell us what do you think.
There are no comments on this entry.