---
name: "rdma_create_ep"
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_create_ep"
---

# rdma\_create\_ep(3)

Allocate a communication identifier and optional QP.

## NAME

rdma\_create\_ep - Allocate a communication identifier and optional QP.

## SYNOPSIS

**#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***);**

## ARGUMENTS

- id

  A reference where the allocated communication identifier will be returned.

- res

  Address information associated with the rdma\_cm\_id returned from rdma\_getaddrinfo.

- pd

  Optional protection domain if a QP is associated with the rdma\_cm\_id.

- qp\_init\_attr

  Optional initial QP attributes.

## DESCRIPTION

Creates an identifier that is used to track communication information.

## RETURN VALUE

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

## NOTES

After resolving address information using rdma\_getaddrinfo, a user may use this call to allocate an rdma\_cm\_id based on the results.

If the rdma\_cm\_id will be used on the active side of a connection, meaning that res-\>ai\_flag does not have RAI\_PASSIVE set, rdma\_create\_ep will automatically create a QP on the rdma\_cm\_id if qp\_init\_attr is not NULL.  The QP will be associated with the specified protection domain, if provided, or a default protection domain if not.  Users should see rdma\_create\_qp for details on the use of the pd and qp\_init\_attr parameters.  After calling rdma\_create\_ep, the returned rdma\_cm\_id may be connected by calling rdma\_connect.  The active side calls rdma\_resolve\_addr and rdma\_resolve\_route are not necessary.

If the rdma\_cm\_id will be used on the passive side of a connection, indicated by having res-\>ai\_flag RAI\_PASSIVE set, this call will save the provided pd and qp\_init\_attr parameters.  When a new connection request is retrieved by calling rdma\_get\_request, the rdma\_cm\_id associated with the new connection will automatically be associated with a QP using the pd and qp\_init\_attr parameters.  After calling rdma\_create\_ep, the returned rdma\_cm\_id may be placed into a listening state by immediately calling rdma\_listen.  The passive side call rdma\_bind\_addr is not necessary.  Connection requests may then be retrieved by calling rdma\_get\_request.

The newly created rdma\_cm\_id will be set to use synchronous operation. Users that wish asynchronous operation must migrate the rdma\_cm\_id to a user created event channel using rdma\_migrate\_id.

Users must release the created rdma\_cm\_id by calling rdma\_destroy\_ep.

## SEE ALSO

[rdma\_cm(7)](/rdma_cm/7.md), [rdma\_getaddrinfo(3)](/rdma_getaddrinfo/3.md), [rdma\_create\_event\_channel(3)](/rdma_create_event_channel/3.md), [rdma\_connect(3)](/rdma_connect/3.md), [rdma\_listen(3)](/rdma_listen/3.md), [rdma\_destroy\_ep(3)](/rdma_destroy_ep/3.md), [rdma\_migrate\_id(3)](/rdma_migrate_id/3.md)
