rpma_write(3)
β¨ rpma_write β bestie edition β¨
okay so you're here for rpma_write(3) from the RPMA Programmer's Manual and honestly? you came to the right place π this is the one that makes your local memory yeet itself over to the remote side. let's get into it.
πΈ NAME πΈ
rpma_write β initiate the write operation
like, it starts the whole thing. it's giving main character energy for your data transfer π¦
β SYNOPSIS β
#include <librpma.h>
struct rpma_conn;
struct rpma_mr_local;
struct rpma_mr_remote;
int rpma_write(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, const void *op_context);
π DESCRIPTION π
so rpma_write() initiates transferring data from the local memory to the remote memory. that's it, that's the whole vibe β¨
and listen β to write a 0 bytes message, set src and dst to NULL and src_offset, dst_offset and len to 0. yes bestie, a zero-byte message is a real thing, it's valid, it's iconic, we respect it π
the attribute flags set the completion notification indicator, which is basically "when do you wanna hear back from me":
RPMA_F_COMPLETION_ON_ERRORβ generate the completion on errorRPMA_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 (that's a struct ibv_wc btw) so you can tell which operation just finished. it's like a little name tag for your write π·οΈ
π RETURN VALUE π
rpma_write() returns 0 on success or a negative error code on failure. no cap. if you see a negative number, something went sideways π
π₯ ERRORS π₯
rpma_write() can fail with the following errors, and honestly she's dramatic about it:
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
ngl those first three are all about not mixing NULL pointers with nonzero offsets/lengths, so like... read them carefully before you come for me π
π SEE ALSO π
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 bestie, slay π β¨π¦
this was brought to you by the RPMA crew, dated 01 April 2024, and yeah the date is real, not a prank, iykyk πππΈ
π¦ 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