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

# ibv\_post\_srq\_ops(3)

perform on a special shared receive queue (SRQ) configuration manipulations

## NAME

ibv\_post\_srq\_ops - perform on a special shared receive queue (SRQ) configuration manipulations

## SYNOPSIS

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

int ibv_post_srq_ops(struct ibv_srq *srq, struct ibv_ops_wr *wr,
                     struct ibv_ops_wr **bad_wr);
```

## DESCRIPTION

The **ibv\_post\_srq\_ops()** performs series of offload configuration manipulations on special types of SRQ *srq. Currenlty it is used to configure tag matching SRQ. Series of configuration* operations defined by linked lists of struct ibv\_ops\_wr elements starting from *wr.*

```
struct ibv_ops_wr {
uint64_t                wr_id;   /* User defined WR ID */
/* Pointer to next WR in list, NULL if last WR */
struct ibv_ops_wr      *next;
enum ibv_ops_wr_opcode  opcode;  /* From enum ibv_ops_wr_opcode */
int                     flags;   /* From enum ibv_ops_flags */
struct {
/* Number of unexpected messages
 * handled by SW */
uint32_t unexpected_cnt;
/* Input parameter for the DEL opcode
 * and output parameter for the ADD opcode */
uint32_t handle;
struct {
uint64_t                recv_wr_id;   /* User defined WR ID for TM_RECV */
struct ibv_sge         *sg_list; /* Pointer to the s/g array */
int                     num_sge; /* Size of the s/g array */
uint64_t                tag;
uint64_t                mask;    /* Incoming message considered matching if
                                    TMH.tag & entry.mask == entry.tag */
} add;
} tm;
};
```

First part of struct ibv\_ops\_wr retains ibv\_send\_wr notion. Opcode defines operation to perform. Currently supported IBV\_WR\_TAG\_ADD, IBV\_WR\_TAG\_DEL and IBV\_WR\_TAG\_SYNC values. See below for detailed description.

To allow reliable data delivery TM SRQ maintains special low level synchronization primitive - phase synchronization. Receive side message handling comprises two concurrent activities - posting tagged buffers by SW and receiving incoming messages by HW. This process considered coherent only if all unexpected messages received by HW is completely processed in SW. To pass to hardware number of processed unexpected messages unexpected\_cnt field should be used and IBV\_OPS\_TM\_SYNC flag should be set.

To request WC for tag list operations IBV\_OPS\_SIGNALED flags should be passed. In this case WC will be generated on TM SRQ's CQ, provided wr\_id will identify WC.

Opcode IBV\_WR\_TAG\_ADD used to add tag entry to tag matching list. Tag entry consists of SGE list, tag & mask (matching parameters), user specified opaque wr\_id (passed via recv\_wr\_id field) and uniquely identified by handle (returned by driver). Size of tag matching list is limited by max\_num\_tags. SGE list size is limited by max\_sge.

Opcode IBV\_WR\_TAG\_DEL removes previously added tag entry. Field handle should be set to value returned by previously performed IBV\_WR\_TAG\_ADD operation. Operation may fail due to concurrent tag consumption - in this case IBV\_WC\_TM\_ERR status will be returned in WC.

Opcode IBV\_WR\_TAG\_SYNC may be used if no changes to matching list required, just to updated unexpected messages counter.

IBV\_WC\_TM\_SYNC\_REQ flag returned in list operation WC shows that counter synchronization required. This flag also may be returned by unexpected receive WC, asking for IBV\_WR\_TAG\_SYNC operation to keep TM coherence consistency.

## RETURN VALUE

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

## SEE ALSO

[**ibv\_create\_srq\_ex**(3)](/ibv_create_srq_ex/3.md),

## AUTHORS

- Artemy Kovalyov \<artemyko@mellanox.com\>
