rpma_send(3)

πŸ“¦
version 1.3.0 Β· 3 versions
, in ubuntu noble

πŸ’– NAME πŸ’–

rpma_send β€” initiate the send operation

Ok so bestie, this one lives in the RPMA Programmer's Manual and it's literally the ✨send✨ of the whole show. Let's get into it 🫢


✨ SYNOPSIS ✨

#include <librpma.h>

struct rpma_conn;
struct rpma_mr_local;
int rpma_send(struct rpma_conn *conn, const struct rpma_mr_local *src, size_t offset,
                size_t len, int flags, const void *op_context);

πŸ¦‹ DESCRIPTION πŸ¦‹

So rpma_send() initiates the send operation, which transfers a message from the local memory over to the other side of the connection. That's the whole vibe. πŸ’…

Wanna send a 0 byte message? Totally valid, iconic even. Just set src to NULL and set both offset and len to 0. That's the move. πŸŽ€

The attribute flags set the completion notification indicator, and you've got two options here:

  • RPMA_F_COMPLETION_ON_ERROR β€” generate the completion on error πŸ‘€
  • RPMA_F_COMPLETION_ALWAYS β€” generate the completion regardless of result of the operation. no cap, always means always πŸ”₯

And op_context? That comes back to you in the wr_id field of the completion (that's the struct ibv_wc bestie, you'll see it again i promise). 🌸


🫢 RETURN VALUE 🫢

rpma_send() returns 0 on success, or a negative error code on failure. slay if it's the first one, 😭 if it's the second.


πŸ’€ ERRORS πŸ’€

rpma_send() can fail with the following errors, and no we're not being dramatic, these are real:

  • RPMA_E_INVAL β€” conn == NULL || flags == 0
  • RPMA_E_INVAL β€” src == NULL && (offset != 0 || len != 0)
  • RPMA_E_PROVIDER β€” ibv_post_send(3) failed
Not me checking the || vs && in those conditions like three times. Read them carefully bestie, the second one is giving "if you're sending nothing, then offset AND len have to actually be nothing too". πŸŽ€

🌈 SEE ALSO 🌈


fr fr that's the whole page, you ate it, go forth and send messages responsibly 🧚

This one's from the RPMA manual set, dated 01 April 2024. bye bestie πŸ’–

πŸ“¦ where this page comes from