---
name: "rdma_create_id"
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_id"
---

# rdma\_create\_id(3)

Allocate a communication identifier.

## NAME

rdma\_create\_id - Allocate a communication identifier.

## SYNOPSIS

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

## ARGUMENTS

- channel

  The communication channel that events associated with the allocated rdma\_cm\_id will be reported on.  This may be NULL.

- id

  A reference where the allocated communication identifier will be returned.

- context

  User specified context associated with the rdma\_cm\_id.

- ps

  RDMA port space.

## 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

Rdma\_cm\_id's are conceptually equivalent to a socket for RDMA communication.  The difference is that RDMA communication requires explicitly binding to a specified RDMA device before communication can occur, and most operations are asynchronous in nature.  Asynchronous communication events on an rdma\_cm\_id are reported through the associated event channel.  If the channel parameter is NULL, the rdma\_cm\_id will be placed into synchronous operation.  While operating synchronously, calls that result in an event will block until the operation completes. The event will be returned to the user through the rdma\_cm\_id structure, and be available for access until another rdma\_cm call is made.

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

## PORT SPACE

Details of the services provided by the different port spaces are outlined below.

- RDMA\_PS\_TCP

  Provides reliable, connection-oriented QP communication.  Unlike TCP, the RDMA port space provides message, not stream, based communication.

- RDMA\_PS\_UDP

  Provides unreliable, connectionless QP communication.  Supports both datagram and multicast communication.

- RDMA\_PS\_IB

  Provides for any IB services (UD, UC, RC, XRC, etc.).

## SEE ALSO

[rdma\_cm(7)](/rdma_cm/7.md), [rdma\_create\_event\_channel(3)](/rdma_create_event_channel/3.md), [rdma\_destroy\_id(3)](/rdma_destroy_id/3.md), [rdma\_get\_devices(3)](/rdma_get_devices/3.md), [rdma\_bind\_addr(3)](/rdma_bind_addr/3.md), [rdma\_resolve\_addr(3)](/rdma_resolve_addr/3.md), [rdma\_connect(3)](/rdma_connect/3.md), [rdma\_listen(3)](/rdma_listen/3.md), [rdma\_set\_option(3)](/rdma_set_option/3.md)
