rdma_connect

Initiates an active connection request.

Syntax

#include <rdma/rdma_cma.h>
int rdma_connect(struct rdma_cm_id *id, struct rdma_conn_param *conn_param);

Description

The rdma_connect function initiates a connection request to a remote destination.

Note: You must have resolved a route to the destination address by calling rdma_resolve_route before calling the rdma_connect routine.

Connection Properties

The following properties are used to configure the communication specified by the conn_param parameter when connecting or establishing a datagram communication.
private_data:
References a user-controlled data buffer. The contents of the buffer are copied and transparently passed to the remote side as part of the communication request. private_data might be NULL if it is not required.
private_data_len:
Specifies the size of the user-controlled data buffer.
responder_resources:
The maximum number of outstanding RDMA read operations that the local side accepts from the remote side. Applies only to RDMA_PS_TCP. The responder_resources value must be less than or equal to the local RDMA device attribute max_qp_rd_atom and remote RDMA device attribute max_qp_init_rd_atom. The remote endpoint can adjust this value when accepting the connection.
initiator_depth:
The maximum number of outstanding RDMA read operations that the local side has to the remote side. Applies only to RDMA_PS_TCP. The initiator_depth value must be less than or equal to the local RDMA device attribute max_qp_init_rd_atom and remote RDMA device attribute max_qp_rd_atom. The remote endpoint can adjust this value when accepting the connection.
flow_control:
Specifies if the hardware flow control is available. The flow_control value is exchanged with the remote peer and is not used to configure the QP. Applies only to RDMA_PS_TCP, and is specific to the InfiniBand architecture.
retry_count:
The maximum number of times that a data transfer operation must be tried on the connection when an error occurs. The retry_count setting controls the number of times to retry send RDMA, and atomic operations when time outs occur. Applies only to RDMA_PS_TCP, and is specific to the InfiniBand architecture.
rnr_retry_count:
The maximum number of times that a send operation from the remote peer is tried on a connection after receiving a receiver not ready (RNR) error. RNR errors are generated when a send request arrives before a buffer is posted to receive the incoming data. Applies only to RDMA_PS_TCP, and is specific to the InfiniBand architecture.
srq:
Specifies if the QP associated with the connection is using a shared receive queue. The srq field is ignored by the library if a QP is created on the rdma_cm_id. Applies only to RDMA_PS_TCP and is currently not supported.
qp_num:
Specifies the QP number associated with the connection. The qp_num field is ignored by the library if a QP is created on the rdma_cm_id. Applies only to RDMA_PS_TCP.
iWARP specific:
Connections established over iWARP RDMA devices currently require that the active side of the connection send the first message.

Parameters

id Specifies the RDMA identifier.
conn_param Specifies the connection parameters.

Return Values

The rdma_connect function returns the following values:
0 On success.
-1 Error, see errno.
-EINVAL
  • If the id or conn_param parameter is NULL
  • If the parameter conn_param->responder_resources is bigger than the local RDMA device attribute max_qp_rd_atom, and remote RDMA device attribute max_qp_init_rd_atom
  • If the parameter onn_param->initiator_depth is bigger than the local RDMA device attribute max_qp_init_rd_atom, and remote RDMA device attribute max_qp_rd_atom
-EPROTONOSUPPORT id->ps is not RDMA_PS_TCP.
-ENODATA The write operation on id->channel->fd failed.
[ Feedback ]