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_id or 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 that context you passed in? That's your little note-to-self coming back home. πŸ’œ

🌸 SEE ALSO 🌸


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