IBV_CREATE_SRQ(3)
π ibv_create_srq, ibv_destroy_srq β the SRQ glow-up guide π
okay bestie, welcome to IBV_CREATE_SRQ(3), straight out of the Libibverbs Programmer's Manual β¨ this is the page about making and unmaking a shared receive queue, aka an SRQ, and it is genuinely so much less scary than it sounds. sit down, sip ur strawberry drink π, let's go.
πΈ NAME πΈ
ibv_create_srq, ibv_destroy_srq β create or destroy a shared receive queue (SRQ)
no cap, that's the whole job. one makes it, one yeets it. π
β¨ SYNOPSIS β¨
#include <infiniband/verbs.h>
struct ibv_srq *ibv_create_srq(struct ibv_pd *pd, struct
ibv_srq_init_attr *srq_init_attr);
int ibv_destroy_srq(struct ibv_srq *srq);
like. two functions. that's it. ur faves could never be this concise π«Ά
π¦ DESCRIPTION π¦
so ibv_create_srq() creates a shared receive queue (SRQ) that is associated with the protection domain pd. yes, protection domain, the pd bestie, u gotta bring one.
the argument srq_init_attr is an ibv_srq_init_attr struct, as defined in <infiniband/verbs.h>. here's what it looks like, verbatim, no notes:
struct ibv_srq_init_attr {
void *srq_context; /* Associated context of the SRQ */
struct ibv_srq_attr attr; /* SRQ attributes */
};
and inside that attr field lives the ibv_srq_attr struct, which is giving very much "here are my boundaries" energy:
struct ibv_srq_attr {
uint32_t max_wr; /* Requested max number of outstanding work requests (WRs) in the SRQ */
uint32_t max_sge; /* Requested max number of scatter elements per WR */
uint32_t srq_limit; /* The limit value of the SRQ (irrelevant for ibv_create_srq) */
};
note that srq_limit is irrelevant for ibv_create_srq β she's just there for the vibes on this particular function, ok? don't come for her.
the way that ibv_create_srq() works is that it will update the srq_init_attr struct with the original values of the SRQ that was created π and the values of max_wr and max_sge will be greater than or equal to the values you requested. so like, u ask for a snack, u might get a bigger snack. iconic behavior honestly.
and ibv_destroy_srq() destroys the SRQ srq. that's it. that's the whole function. goodbye SRQ π
π₯ RETURN VALUE π₯
ibv_create_srq()returns a pointer to the created SRQ, orNULLif the request fails. (crying in null pointer π)ibv_destroy_srq()returns0on success, or the value oferrnoon failure (which indicates the failure reason).
fr fr, always check ur returns. main character energy includes error handling.
π NOTES π
ibv_destroy_srq() fails if any queue pair is still associated with this SRQ.
read that again bestie. u cannot destroy the SRQ while a queue pair is still holding onto it. that's a situationship, not a breakup. untangle them first π§
π SEE ALSO π
the whole friend group, go say hi π
π AUTHORS π
Dotan Barak <dotanba@gmail.com> β thank u king, we appreciate u π
and that's the page, bestie!! libibverbs, dated 2006-10-31 π go forth and queue ur receives, and remember: create responsibly, destroy only when ur queue pairs have moved on. periodt π β¨
π¦ where this page comes from
- alpine 3.24: rdma-core-doc 61.0-r0 Β· GPL-2.0-only OR BSD-2-Clause
- centos-stream 10: rdma-core-devel 62.0-3.el10 Β· GPLv2 or BSD
- centos-stream 9: rdma-core-devel 61.0-3.el9 Β· GPLv2 or BSD
- centos-stream 9: rdma-core-devel 61.0-3.el9 Β· GPLv2 or BSD
- debian bookworm: libibverbs-dev 44.0-2 Β· BSD-MIT OR GPL-2.0-only
- debian trixie: libibverbs-dev 56.1-1 Β· BSD-MIT OR GPL-2.0-only
- fedora 43: rdma-core-devel 58.0-4.fc43 Β· GPL-2.0-only OR BSD-2-Clause AND BSD-3-Clause
- fedora 43: rdma-core-devel 58.0-4.fc43 Β· GPL-2.0-only OR BSD-2-Clause AND BSD-3-Clause
- fedora 44: rdma-core-devel 61.0-2.fc44 Β· GPL-2.0-only OR BSD-2-Clause AND BSD-3-Clause
- fedora 44: rdma-core-devel 61.0-2.fc44 Β· GPL-2.0-only OR BSD-2-Clause AND BSD-3-Clause
- fedora 44: rdma-core-devel 61.1^20260812git975bdaf-1.fc44 Β· GPL-2.0-only OR BSD-2-Clause AND BSD-3-Clause
- fedora 44: rdma-core-devel 61.1^20260812git975bdaf-1.fc44 Β· GPL-2.0-only OR BSD-2-Clause AND BSD-3-Clause
- nixos 26.05: rdma-core 62.0
- opensuse-leap 16.0: rdma-core-devel 56.1-160000.2.2 Β· BSD-2-Clause OR GPL-2.0-only
- opensuse-leap 16.0: rdma-core-devel 56.1-160000.2.2 Β· BSD-2-Clause OR GPL-2.0-only
- opensuse-leap 16.0: rdma-core-devel 56.1-160000.2.2 Β· BSD-2-Clause OR GPL-2.0-only
- opensuse-leap 16.0: rdma-core-devel 56.1-160000.2.2 Β· BSD-2-Clause OR GPL-2.0-only
- ubuntu jammy: libibverbs-dev 39.0-1 Β· BSD-MIT OR GPL-2.0-only
- ubuntu noble: libibverbs-dev 50.0-2build2 Β· BSD-MIT OR GPL-2.0-only
- ubuntu noble: libibverbs-dev 50.0-2ubuntu0.2 Β· BSD-MIT OR GPL-2.0-only
- ubuntu questing: libibverbs-dev 56.1-1ubuntu1
- ubuntu resolute: libibverbs-dev 61.0-2ubuntu3 Β· BSD-MIT OR GPL-2.0-only
- ubuntu stonking: libibverbs-dev 64.0-1ubuntu1 Β· BSD-MIT OR GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms