---
name: "rdma_accept"
section: "3"
platform: "linux"
package: "rdma-core"
version: "65.0-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux", "freebsd"]
url: "https://new.carta.tech/rdma_accept"
---

# rdma\_accept(3)

Called to accept a connection request.

## NAME

rdma\_accept - Called to accept a connection request.

## SYNOPSIS

**#include \<rdma/rdma\_cma.h\>**

**int rdma\_accept** **(struct rdma\_cm\_id \****id***,** **struct rdma\_conn\_param \****conn\_param***);**

## ARGUMENTS

- id

  Connection identifier associated with the request.

- conn\_param

  Information needed to establish the connection.  See CONNECTION PROPERTIES below for details.

## DESCRIPTION

Called from the listening side to accept a connection or datagram service lookup request.

## RETURN VALUE

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

## NOTES

Unlike the socket accept routine, rdma\_accept is not called on a listening rdma\_cm\_id.  Instead, after calling rdma\_listen, the user waits for an RDMA\_CM\_EVENT\_CONNECT\_REQUEST event to occur.  Connection request events give the user a newly created rdma\_cm\_id, similar to a new socket, but the rdma\_cm\_id is bound to a specific RDMA device. rdma\_accept is called on the new rdma\_cm\_id.

## CONNECTION PROPERTIES

The following properties are used to configure the communication and specified by the conn\_param parameter when accepting a connection or datagram communication request.  Users should use the rdma\_conn\_param values reported in the connection request event to determine appropriate values for these fields when accepting.  Users may reference the rdma\_conn\_param structure in the connection event directly, or can reference their own structure.  If the rdma\_conn\_param structure from an event is referenced, the event must not be acked until after this call returns.

If the conn\_param parameter is NULL, the values reported in the connection request event are used, adjusted down based on local hardware restrictions.

- 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.  May be NULL if private\_data is not required.

- private\_data\_len

  Specifies the size of the user-controlled data buffer.  Note that the actual amount of data transferred to the remote side is transport dependent and may be larger than that requested.

- responder\_resources

  The maximum number of outstanding RDMA read and atomic operations that the local side will accept from the remote side.  Applies only to RDMA\_PS\_TCP. This value must be less than or equal to the local RDMA device attribute max\_qp\_rd\_atom, but preferably greater than or equal to the responder\_resources value reported in the connect request event.

- initiator\_depth

  The maximum number of outstanding RDMA read and atomic operations that the local side will have to the remote side.  Applies only to RDMA\_PS\_TCP. This value must be less than or equal to the local RDMA device attribute max\_qp\_init\_rd\_atom and the initiator\_depth value reported in the connect request event.

- flow\_control

  Specifies if hardware flow control is available.  This value is exchanged with the remote peer and is not used to configure the QP.  Applies only to RDMA\_PS\_TCP.

- retry\_count

  This value is ignored.

- rnr\_retry\_count

  The maximum number of times that a send operation from the remote peer should be retried on a connection after receiving a receiver not ready (RNR) error.  RNR errors are generated when a send request arrives before a buffer has been posted to receive the incoming data.  Applies only to RDMA\_PS\_TCP.

- srq

  Specifies if the QP associated with the connection is using a shared receive queue.  This field is ignored by the library if a QP has been created on the rdma\_cm\_id.  Applies only to RDMA\_PS\_TCP.

- qp\_num

  Specifies the QP number associated with the connection.  This field is ignored by the library if a QP has been created on the rdma\_cm\_id.

## INFINIBAND SPECIFIC

In addition to the connection properties defined above, InfiniBand QPs are configured with minimum RNR NAK timer and local ACK timeout values.  The minimum RNR NAK timer value is set to 0, for a delay of 655 ms. The local ACK timeout is calculated based on the packet lifetime and local HCA ACK delay.  The packet lifetime is determined by the InfiniBand Subnet Administrator and is part of the route (path record) information obtained by the active side of the connection.  The HCA ACK delay is a property of the locally used HCA.

The RNR retry count is a 3-bit value.

The length of the private data provided by the user is limited to 196 bytes for RDMA\_PS\_TCP, or 136 bytes for RDMA\_PS\_UDP.

## SEE ALSO

[rdma\_listen(3)](/rdma_listen/3.md), [rdma\_reject(3)](/rdma_reject/3.md), [rdma\_get\_cm\_event(3)](/rdma_get_cm_event/3.md)
