RDMA_POST_READV(3)

πŸ’… RDMA_POST_READV(3) πŸ’…

okay bestie, welcome to the Librdmacm Programmer's Manual ✨ this one's about rdma_post_readv, and it's literally the moment where you tell the network card "hey. go grab me that remote memory. put it right here." 🫢


🌸 NAME 🌸

rdma_post_readv β€” post an RDMA read work request. that's it, that's the whole vibe. πŸ¦‹


✨ SYNOPSIS ✨

#include <rdma/rdma_verbs.h>

int rdma_post_readv (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. this is your main character, the one carrying the whole operation πŸ’…
  • context β€” user-defined context associated with the request. you put it in, you get it back later (see NOTES, bestie, it comes back to you through the work completion wr_id field πŸ‘‘)
  • sgl β€” a scatter-gather list of the destination buffers of the read. so like, where the stuff lands 🌈
  • nsge β€” the number of scatter-gather array entries. count them. no cap πŸ”’
  • flags β€” optional flags used to control the read operation. optional means optional, but they do things πŸŽ€
  • remote_addr β€” the address of the remote registered memory to read from. that's the far-away memory, the one you're reaching for πŸ¦‹
  • rkey β€” the registered memory key associated with the remote address. you need this. the remote side won't hand over anything without it πŸ”‘

πŸ’– DESCRIPTION πŸ’–

Posts a work request to the send queue of the queue pair associated with the rdma_cm_id. the contents of the remote memory region will be read into the local data buffers.

so to be super clear: remote memory ➑️ your local buffers. it's giving "bring it to me" energy πŸ˜­πŸ’–


⭐ RETURN VALUE ⭐

Returns 0 on success, or -1 on error. If an error occurs, errno will be set to indicate the failure reason.

zero = slay. negative one = something went wrong and errno is holding the receipts πŸ’€


🧚 NOTES 🧚

For a list of supported flags, see ibv_post_send.

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. do not be out here unregistering early, bestie, it will not go well πŸ™ˆ

Read 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. periodt. πŸ”₯

The user-defined context associated with the read request will be returned to the user through the work completion wr_id, work request identifier, field. so whatever you handed in as context? yeah. it finds its way back to you πŸ₯ΉπŸ’œ


πŸ‘‘ SEE ALSO πŸ‘‘

rdma_cm(7), rdma_connect(3), rdma_accept(3), ibv_post_send(3), rdma_post_read(3), rdma_reg_read(3), rdma_reg_msgs(3)


and that's the whole page, bestie!! πŸŽ€βœ¨ this one came from librdmacm, dated 2010-07-19 β€” yes she's been iconic since 2010 and she's still serving πŸ’…πŸ¦‹ go register your buffers and connect your queue pair first, ily, bye πŸ’–πŸŒˆ

πŸ“¦ where this page comes from