rpma_flush(3)

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

✨ rpma_flush β€” initiate the flush operation ✨

okay bestie, welcome to the RPMA Programmer's Manual, page rpma_flush(3) πŸ’– this one is short and sweet and honestly kinda iconic β€” it's the "okay we're DONE, push it through" of memory transfers. let's go 🫢


🌸 SYNOPSIS 🌸

#include <librpma.h>

struct rpma_conn;
struct rpma_mr_remote;
enum rpma_flush_type {
        RPMA_FLUSH_TYPE_PERSISTENT,
        RPMA_FLUSH_TYPE_VISIBILITY,
};

int rpma_flush(struct rpma_conn *conn,
                struct rpma_mr_remote *dst, size_t dst_offset,
                size_t len, enum rpma_flush_type type, int flags,
                const void *op_context);

πŸ’… DESCRIPTION πŸ’…

rpma_flush() initiates the flush operation β€” and what that means is you're finalizing a transfer of data to the remote memory. like, the data is out there, and now we make it official. periodt.

so there are possible types of rpma_flush() operation, and you gotta pick one:

  • RPMA_FLUSH_TYPE_PERSISTENT β€” flush data down to the persistent domain 🌈 (yes, all the way down, no half measures)
  • RPMA_FLUSH_TYPE_VISIBILITY β€” flush data deep enough to make it visible on the remote node πŸ‘€ (visible, not necessarily persisted β€” know the difference, iykyk)

then the attribute flags sets 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? that lil baby gets returned in the wr_id field of the completion (struct ibv_wc). so you can match up your callback with your vibe. πŸ’«


⭐ RETURN VALUE ⭐

the rpma_flush() function returns 0 on success or a negative error code on failure. no cap.


😭 ERRORS 😭

rpma_flush() can fail with the following errors β€” screenshot this, bestie:

  • RPMA_E_INVAL β€” conn or dst is NULL
  • RPMA_E_INVAL β€” unknown type value
  • RPMA_E_INVAL β€” flags are not set
  • RPMA_E_PROVIDER β€” ibv_post_send(3) failed
  • RPMA_E_NOSUPP β€” type is RPMA_FLUSH_TYPE_PERSISTENT and the direct write to pmem is not supported
not me getting RPMA_E_NOSUPP because persistent just isn't on the menu for this setup πŸ’€ check your pmem support before you commit, fr fr.

πŸ¦‹ SEE ALSO πŸ¦‹


and that's the whole page, angel πŸ’– this was the RPMA manual, dated 01 April 2024 β€” go forth and flush responsibly, you absolute main character πŸ‘‘πŸŽ€

πŸ“¦ where this page comes from