RDMA_POST_RECVV(3)
π RDMA_POST_RECVV(3) β the librdmacm programmer's manual page, but make it cute
okay bestie, gather round, because today we're learning how to post a work request to receive incoming messages π this is rdma_post_recvv from the Librdmacm Programmer's Manual and she is so iconic, no cap.
β¨ NAME β¨
rdma_post_recvv β post a work request to receive incoming messages. like, you're literally telling the universe "hey, i'm ready to receive, send me something bestie" π«Ά
πΈ SYNOPSIS πΈ
#include <rdma/rdma_verbs.h>
int rdma_post_recvv (struct rdma_cm_id *id, void *context, struct
ibv_sge *sgl, int nsge);
look at her. five lines of pure potential. π
π¦ ARGUMENTS π¦
idβ a reference to a communication identifier where the message buffer(s) will be posted. think of it as the address of the hangout spot where your buffers are gonna chill πcontextβ the user-defined context associated with the request. it's yours, you get to define it, it's giving personalization β¨sglβ a scatter-gather list of memory buffers posted as a single request. multiple buffers, one request, we love efficiency in this house πnsgeβ the number of scatter-gather entries in thesglarray. count them. count them carefully. π’
π DESCRIPTION π
Posts a single work request to the receive queue of the queue pair associated with the rdma_cm_id. so you're sliding one (1) work request onto the receive queue of that queue pair, okay?
The posted buffers will be queued to receive an incoming message sent by the remote peer. so they're sitting there, waiting, patient little buffers, ready for whatever the remote peer decides to send over π
β RETURN VALUE β
- Returns
0on success π - Returns
-1on error π
If an error occurs, errno will be set to indicate the failure reason. so check your errno, bestie, she's telling you everything.
π₯ NOTES π₯
okay this is the part where you actually pay attention, this is the vibe check portion of the page.
The user is responsible for ensuring that the receive is posted, and the total buffer space is large enough to contain all sent data before the peer posts the corresponding send message. that's on you. nobody else is gonna post that receive for you. not the kernel, not the peer, not me. you. π«΅
The message buffers must have been registered before being posted, and the buffers must remain registered until the receive completes. registered before, registered throughout, no deregistering mid-receive, that's the rule fr fr.
Messages may be posted to an rdma_cm_id only after a queue pair has been associated with it. no queue pair, no posting. it's giving "you can't sit with us" π
A queue pair is bound to an rdma_cm_id after calling rdma_create_ep or rdma_create_qp, if the rdma_cm_id is allocated using rdma_create_id. so that's the pipeline: rdma_create_id β rdma_create_ep or rdma_create_qp β then you may post. in that order. periodt.
The user-defined context associated with the receive request will be returned to the user through the work completion wr_id, work request identifier, field. so that context you passed in? she comes back to you. through wr_id. it's a whole circle of life situation π§
π SEE ALSO π
rdma_cm(7)rdma_create_id(3)rdma_create_ep(3)rdma_create_qp(3)rdma_reg_read(3)ibv_reg_mr(3)ibv_dereg_mr(3)rdma_post_recv(3)rdma_post_send(3)
iykyk, go read them all, they're all part of the same friend group π
and that's the page!! brought to you by librdmacm, dated 2010-07-19 β yes she's been serving this documentation since 2010 and she has not aged a day πβ¨ mwah, go post some receives bestie π
π¦ 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: librdmacm-dev 44.0-2 Β· BSD-MIT OR GPL-2.0-only
- debian trixie: librdmacm-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: librdmacm-dev 39.0-1 Β· BSD-MIT OR GPL-2.0-only
- ubuntu noble: librdmacm-dev 50.0-2build2 Β· BSD-MIT OR GPL-2.0-only
- ubuntu noble: librdmacm-dev 50.0-2ubuntu0.2 Β· BSD-MIT OR GPL-2.0-only
- ubuntu questing: librdmacm-dev 56.1-1ubuntu1
- ubuntu resolute: librdmacm-dev 61.0-2ubuntu3 Β· BSD-MIT OR GPL-2.0-only
- ubuntu stonking: librdmacm-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