---
name: "ibv_modify_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/ibv_modify_srq"
---

# ibv\_modify\_srq(3)

modify attributes of a shared receive queue (SRQ)

## NAME

ibv\_modify\_srq - modify attributes of a shared receive queue (SRQ)

## SYNOPSIS

```
#include <infiniband/verbs.h>

int ibv_modify_srq(struct ibv_srq *srq,
                   struct ibv_srq_attr *srq_attr,
                   int srq_attr_mask);
```

## DESCRIPTION

**ibv\_modify\_srq()** modifies the attributes of SRQ *srq* with the attributes in *srq\_attr* according to the mask *srq\_attr\_mask.* The argument *srq\_attr* is an ibv\_srq\_attr struct, as defined in \<infiniband/verbs.h\>.

```
struct ibv_srq_attr {
uint32_t                max_wr;      /* maximum number of outstanding work requests (WRs) in the SRQ */
uint32_t                max_sge;     /* number of scatter elements per WR (irrelevant for ibv_modify_srq) */
uint32_t                srq_limit;   /* the limit value of the SRQ */
};
```

The argument *srq\_attr\_mask* specifies the SRQ attributes to be modified. The argument is either 0 or the bitwise OR of one or more of the following flags:

- **IBV\_SRQ\_MAX\_WR Resize the SRQ**

  - **IBV\_SRQ\_LIMIT Set the SRQ limit**

  ## RETURN VALUE

**ibv\_modify\_srq()** returns 0 on success, or the value of errno on failure (which indicates the failure reason).

## NOTES

If any of the modify attributes is invalid, none of the attributes will be modified.

Not all devices support resizing SRQs.  To check if a device supports it, check if the **IBV\_DEVICE\_SRQ\_RESIZE** bit is set in the device capabilities flags.

Modifying the srq\_limit arms the SRQ to produce an **IBV\_EVENT\_SRQ\_LIMIT\_REACHED** "low watermark" asynchronous event once the number of WRs in the SRQ drops below srq\_limit.

## SEE ALSO

[**ibv\_query\_device**(3)](/ibv_query_device/3.md), [**ibv\_create\_srq**(3)](/ibv_create_srq/3.md), [**ibv\_destroy\_srq**(3)](/ibv_destroy_srq/3.md), [**ibv\_query\_srq**(3)](/ibv_query_srq/3.md)

## AUTHORS

- Dotan Barak \<dotanba@gmail.com\>
