rdma_create_ep

Creates an identifier (rdma_cm_id ) to track information about communication.

Syntax

#include <rdma/rdma_cma.h>
int rdma_create_ep [struct rdma_cm_id **id,struct rdma_addrinfo *res, 
struct ibv_pd *pd, struct ibv_qp_init_attr *qp_init_attr,]; 

Description

The rdma_cm_id identifier allocates a communication identifier and an optional queue pair (QP). The rdma_cm_id identifier is used in one of the following methods:
  • If the rdma_cm_id identifier is used on the active side of a connection, the RAI_PASSIVE option is not set on the res->ai_flag flag. The rdma_create_ep function automatically creates a QP on the rdma_cm_id identifier if the qp_init_attr value is not NULL. If the domain is provided, the QP is associated with the specified protection domain; otherwise, a default protection domain is used. After calling the rdma_create_ep function, the rdma_cm_id identifier that is returned can be connected by calling the rdma_connect function. The active side calls the rdma_resolve_addr function, and the rdma_resolve_route function is not necessary.
  • If the rdma_cm_id identifer is used on the passive side of a connection, the RAI_PASSIVE option is set on the res->ai_flag flag. This function call saves the value of the pd and qp_init_attr parameters. A new connection request is retrieved by calling the rdma_get_request function. The rdma_cm_id identifier associated with the new connection is automatically associated with a QP by using the pd and qp_init_attr parameters. After calling the rdma_create_ep function, the rdma_cm_id identifier can be placed into a listening state by calling the rdma_listen function. The passive side call the rdma_bind_addr is not necessary. The rdma_get_request function can be used to retrieve the connection. The rdma_cm_id identifier that is created is used for synchronous operation. To choose the asynchronous operation you must move the rdma_cm_id identifier to a user-created event channel by using the rdma_migrate_id function.

Parameters

Item Description
id Specifies a reference by which the allocated communication identifier must be returned .
res Specifies the address information that is associated with the rdma_cm_id identifier that is returned from the rdma_getaddrinfo function.
pd Specifies the optional protection domain if a QP is associated with the rdma_cm_id identifier.
qp_init_attr Specifies the optional initial, QP attributes.

Return Values

Returns 0 on success, or -1 on error. If an error occurs, the errno is set to indicate the reason for failure.