rpma_atomic_write(3)

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

πŸ’– rpma_atomic_write(3) πŸ’–

okay bestie, so this is from the RPMA Programmer's Manual and it's literally the whole tea on rpma_atomic_write β€” one function, eight little bytes, maximum drama. sit down, hydrate, let's go ✨


🌸 NAME 🌸

rpma_atomic_write β€” initiate the atomic 8 bytes write operation

like. it writes 8 bytes. atomically. that's the vibe. periodt πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

#include <librpma.h>

struct rpma_conn;
struct rpma_mr_remote;
int rpma_atomic_write(struct rpma_conn *conn,
                struct rpma_mr_remote *dst, size_t dst_offset,
                const char src[8], int flags, const void *op_context);

she's giving forward declarations and one very specific little signature πŸ¦‹ no cap, copy it exactly.


✨ DESCRIPTION ✨

so rpma_atomic_write() initiates the atomic 8 bytes write operation β€” that's moving data from the local memory over to the remote memory. and the way this one works? it transfers exactly 8 bytes of data and stores them atomically in the remote memory. not 7, not 9. eight. iconic behaviour honestly πŸ”₯

the attribute flags set the completion notification indicator:

  • 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? she gets returned in the wr_id field of the completion (which is a struct ibv_wc). so you hand her something cute, and she hands it right back through the completion. we love a round trip πŸ’–


πŸ‘‘ RETURN VALUE πŸ‘‘

rpma_atomic_write() returns 0 on success or a negative error code on failure. simple as that, bestie.


πŸ’€ ERRORS πŸ’€

rpma_atomic_write() can fail with the following errors:

  • RPMA_E_INVAL β€” conn, dst or src is NULL
  • RPMA_E_INVAL β€” dst_offset is not aligned to 8 bytes
  • RPMA_E_INVAL β€” flags are not set (flags == 0)
  • RPMA_E_PROVIDER β€” ibv_post_send(3) failed
okay so real talk, the alignment one is not a suggestion. dst_offset has to be aligned to 8 bytes or she WILL hit you with RPMA_E_INVAL. no flagging, no half-vibes, no flags == 0. got it? got it 🫢

🌈 SEE ALSO 🌈


and that's the whole page, bestie ✨ this one's from RPMA, dated 01 April 2024, and it lives at rpma_atomic_write(3) β€” go forth and write exactly 8 bytes, atomically, like the main character you are πŸ’œπŸ§šπŸŒΈ

πŸ“¦ where this page comes from