IBV_CREATE_CQ(3)
π IBV_CREATE_CQ(3) π
okay bestie, welcome to the Libibverbs Programmer's Manual β¨ today we're doing completion queues, and honestly? iconic behavior. this page lives in section 3, and its whole personality is ibv_create_cq and ibv_destroy_cq β making CQs and un-making them π
πΈ NAME πΈ
ibv_create_cq, ibv_destroy_cq β create or destroy a completion queue (CQ) π«Ά
β¨ SYNOPSIS β¨
#include <infiniband/verbs.h>
struct ibv_cq *ibv_create_cq(struct ibv_context *context, int cqe,
void *cq_context,
struct ibv_comp_channel *channel,
int comp_vector);
int ibv_destroy_cq(struct ibv_cq *cq);
π¦ DESCRIPTION π¦
so ibv_create_cq() is the main character here π
it creates a completion queue (CQ) with at least cqe entries for the RDMA device context context.
that cq_context pointer? yeah, it gets used to set the user context pointer of the CQ structure. no cap.
the channel argument is optional β if it's not NULL, then the completion channel channel will be used to return completion events π and your CQ will use the completion vector comp_vector for signaling completion events. important: comp_vector must be at least zero and less than context->num_comp_vectors. like, fr fr, don't be out here out of range π
then ibv_destroy_cq() destroys the CQ cq. that's it, that's the job, she's done β¨
π RETURN VALUE π
ibv_create_cq() returns a pointer to the CQ, or NULL if the request fails π
ibv_destroy_cq() returns 0 on success, or the value of errno on failure (and that errno tells you the failure reason, bestie π«Ά).
π NOTES π
ibv_create_cq()may create a CQ with size greater than or equal to the requested size. so check thecqeattribute in the returned CQ for the actual size. the way that "at least" is doing heavy lifting πibv_destroy_cq()fails if any queue pair is still associated with this CQ. so clean up your QPs first, periodt π
π₯ SEE ALSO π₯
π AUTHORS π
Dotan Barak <dotanba@gmail.com> π
and that's the whole vibe, bestie β this page came from libibverbs, dated 2006-10-31 π she's been slaying since 2006 and she's still serving. mwah πβ¨
π¦ 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
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- 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