RDMA_POST_READ(3)
β¨ NAME β¨
rdma_post_read β bestie, this is the one that posts an RDMA read work request. π¦
It lives in the Librdmacm Programmer's Manual (section 3, so it's a library call, iykyk).
πΈ SYNOPSIS πΈ
#include <rdma/rdma_verbs.h>
int rdma_post_read (struct rdma_cm_id *id, void *context, void *addr,
size_t length, struct ibv_mr *mr, int flags, uint64_t remote_addr,
uint32_t rkey);
Likeβ¦ that's the whole vibe. Eight args. She's high maintenance but she serves. π
π ARGUMENTS π
idβ a reference to a communication identifier where the request will be posted. It's giving "the address of the function" but for RDMA, periodt.contextβ user-defined context associated with the request. You pick it, you own it, it comes back to you later. πaddrβ the address of the local destination of the read request. So like, where the data lands. π«Άlengthβ the length of the read operation. How many bytes we're moving, no cap.mrβ registered memory region associated with the local buffer. Yes, registered. Do not skip this step, I'm literally begging. πflagsβ optional flags used to control the read operation. Optional bestie, but read the NOTES.remote_addrβ the address of the remote registered memory to read from. That's the other side's memory. Over there. πrkeyβ the registered memory key associated with the remote address. It's the little permission slip that lets you touch their buffer. π
π« DESCRIPTION π«
Okay so here's what actually happens: this posts a work request to the send queue of the queue pair associated with the rdma_cm_id. β¨
Then the contents of the remote memory region get read into the local data buffer. That's it. That's the whole plot. Remote memory β your buffer. Iconic behavior, honestly. π₯
β RETURN VALUE β
Returns 0 on success, or -1 on error. π
If an error occurs, errno will be set to indicate the failure reason. So like, check errno, bestie, she's literally telling you what went wrong.
π NOTES π
Read this part. I know you wanna skip it. Don't. π
- For a list of supported flags, see
ibv_post_send. Go look. I'll wait. π§ - Both the remote and local data buffers must have been registered before the read is issued, and the buffers must remain registered until the read completes. Not before-completes. Until it completes. This is not a drill. π¨
- Read operations may not be posted to an
rdma_cm_idor the corresponding queue pair until it has been connected. No connection = no read. Periodt. π - The user-defined context associated with the read request will be returned to you through the work completion
wr_id, work request identifier, field. So thatcontextyou passed in? That's your little note-to-self coming back home. π
πΈ SEE ALSO πΈ
rdma_cm(7)rdma_connect(3)rdma_accept(3)ibv_post_send(3)rdma_post_readv(3)rdma_reg_read(3)rdma_reg_msgs(3)
okay that's the whole page bestie, go post some reads π β¨π¦
librdmacm Β· 2010-07-19 Β· mwah, xoxo, and remember: register your buffers before you ship it π«Άπ
π¦ 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