rpma_write_with_imm(3)
π rpma_write_with_imm β RPMA Programmer's Manual, section 3 π
okay bestie, gather round, because this one is lowkey iconic and you're gonna want it in your notes. it's rpma_write_with_imm(3), it lives in the RPMA Programmer's Manual, and it's about to be your new fave π«Ά
β¨ NAME β¨
rpma_write_with_imm β initiate the write operation with immediate data
like. it writes. and there's immediate data. the name ate, honestly. π
πΈ SYNOPSIS πΈ
#include <librpma.h>
struct rpma_conn;
struct rpma_mr_local;
struct rpma_mr_remote;
int rpma_write_with_imm(struct rpma_conn *conn,
struct rpma_mr_remote *dst, size_t dst_offset,
const struct rpma_mr_local *src, size_t src_offset,
size_t len, int flags, uint32_t imm,
const void *op_context);
yes bestie, that's a lot of parameters. she's high maintenance but she delivers β¨
π¦ DESCRIPTION π¦
so rpma_write_with_imm() initiates the write operation with immediate data β which is the fancy way of saying it transfers data from the local memory to the remote memory. main character energy fr fr. π
and here's the cute lil trick: if you wanna write a 0 bytes message, you set src and dst to NULL and src_offset, dst_offset and len to 0. that's it. that's the whole vibe check. β
π« the flags situation
the attribute flags sets the completion notification indicator, and you have exactly two options, so choose wisely:
RPMA_F_COMPLETION_ON_ERRORβ generate the completion on error πRPMA_F_COMPLETION_ALWAYSβ generate the completion regardless of result of the operation π
and op_context? it gets returned in the wr_id field of the completion (struct ibv_wc). so like, don't lose track of it, she comes back around π
π₯ RETURN VALUE π₯
rpma_write_with_imm() returns 0 on success or a negative error code on failure. no in-between, no gray area, she's decisive like that π
π ERRORS π
not me having to tell you the ways this can go wrong π but bestie, forewarned is forearmed. rpma_write_with_imm() can fail with the following errors:
RPMA_E_INVALβconn == NULL || flags == 0RPMA_E_INVALβdst == NULL && (src != NULL || src_offset != 0 || dst_offset != 0 || len != 0)RPMA_E_INVALβsrc == NULL && (dst != NULL || src_offset != 0 || dst_offset != 0 || len != 0)RPMA_E_PROVIDERβibv_post_send(3)failed
ok so real talk: thoseRPMA_E_INVALones are literally just "your arguments don't vibe together". eitherconnisNULL, orflagsis0, or you set one ofsrc/dsttoNULLwhile leaving the other side or the offsets orlendoing something. mixed signals = error, periodt. π
π SEE ALSO π
go be nosy, bestie, these are all connected:
rpma_conn_req_connect(3)rpma_mr_reg(3)rpma_mr_remote_from_descriptor(3)librpma(7)- and https://pmem.io/rpma/
and that's the whole page, you're officially educated π this lil masterpiece came out of the RPMA Programmer's Manual and it's dated 01 April 2024. go forth and write_with_imm responsibly, bestie π§β¨π
π¦ 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