RDMA_REG_WRITE(3)

πŸ’– RDMA_REG_WRITE β€” bestie edition πŸ’–

okay so this is a page from the Librdmacm Programmer's Manual, and it's literally the manual page RDMA_REG_WRITE(3). section 3, library calls, you know the vibe. let's go πŸ¦‹


✨ NAME ✨

rdma_reg_write β€” register data buffer(s) for remote RDMA write access.

like. you're putting a lil "reserved for the remote side πŸ’…" sign on your memory.


🌸 SYNOPSIS 🌸

#include <rdma/rdma_verbs.h>

struct ibv_mr * rdma_reg_write (struct rdma_cm_id *id, void *addr,
size_t length);

πŸŽ€ ARGUMENTS πŸŽ€

  • id β€” a reference to a communication identifier, aka where the message buffer(s) are gonna get used. it's the friend group this buffer is hanging out with.
  • addr β€” the address of the memory buffer(s) you're registering. yes, the address. the actual spot.
  • length β€” the total length of the memory you're registering. the whole thing, no crumbs.

πŸ’« DESCRIPTION πŸ’«

so basically you're registering a memory buffer that a remote RDMA write operation is gonna access. 🫢

buffers that you register with rdma_reg_write can be targeted in an RDMA write request β€” meaning the buffer can be named on the remote side of an RDMA connection as the remote_addr of rdma_post_write, or of a similar call. so the other side knows exactly where to write. it's giving ✨designated drop-off spot✨.


πŸ”₯ RETURN VALUE πŸ”₯

  • success? you get a reference to the registered memory region. iconic. πŸ‘‘
  • error? you get NULL. πŸ’€
  • and if an error happens, errno gets set to tell you why it failed.

🧚 NOTES 🧚

rdma_reg_write is what you call to register a data buffer that's gonna be the target of an RDMA write operation on a queue pair associated with an rdma_cm_id. the memory buffer gets registered with the protection domain associated with the identifier. πŸ”

the start of the data buffer is specified through the addr parameter, and the total size of the buffer is given by length. no cap.

ok and this part is important bestie β€” all data buffers should be registered before they get posted as a work request. and users must deregister all registered memory by calling rdma_dereg_mr. don't leave your memory registered, that's not the vibe. 😭

🌈 SEE ALSO 🌈

rdma_cm(7), rdma_create_id(3), rdma_create_ep(3), rdma_reg_msgs(3), rdma_reg_read(3), ibv_reg_mr(3), ibv_dereg_mr(3), rdma_post_write(3)


and that's the whole page fr fr πŸ“ this one came out of librdmacm back on 2010-07-19, and the original header/footer said RDMA_REG_WRITE(3) top and bottom. go register something, bestie, you got this πŸ’œβœ¨

πŸ“¦ where this page comes from