rdma_create_id

Allocates a communication identifier.

Syntax

#include <rdma/rdma_cma.h>
int rdma_create_id(struct rdma_event_channel *channel, struct rdma_cm_id **id, void *context, 
enum rdma_port_space ps);

Description

The rdma_create_id function creates an identifier that is used to track communication information. The communication channel that the events are associated with the allocated rdma_cm_id identifier is communicated. This may be NULL.

Notes:
  • The rdma_cm_id identifiers are equivalent to that of a socket in RDMA communication. The difference is that the RDMA communication requires explicit binding to a specified Remote Direct Memory Access (RDMA) device before communicating, and most operations are asynchronous in nature. The asynchronous communication events on an rdma_cm_id identifier are reported through the associated event channel. If the channel parameter is NULL, the rdma_cm_id is placed into synchronous operation. While operating synchronously, calls that result in an event cause a block until the operation completes. The event is returned to the user through the rdma_cm_id structure, and is available for access until the next rdma_cm call is made.
  • You must release the rdma_cm_id identifier by calling the rdma_destroy_id function.
Port Spaces: RDMA_PS_TCP provides reliable, connection-oriented queue pair (QP). Unlike TCP, the RDMA port space provides stream-based communication.

Parameters

Item Description
channel Specifies the communication channel for the allocated rdma_cm_id identifier to report the associated events.
context Indicates the user-specified context that is associated with the communication identifier.
id Specifies a reference identifier to return the allocated communication identifier.
ps Specifies the RDMA port space.

Return Values

The rdma_destroy_event_channel function returns 0 on success, or -1 on error. If an error occurs, the errno indicates the reason for failure.