ibv_create_comp_channel, ibv_destroy_comp_channel

Creates or destroys a completion event channel.

Syntax

#include <rdma/verbs.h>
struct ibv_comp_channel *ibv_create_comp_channel(struct ibv_context *context)
int ibv_destroy_comp_channel(struct ibv_comp_channel *channel)

Description

The ibv_create_comp_channel() function creates a completion event channel for the remote direct memory access (RDMA) device context, the context parameter. A completion channel is a mechanism to receive notifications when a new completion queue event (CQE) is placed on a completion queue (CQ).

The ibv_destroy_comp_channel() function destroys the completion event channe.

Notes:
  • A completion channel is an abstraction introduced by the libibverbs library that does not exist in the InfiniBand architecture verbs specification. A completion channel is essentially a file descriptor that is used to deliver completion notifications to a userspace process. When a completion event is generated for a completion queue (CQ), the event is delivered through the completion channel attached to that CQ. This process might be useful to send completion events to different threads by using multiple completion channels.
  • The ibv_destroy_comp_channel() function fails if any CQs are still associated with the completion event channel that is being destroyed.

Parameters

Item Descriptor
context The ibv_context struct for the ibv_open_device() function.

Return Value

The ibv_create_comp_channel() function returns a pointer to the created completion event channel, or NULL if the request fails.

The ibv_destroy_comp_channel() function returns 0 on success, or the value of errno on failure (which indicates the reason for failure).