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.

Notes:
  • The rdma_cm_ids are conceptually equivalent to a socket for RDMA communication. The difference is that the RDMA communication requires explicit binding to a specified RDMA device before communicating, and most operations are asynchronous in nature.
  • You must release the rdma_cm_id by calling the rdma_destroy_id function.
Port Spaces: RDMA_PS_TCP provides reliable, connection-oriented QP. Unlike TCP, the RDMA port space provides stream based communication.

Parameters

channel Specifies the communication channel that the events associated with the allocated rdma_cm_id are reported on.
id Specifies a reference where the allocated communication identifier will be returned.
context Indicates the user specified context associated with the rdma_cm_id.
ps Specifies the RDMA port space.

Return Values

The rdma_create_id function returns the following values:
0 On success.
-1 Error, see errno.
-EINVAL If the channel or id parameter is NULL or unable to query RDMA device.
-EPROTONOSUPPORT ps is not RDMA_PS_TCP.
-ENOMEM There is not enough memory to allocate the id by malloc.
-ENODATA The write operation on channel->fd failed.
-ENODEV Unable to get the RDMA device .
[ Feedback ]