rpma_read(3)

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

✨ rpma_read β€” bestie, we're pulling data FROM the remote ✨

okay so first things first, this is page rpma_read(3) from the RPMA Programmer's Manual, and it's literally the glow-up you need for moving bytes from their memory into yours. no cap. 🫢


πŸ“– NAME

rpma_read β€” initiate the read operation πŸ’…


🧚 SYNOPSIS

#include <librpma.h>

struct rpma_conn;
struct rpma_mr_local;
struct rpma_mr_remote;
int rpma_read(struct rpma_conn *conn,
                struct rpma_mr_local *dst, size_t dst_offset,
                const struct rpma_mr_remote *src, size_t src_offset,
                size_t len, int flags, const void *op_context);

🌸 DESCRIPTION

rpma_read() kicks off the transfer of data from the remote memory into the local memory. it's giving main character energy for your whole data pipeline, fr fr. ✨

and listen β€” if you wanna read a 0 bytes message (yes, the vibes-only message, the empty inbox era πŸ’€), you set src and dst to NULL and src_offset, dst_offset and len to 0. that's the whole move.

now, the flags attribute sets your completion notification indicator, i.e. when do you actually get told what happened:

  • RPMA_F_COMPLETION_ON_ERROR β€” generate the completion on error. so like, only hit me up if something went wrong 😭
  • RPMA_F_COMPLETION_ALWAYS β€” generate the completion regardless of result of the operation. the "text me either way, bestie" option 🫢

and op_context? that gets returned in the wr_id field of the completion (struct ibv_wc). so you can be like "oh that's my girl" when it comes back. πŸ‘‘


πŸ’– RETURN VALUE

rpma_read() returns 0 on success or a negative error code on failure. slay when it's 0, and when it's negative… we regroup. 🌈


πŸ’€ ERRORS

rpma_read() can fail with the following errors, and honestly each one is a little vibe check:

  • RPMA_E_INVAL β€” conn == NULL || flags == 0. yeah so no connection or no flags at all, that's a no from me.
  • RPMA_E_INVAL β€” dst == NULL && (src != NULL || src_offset != 0 || dst_offset != 0 || len != 0). you left dst empty but brought all the other luggage? pick a lane. πŸ™ˆ
  • RPMA_E_INVAL β€” src == NULL && (dst != NULL || src_offset != 0 || dst_offset != 0 || len != 0). same energy, mirrored: no src but everything else is packed. iconic, but wrong.
  • RPMA_E_PROVIDER β€” ibv_post_send(3) failed. the provider said no, and we respect it, but also 😭

πŸ”₯ SEE ALSO

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

go read those next, iykyk πŸ¦‹


okay that's the whole page, bestie!! this was the RPMA manual, dated 01 April 2024, and this specific icon is rpma_read(3) β€” now go initiate that read operation and be the main character of your own memory transfers πŸ’œβœ¨πŸŽ€

πŸ“¦ where this page comes from