RDMA_POST_SEND(3)

πŸ’Œ rdma_post_send β€” post a work request to send a message

okay bestie, so this one lives in the Librdmacm Programmer's Manual, and it's literally the "hey send this buffer to my friend over there" function. it's giving mail carrier but for RDMA. let's get into it 🫢


✨ SYNOPSIS ✨

#include <rdma/rdma_verbs.h>

int rdma_post_send (struct rdma_cm_id *id, void *context, void *addr,
size_t length, struct ibv_mr *mr, int flags);

🌸 ARGUMENTS 🌸

  • id β€” a reference to a communication identifier where the message buffer will be posted. like, this is the connection we're sending on, bestie.
  • context β€” user-defined context associated with the request. it's your little "this is mine" sticky note that comes back to you later πŸ‘‘
  • addr β€” the address of the memory buffer to post. where your data actually lives.
  • length β€” the length of the memory buffer. how much of it we're sending, no more no less.
  • mr β€” optional registered memory region associated with the posted buffer. optional but like… usually not optional, yk? πŸ™ˆ
  • flags β€” optional flags used to control the send operation. the seasoning ✨

πŸ’… DESCRIPTION πŸ’…

Posts a work request to the send queue of the queue pair associated with the rdma_cm_id. the contents of the posted buffer will be sent to the remote peer of a connection. that's it. that's the whole vibe. you hand it a buffer, it yeets it to the other side 🌈


⭐ 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 fr fr, don't just stare at the -1 like it owes you money 😭


πŸŽ€ NOTES πŸŽ€

bestie. read this part. this is the part that bites people.
  • The user is responsible for ensuring that the remote peer has queued a receive request before issuing the send operations. like, you have to make sure they're ready to catch it. no receive request = your send is just screaming into the void πŸ’€
  • For a list of supported flags, see ibv_post_send.
  • Unless the send request is using inline data, the message buffer must have been registered before being posted, with the mr parameter referencing the registration. The buffer must remain registered until the send completes. registered and still registered while it's in flight, okay? don't unregister early, that's not cute πŸ™ˆ
  • Send operations may not be posted to an rdma_cm_id or the corresponding queue pair until it has been connected. not connected = not allowed. periodt.
  • 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. so that context you passed in? it comes back to you at completion time. full circle moment πŸ’–

πŸ¦‹ SEE ALSO πŸ¦‹


and that's the page, bestie! πŸŽ€ this one's from librdmacm, dated 2010-07-19 β€” yeah she's an elder but she ate and left no crumbs πŸ‘‘πŸ’… go forth and post responsibly πŸ’œ

πŸ“¦ where this page comes from