rpma_mr_re...descriptor(3)

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

πŸ’– rpma_mr_remote_from_descriptor β€” bestie edition πŸ’–

okay so this is a page from the RPMA Programmer's Manual, the rpma_mr_re...descriptor(3) one, and we're gonna make a remote memory region out of a descriptor. yes that's a lot of words. no i will not be normal about it. let's go πŸ¦‹


✨ NAME ✨

rpma_mr_remote_from_descriptor β€” create a memory region from a descriptor

like. the whole vibe is right there in the name bestie. it makes a memory region. from a descriptor. iconic behavior fr fr πŸ‘‘


🌸 SYNOPSIS 🌸

#include <librpma.h>

struct rpma_mr_remote;
int rpma_mr_remote_from_descriptor(const void *desc, size_t desc_size,
                struct rpma_mr_remote **mr_ptr);

look at her. three params, one return value, zero drama. slay πŸ’…


πŸŽ€ DESCRIPTION πŸŽ€

okay so here's the tea β˜• β€” rpma_mr_remote_from_descriptor() builds you a remote memory region's structure, and it does it based on the descriptor you hand it. and what is that descriptor? it's a network-transferable description of the memory region that's local to the remote peer. so basically the remote homie sends you a little postcard describing their memory region, and you turn that postcard into a whole usable structure. the way that works?? obsessed πŸ˜­πŸ’–


🚨 SECURITY WARNING 🚨

bestie. listen to me. do not skip this part. πŸ™ˆ

so an attacker might modify the serialized remote memory registration configuration while it's being transferred over an unsecured connection (think rdma_cm private data, that kinda thing). and if they do that? it might cause data corruption when writing to a different location. yeah. writing to the WRONG place. absolutely not. πŸ’€

so the move is: users should avoid using the rpma_conn_get_private_data(3) and rpma_conn_req_get_private_data(3) API calls, and instead they should utilize TLS/SSL connections to transfer all configuration data between peers. protect your data, protect your peace πŸ«ΆπŸ”’


πŸ’« RETURN VALUE πŸ’«

  • rpma_mr_remote_from_descriptor() returns 0 on success ✨ or a negative error code on failure 😭
  • and important bestie: on failure, rpma_mr_remote_from_descriptor() does not set the *mr_ptr value. so don't go reading it. it's giving nothing. leave it alone πŸ™…β€β™€οΈ

πŸ’… ERRORS πŸ’…

rpma_mr_remote_from_descriptor() can fail with the following errors:

  • RPMA_E_INVAL β€” desc or mr_ptr is NULL 🫠
  • RPMA_E_INVAL β€” incompatible descriptor size πŸ“
  • RPMA_E_NOSUPP β€” the deserialized information does not represent a valid memory region 🚫
  • RPMA_E_NOMEM β€” out of memory 😡

(yes RPMA_E_INVAL shows up twice, that's not a typo, that's just how it is. two different ways to be invalid. she contains multitudes πŸ’œ)


πŸ‘€ SEE ALSO πŸ‘€

go read these next, they're all part of the same friend group:


and that's the whole page bestie!! this one's from the RPMA manual, dated 01 April 2024, and it's literally the rpma_mr_re...descriptor(3) page. mwah. go build something cute with it πŸŽ€βœ¨πŸ¦‹πŸ’–

πŸ“¦ where this page comes from