RDMA_POST_WRITEV(3)

πŸ’… RDMA_POST_WRITEV(3) πŸ’…

okay bestie, pull up a chair, because we're about to talk about rdma_post_writev β€” yes it's from the Librdmacm Programmer's Manual, yes it's giving serious low-level energy, and yes you're gonna slay it. this page is literally just "post an RDMA write work request." that's it. that's the whole vibe. but let's get into it because the details matter, periodt. πŸ¦‹


✨ NAME ✨

rdma_post_writev β€” post an RDMA write work request.


🌸 SYNOPSIS 🌸

#include <rdma/rdma_verbs.h>

int rdma_post_writev (struct rdma_cm_id *id, void *context, struct
ibv_sge *sgl, int nsge, int flags, uint64_t remote_addr, uint32_t rkey);

πŸŽ€ ARGUMENTS πŸŽ€

  • id β€” a reference to a communication identifier where the request will be posted. it's the main character, obviously. πŸ‘‘
  • context β€” user-defined context associated with the request. your lil personal sticker on the request, iykyk.
  • sgl β€” a scatter-gather list of the source buffers of the write. the stuff you're sending out into the world. πŸ’Œ
  • nsge β€” the number of scatter-gather array entries. count 'em, bestie.
  • flags β€” optional flags used to control the write operation. the seasoning. ✨
  • remote_addr β€” the address of the remote registered memory to write into. that's where the data is going.
  • rkey β€” the registered memory key associated with the remote address. the little keycard that lets you in. πŸ”‘

πŸ’– DESCRIPTION πŸ’–

so here's the tea: this function posts a work request to the send queue of the queue pair associated with the rdma_cm_id. and then β€” and this is the cute part β€” the contents of the local data buffers get written into the remote memory region. like you're sliding a note under someone's door but the door is a remote memory region and the note is your scatter-gather list. 🫢


⭐ RETURN VALUE ⭐

returns 0 on success, or -1 on error. and if an error happens? errno will be set to indicate the failure reason. so like, if it goes wrong, it tells you why. we love communication in this house. πŸ’œ


🧚 NOTES 🧚

for a list of supported flags, see ibv_post_send. don't just make them up, bestie, go look. πŸ™ˆ

unless inline data is specified, the local data buffers must have been registered before the write is issued, and the buffers must remain registered until the write completes. the remote buffers must always be registered. no registration, no write. that's the rule. that's not a suggestion. πŸ’€

write operations may not be posted to an rdma_cm_id or the corresponding queue pair until it has been connected. connect first. then post. in that order. do not skip steps. πŸ”₯

the user-defined context associated with the write request will be returned to you through the work completion wr_id field β€” that's the work request identifier, in case you were wondering what wr_id stands for. so whatever you put in the context, you get it back later. it's giving boomerang. 🌈


πŸ‘‘ SEE ALSO πŸ‘‘

rdma_cm(7), rdma_connect(3), rdma_accept(3), ibv_post_send(3), rdma_post_write(3), rdma_reg_write(3), rdma_reg_msgs(3)


and that's the whole page, bestie. this one's from librdmacm, dated 2010-07-19 β€” vintage, iconic, still serving. go register your buffers and stay hydrated. mwah. πŸ’…πŸ’–βœ¨

πŸ“¦ where this page comes from