RDMA_POST_SENDV(3)

πŸ’Œ RDMA_POST_SENDV πŸ’Œ

okay bestie, gather round, because we're diving into rdma_post_sendv from the Librdmacm Programmer's Manual and honestly? it's giving "send a message, but make it scatter-gather." let's GO πŸ¦‹


✨ NAME ✨

rdma_post_sendv β€” post a work request to send a message. that's it, that's the whole vibe. πŸ“¨


🌸 SYNOPSIS 🌸

#include <rdma/rdma_verbs.h>

int rdma_post_sendv (struct rdma_cm_id *id, void *context, struct
ibv_sge *slg, int nsge, int flags);

look at that signature. chef's kiss. πŸ‘‘


πŸŽ€ ARGUMENTS πŸŽ€

  • id β€” a reference to a communication identifier where the message buffer will be posted. like, the where of it all. πŸ“
  • context β€” user-defined context associated with the request. this is YOUR lil stamp, you put whatever you want in here, and it comes back to you later (we'll get to that, stay tuned πŸ‘€).
  • slg β€” a scatter-gather list of memory buffers posted as a single request. one request, many buffers, we love efficiency. ✨
  • nsge β€” the number of scatter-gather entries in the slg array. just tell it how many you brought. πŸ”’
  • flags β€” optional flags used to control the send operation. the little knobs and dials, iykyk. πŸŽ›οΈ

πŸ’… DESCRIPTION πŸ’…

so what does this actually DO? it posts a work request to the send queue of the queue pair associated with the rdma_cm_id. and then the contents of the posted buffers get sent to the remote peer of a connection. boom. message delivered. main character energy fr fr. πŸ’«


🫢 RETURN VALUE 🫢

  • Returns 0 on success. slay. βœ…
  • Returns -1 on error. not slay. 😭

and if an error happens, errno will be set to indicate the failure reason. always check your errno, bestie, it's literally telling you what went wrong. πŸ”


πŸ”₯ NOTES πŸ”₯

okay this part is important, don't skip it, i'm serious. πŸ™ˆ

the user is responsible for ensuring that the remote peer has queued a receive request before issuing the send operations. like, they gotta be ready to catch it, you can't just throw. 🀲

for a list of supported flags, see ibv_post_send.

unless the send request is using inline data, the message buffers must have been registered before being posted, and the buffers must remain registered until the send completes. no cap β€” registration is not optional here. πŸ”’

send operations may not be posted to an rdma_cm_id or the corresponding queue pair until it has been connected. so like... connect first. obviously. πŸ’€

the user-defined context associated with the send request will be returned to the user through the work completion wr_id, work request identifier, field. see? i TOLD you your lil context stamp comes back. iconic behavior. 🎁


🌈 SEE ALSO 🌈


and that's the whole page, bestie!! this lil guy is from the librdmacm source, dated 2010-07-19 β€” an absolute vintage queen who's been serving sends since before some of us could walk. πŸ’œ go forth and post your work requests responsibly, mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from