Skip to content


0.00 avg. rating (0% score) - 0 votes
int ibv_destroy_comp_channel(struct ibv_comp_channel *channel);


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.


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


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;


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.

Share Our Posts

Share this post through social bookmarks.

  • Delicious
  • Digg
  • Newsvine
  • RSS
  • StumbleUpon
  • Technorati


Tell us what do you think.

  1. Bernard says: May 12, 2014


    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.



    • Dotan Barak says: May 13, 2014


      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.


Add a Comment

Fill in the form and submit.

Time limit is exhausted. Please reload CAPTCHA.