IBV_POST_RECV(3)
π IBV_POST_RECV π
okay bestie, pull up a chair, we're doing a libibverbs manpage from the Libibverbs Programmer's Manual and honestly? it's a bop.
β¨ NAME β¨
ibv_post_recv β post a list of work requests (WRs) to a receive queue π«Ά
πΈ SYNOPSIS πΈ
#include <infiniband/verbs.h>
int ibv_post_recv(struct ibv_qp *qp, struct ibv_recv_wr *wr,
struct ibv_recv_wr **bad_wr);
π DESCRIPTION π
so ibv_post_recv() takes a linked list of work requests (WRs) β starting with wr, obviously β and posts them to the receive queue of the queue pair qp. it's giving "here's my to-do list, please handle it" π
and like, the second something fails β meaning the failure is detectable immediately, right there while the requests are being posted β it stops processing WRs from the list. no cap. then it hands you back the failing WR through bad_wr so you know exactly which one was the problem child π
the argument wr is an ibv_recv_wr struct, as defined in <infiniband/verbs.h>. and here's what that bad boy looks like:
struct ibv_recv_wr {
uint64_t wr_id; /* User defined WR ID */
struct ibv_recv_wr *next; /* Pointer to next WR in list, NULL if last WR */
struct ibv_sge *sg_list; /* Pointer to the s/g array */
int num_sge; /* Size of the s/g array */
};
and the scatter/gather entries inside it, the little icons of the operation:
struct ibv_sge {
uint64_t addr; /* Start address of the local memory buffer */
uint32_t length; /* Length of the buffer */
uint32_t lkey; /* Key of the local Memory Region */
};
β RETURN VALUE β
ibv_post_recv() returns 0 on success π or the value of errno on failure (which tells you why it flopped, bestie).
π NOTES π
- the buffers used by a WR can only be safely reused after the WR request is fully executed and a work completion has been retrieved from the corresponding completion queue (CQ). do not skip this. do not get cute with it. wait for the completion. π
- if the QP
qpis associated with a shared receive queue, you must useibv_post_srq_recv()and notibv_post_recv(), because the QP's own receive queue will not be used. periodt. π - if a WR is being posted to a UD QP, the Global Routing Header (GRH) of the incoming message gets placed in the first 40 bytes of the buffer(s) in the scatter list. if there's no GRH in the incoming message, then those first bytes are undefined β like, genuinely undefined, don't trust them π. which means in all cases, the actual data of the incoming message starts at an offset of 40 bytes into the buffer(s) in the scatter list. forty. every time. iykyk. π₯
π SEE ALSO π
π AUTHORS π
Dotan Barak <dotanba@gmail.com> β icon, legend, the moment β¨
and that's the whole thing bestie!! this page is from libibverbs, dated 2006-10-31</>, and it's literally IBV_POST_RECV(3) all the way down. go post some receives, you absolute main character π¦π
π¦ where this page comes from
- alpine 3.24: rdma-core-doc 61.0-r0 Β· GPL-2.0-only OR BSD-2-Clause
- arch rolling: rdma-core 65.0-1 Β· GPL-2.0-or-later OR LicenseRef-OpenIB.org-BSD-MIT AND GPL-2.0-or-later OR LicenseRef-OpenIB.org-BSD-FreeBSD AND GPL-2.0-or-later OR LicenseRef-Intel-BSD-3-Clause AND GPL-2.0-or-later OR LicenseRef-PathScale-BSD-Patent-License AND CC0-1.0 AND MIT AND BSD-2-Clause AND CPL-1.0 OR BSD-2-Clause OR GPL-2.0-or-later
- 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
- nixpkgs unstable: rdma-core 65.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