rpma_send_with_imm(3)
π 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 secondRPMA_E_INVALis the sneaky one. ifsrcisNULL, thenoffsetandlenhave to be0, 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
- ubuntu noble: librpma-dev 1.3.0-2build2 Β· BSD-3
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms