rpma_utils...bv_context(3)

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

πŸ’– rpma_utils_get_ibv_context(3) πŸ’–

okay bestie, sit DOWN, because we're reading a page from the RPMA Programmer's Manual and it's genuinely giving "I know a guy who knows a device" energy πŸ¦‹


✨ NAME ✨

rpma_utils_get_ibv_context β€” obtain an RDMA device context by IP address πŸ‘‘


🌸 SYNOPSIS 🌸

#include <librpma.h>

struct ibv_context;
enum rpma_util_ibv_context_type {
        RPMA_UTIL_IBV_CONTEXT_LOCAL,
        RPMA_UTIL_IBV_CONTEXT_REMOTE
};

int rpma_utils_get_ibv_context(const char *addr, enum rpma_util_ibv_context_type type,
        struct ibv_context **ibv_ctx_ptr);

like, that's the whole vibe right there πŸ’…


🧚 DESCRIPTION 🧚

so rpma_utils_get_ibv_context() is the girl who finds you a device πŸŽ€ You hand her an IPv4/IPv6 address (could be a local one, could be a remote one) and she goes and obtains an RDMA device context for you using the TCP RDMA port space (RDMA_PS_TCP) β€” which, for the record, is reliable, connection-oriented and message-based QP communication. iconic behavior fr fr ✨

and the type argument? she's got options, and here's what they mean:

  • RPMA_UTIL_IBV_CONTEXT_LOCAL β€” lookup for a device based on the given local address 🏠
  • RPMA_UTIL_IBV_CONTEXT_REMOTE β€” lookup for a device based on the given remote address 🌍

πŸ’« RETURN VALUE πŸ’«

rpma_utils_get_ibv_context() returns 0 on success, or a negative error code on failure 😭 And listen β€” on failure she does not set the *ibv_ctx_ptr value. not even a little. she's not gonna leave you a mystery pointer, she just doesn't touch it. respect πŸ™ˆ


πŸ’€ ERRORS πŸ’€

when things go wrong (and bestie, sometimes they do), rpma_utils_get_ibv_context() can fail with these:

  • RPMA_E_INVAL β€” addr or ibv_ctx_ptr is NULL, or type is unknown πŸ‘Ž
  • RPMA_E_NOMEM β€” out of memory 🫠
  • RPMA_E_PROVIDER β€” rdma_getaddrinfo(), rdma_create_id(), rdma_bind_addr() or rdma_resolve_addr() failed. the exact cause of the error can be read from the log πŸ”
ngl if you're seeing RPMA_E_PROVIDER, go read the log. the log knows. the log always knows. πŸ‘€

🌈 SEE ALSO 🌈

rpma_peer_new(3), rpma_utils_ibv_context_is_odp_capable(3), librpma(7) and https://pmem.io/rpma/ 🫢


and that's the page, babe πŸ’œ tysm for reading, this was RPMA Programmer's Manual, dated 01 April 2024, mwah, slay, periodt πŸŽ€βœ¨πŸ‘‘

πŸ“¦ where this page comes from