rpma_send_with_imm(3)

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

πŸ’– rpma_send_with_imm β€” RPMA Programmer's Manual πŸ’–

okay bestie, pull up a chair, we're doing librpma today and this one is genuinely so fun. it's rpma_send_with_imm(3), and no, the manual name isn't a typo, it's literally the function name, slay. ✨


🌸 NAME 🌸

rpma_send_with_imm β€” initiate the send operation with immediate data 🫢


✨ SYNOPSIS ✨

#include <librpma.h>

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

like, look at that signature. it's giving main character energy and we love her for it. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so rpma_send_with_imm() kicks off the send operation with immediate data, which means it transfers a message from your local memory over to the other side of the connection. sending a lil message across the wire. iconic behavior honestly. 🌈

now here's a cute edge case: if you wanna send a 0 byte message, set src to NULL and set both offset and len to 0. yes, both. not one. both. πŸŽ€

the flags attribute is what sets the completion notification indicator, and you get to pick:

  • RPMA_F_COMPLETION_ON_ERROR β€” generate the completion on error (aka only ping me when things go sideways 😭)
  • RPMA_F_COMPLETION_ALWAYS β€” generate the completion regardless of result of the operation (aka ping me no matter what, I wanna know everything πŸ‘‘)

and op_context? that little baby gets returned in the wr_id field of the completion (struct ibv_wc). so you can pass whatever you want through and it comes right back to you. it's giving boomerang. πŸͺƒβœ¨


πŸ’œ RETURN VALUE πŸ’œ

rpma_send_with_imm() returns 0 on success, or a negative error code on failure. no in-between, no drama. πŸ’€


🌺 ERRORS 🌺

rpma_send_with_imm() can fail with the following errors, and ngl you will meet some of these:

  • RPMA_E_INVAL β€” conn == NULL || flags == 0 (you forgot the conn or you passed no flags at all, bestie 😭)
  • RPMA_E_INVAL β€” src == NULL && (offset != 0 || len != 0) (you said "empty message" but then gave me an offset or a len, pick a lane πŸ™ˆ)
  • RPMA_E_PROVIDER β€” ibv_post_send(3) failed (not us, the provider underneath, fr fr)

πŸŽ€ SEE ALSO πŸŽ€

rpma_conn_req_connect(3), rpma_mr_reg(3), librpma(7) and https://pmem.io/rpma/


reminder bestie: that second RPMA_E_INVAL is the sneaky one. if src is NULL, then offset and len have to be 0, or she's gonna yell at you. 🫢

okay that's the whole page, you ate that. this has been the RPMA manual, 01 April 2024 edition, brought to you by the RPMA Programmer's Manual β€” go forth and send with immediate data, periodt. πŸ’…πŸŒΈβœ¨

πŸ“¦ where this page comes from