rpma_mr_reg(3)

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

πŸ’– rpma_mr_reg β€” like, the memory registration page πŸ’–

okay bestie, welcome to rpma_mr_reg from the RPMA Programmer's Manual ✨ this is the one where you tell the system "hey, this chunk of memory? mine. register it, pls" πŸŽ€


✨ NAME ✨

rpma_mr_reg β€” create a local memory registration object πŸ¦‹


✨ SYNOPSIS ✨

#include <librpma.h>

struct rpma_peer;
struct rpma_mr_local;

int rpma_mr_reg(struct rpma_peer *peer, void *ptr, size_t size, int usage,
        struct rpma_mr_local **mr_ptr);

✨ DESCRIPTION ✨

so rpma_mr_reg() does the thing: it registers a memory region and creates a local memory registration object. periodt πŸ’…

the usage parameter is the moment where you say what operations are allowed on this memory region. and the way you say it? bitwise-inclusive OR of these icons right here πŸ‘‡

  • RPMA_MR_USAGE_READ_SRC β€” memory used as a source of the read operation
  • RPMA_MR_USAGE_READ_DST β€” memory used as a destination of the read operation
  • RPMA_MR_USAGE_WRITE_SRC β€” memory used as a source of the write operation
  • RPMA_MR_USAGE_WRITE_DST β€” memory used as a destination of the write operation
  • RPMA_MR_USAGE_FLUSH_TYPE_VISIBILITY β€” memory with available flush operation
  • RPMA_MR_USAGE_FLUSH_TYPE_PERSISTENT β€” memory with available persistent flush operation
  • RPMA_MR_USAGE_SEND β€” memory used for send operation
  • RPMA_MR_USAGE_RECV β€” memory used for receive operation

like, stack them up with OR and you're giving your memory its whole personality 🌈


✨ RETURN VALUE ✨

rpma_mr_reg() returns 0 on success, or a negative error code on failure. and listen β€” on failure it does NOT set the *mr_ptr value. not even a little. don't go reading it, bestie 😭


✨ ERRORS ✨

rpma_mr_reg() can fail with these, so know them, fr fr:

  • RPMA_E_INVAL β€” peer or ptr or mr_ptr is NULL
  • RPMA_E_INVAL β€” size equals 0
  • RPMA_E_NOMEM β€” out of memory
  • RPMA_E_PROVIDER β€” memory registration failed

✨ SEE ALSO ✨

go read these next, iykyk πŸ‘‘


lowkey reminder bestie: RPMA_E_INVAL shows up twice for a reason β€” NULL pointer stuff AND a size of 0 both get it. different crimes, same error πŸ’€

and that's the whole page, no cap 🫢 this was the RPMA manual, version dated 01 April 2024 β€” slay, go register some memory, you absolute main character πŸŒΈπŸ’–βœ¨

πŸ“¦ where this page comes from