ibv_destroy_comp_channel()
Contents
int ibv_destroy_comp_channel(struct ibv_comp_channel *channel); |
Description
ibv_destroy_comp_channel() destroys a Completion event channel.
The destruction of a Completion event channel will fail if any CQ is still associated with it.
Parameters
Name | Direction | Description |
---|---|---|
channel | in | Completion event channel that was returned from ibv_create_comp_channel() |
Return Values
Value | Description |
---|---|
0 | On success |
errno | On failure |
EBUSY | CQs are still associated with this Completion event channel |
Examples
Create a Completion event channel and destroy it:
struct ibv_comp_channel *event_channel; event_channel = ibv_create_comp_channel(context); if (!event_channel) { fprintf(stderr, "Error, ibv_create_comp_channel() failed\n"); return -1; } if (ibv_destroy_comp_channel(event_channel)) { fprintf(stderr, "Error, ibv_destroy_comp_channel() failed\n"); return -1; } |
FAQs
ibv_destroy_comp_channel() failed, what will happen to the CQs which are associated with it?
Nothing at all. You can continue working with them without any side-effect.
ibv_destroy_comp_channel() failed, can I know which CQs are associated with it and caused this failure?
No, currently the RDMA stack doesn’t have this capability.
Comments
Tell us what do you think.
Hi
Does calling this function remove the need to call close() on the corresponding file descriptor ?
I'm asking this as I need to know if I should manually de-register the corresponding file descriptor from an epoll instance I previously registered this to.
thx
Bernard
Hi.
I didn't work with epoll(), so I can't answer on this
(you are welcome to share a code which uses epoll, so I'll add it to the post).
But anyway, since ibv_create_comp_channel() opened the file descriptor of the Completion Event channel,
ibv_destroy_comp_channel() will close it.
Thanks
Dotan