---
name: "rdma_create_srq"
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_srq"
---

# rdma\_create\_srq(3)

Allocate a shared receive queue.

## NAME

rdma\_create\_srq - Allocate a shared receive queue.

## SYNOPSIS

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

**int rdma\_create\_srq** **(struct rdma\_cm\_id \****id***,** **struct ibv\_pd \****pd***,** **struct ibv\_srq\_init\_attr \****attr***);**

## ARGUMENTS

- id

  RDMA identifier.

- pd

  Optional protection domain for the SRQ.

- attr

  Initial SRQ attributes.

## DESCRIPTION

Allocate a SRQ associated with the specified rdma\_cm\_id.

## RETURN VALUE

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

## NOTES

The rdma\_cm\_id must be bound to a local RDMA device before calling this function, and the protection domain, if provided, must be for that same device. After being allocated, the SRQ will be ready to handle posting of receives.

If a protection domain is not given - pd parameter is NULL - then the rdma\_cm\_id will be created using a default protection domain.  One default protection domain is allocated per RDMA device.

The initial SRQ attributes are specified by the attr parameter.  The ext.xrc.cq fields in the ibv\_srq\_init\_attr is optional.  If a completion queue is not specified for an XRC SRQ, then a CQ will be allocated by the rdma\_cm for the SRQ, along with corresponding completion channels.  Completion channels and CQ data created by the rdma\_cm are exposed to the user through the rdma\_cm\_id structure.

The actual capabilities and properties of the created SRQ will be returned to the user through the attr parameter.  An rdma\_cm\_id may only be associated with a single SRQ.

## SEE ALSO

[rdma\_bind\_addr(3)](/rdma_bind_addr/3.md), [rdma\_resolve\_addr(3)](/rdma_resolve_addr/3.md), [rdma\_create\_ep(3)](/rdma_create_ep/3.md), [rdma\_destroy\_srq(3)](/rdma_destroy_srq/3.md), [ibv\_create\_srq(3)](/ibv_create_srq/3.md), ibv\_create\_xsrq(3)
