rpma_utils...bv_context(3)
π 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βaddroribv_ctx_ptrisNULL, ortypeis unknown πRPMA_E_NOMEMβ out of memory π«RPMA_E_PROVIDERβrdma_getaddrinfo(),rdma_create_id(),rdma_bind_addr()orrdma_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
- ubuntu noble: librpma-dev 1.3.0-2build2 Β· BSD-3
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms