RDMA_GETADDRINFO(3)
β¨ RDMA_GETADDRINFO β¨
okay so bestie, you know how getaddrinfo exists and it's giving "figure out where I'm actually going"? This is that, but for RDMA. Welcome to the librdmacm Programmer's Manual corner of the world, page RDMA_GETADDRINFO(3). Buckle up. π¦
NAME π
rdma_getaddrinfo β Provides transport independent address translation.
literally the glow-up of address resolution. no cap.
SYNOPSIS π
#include <rdma/rdma_cma.h>
int rdma_getaddrinfo (const char *node, const char *service, const
struct rdma_addrinfo *hints, struct rdma_addrinfo **res);
ARGUMENTS π«Ά
nodeβ Optional, bestie. It's a name, a dotted-decimal IPv4 address, or an IPv6 hex address that you want resolved. Or just leave it out, she's flexible. πserviceβ The service name or the port number of the address. yes queen.hintsβ A reference to anrdma_addrinfostructure stuffed full of hints about the kind of service the caller supports. it's giving "here's what I'm into". β¨resβ A pointer to a linked list ofrdma_addrinfostructures holding the response information. the answer key, if you will. π
DESCRIPTION πΈ
Resolves the destination node and service address and returns the information you need to establish communication. It's the RDMA functional equivalent of getaddrinfo β same energy, more fabric. π₯
RETURN VALUE β
Returns 0 on success, or -1 on error (errno will be set to indicate the failure reason), or one of the following nonzero error codes:
EAI_ADDRFAMILYβ The specified network host does not have any network addresses in the requested address family. not a single one. πEAI_AGAINβ The name server returned a temporary failure indication. Try again later, babe, it's just not the moment.EAI_BADFLAGSβhints.ai_flagscontains invalid flags. bestie what did you even type. πEAI_FAILβ The name server returned a permanent failure indication. that's not a "later" situation, that's a forever situation.EAI_FAMILYβ The requested address family is not supported. we do not do that family here.EAI_MEMORYβ Out of memory. πEAI_NODATAβ The specified network host exists, but does not have any network addresses defined. she's real but she's empty.EAI_NONAMEβ The node or service is not known; or bothnodeandserviceareNULL.EAI_SERVICEβ The requested service is not available for the requested QP type. It may be available through another QP type. don't give up, just switch it up. πEAI_QPTYPEβ The requested socket type is not supported. This could occur, for example, ifhints.ai_qptypeandhints.ai_port_spaceare inconsistent (e.g.,IBV_QPT_UDandRDMA_PS_TCP, respectively). yeah those two are NOT matching energies.EAI_SYSTEMβ Other system error, checkerrnofor details. Thegai_strerror()function translates these error codes to a human readable string, suitable for error reporting. shoutoutgai_strerror(), the translator we all need. π«Ά
NOTES π§
Either node, service, or hints must be provided. Like, at least one of them. pick a lane. π
If hints are provided, the operation will be controlled by hints.ai_flags.
If RAI_PASSIVE is specified, the call will resolve address information for use on the passive side of a connection.
If node is provided, rdma_getaddrinfo will attempt to resolve the RDMA address, route, and connection data to the given node.
The hints parameter, if provided, may be used to control the resulting output as indicated below.
If node is not given, rdma_getaddrinfo will attempt to resolve the RDMA addressing information based on the hints.ai_src_addr, hints.ai_dst_addr, or hints.ai_route.
rdma_addrinfo π
the main character struct herself. here's every field, no skipping:
ai_flagsβ Hint flags that control the operation. Supported flags are:RAI_PASSIVEβ Indicates that the results will be used on the passive/listening side of a connection.RAI_NUMERICHOSTβ If specified, then thenodeparameter, if provided, must be a numerical network address. This flag suppresses any lengthy address resolution. no long waits, we're going straight to the digits. β¨RAI_NOROUTEβ If set, this flag suppresses any lengthy route resolution.RAI_FAMILYβ If set, theai_familysetting should be used as an input hint for interpretting thenodeparameter.RAI_DNSβ Indicates that address resolution should use DNS to map the node and service names to addresses. Flag is mutually exclusive withRAI_SA. DNS resolution is the default option. (yes, the typo "interpretting" is canon, we don't touch it π )RAI_SAβ Indicates that address resolution should query the Infiniband SA to map node and service names to addresses. Flag is mutually exclusive withRAI_DNS. SA resolution only applies to Infiniband ports. Non-Infiniband ports will be skipped.
ai_familyβ Address family for the source and destination address. Supported families are:AF_INET,AF_INET6, andAF_IB.ai_qp_typeβ Indicates the type of RDMA QP used for communication. Supported types are:IBV_QPT_UD(unreliable datagram) andIBV_QPT_RC(reliable connected).ai_port_spaceβ RDMA port space in use. Supported values are:RDMA_PS_UDP,RDMA_PS_TCP, andRDMA_PS_IB.ai_src_lenβ The length of the source address referenced byai_src_addr. This will be0if an appropriate source address could not be discovered for a given destination.ai_dst_lenβ The length of the destination address referenced byai_dst_addr. This will be0if theRAI_PASSIVEflag was specified as part of the hints.ai_src_addrβ If provided, the address for the local RDMA device.ai_dst_addrβ If provided, the address for the destination RDMA device.ai_src_canonnameβ The canonical for the source.ai_dst_canonnameβ The canonical for the destination.ai_route_lenβ Size of the routing information buffer referenced byai_route. This will be0if the underlying transport does not require routing data, or none could be resolved.ai_routeβ Routing information for RDMA transports that require routing data as part of connection establishment. The format of the routing data depends on the underlying transport. If Infiniband transports are used,ai_routewill reference an array ofstruct ibv_path_dataon output, if routing data is available. Routing paths may be restricted by setting desired routing data fields on input tordma_getaddrinfo. For Infiniband,hints.ai_routemay reference an array ofstruct ibv_path_recordorstruct ibv_path_dataon input.ai_connect_lenβ Size of connection information referenced byai_connect. This will be0if the underlying transport does not require additional connection information.ai_connectβ Data exchanged as part of the connection establishment process. If provided,ai_connectdata must be transferred as private data, with any user supplied private data following it.ai_nextβ Pointer to the nextrdma_addrinfostructure in the list. Will beNULLif no more structures exist. the end of the thread, bestie. π
SEE ALSO π¦
rdma_create_id(3)rdma_resolve_route(3)rdma_connect(3)rdma_create_qp(3)rdma_bind_addr(3)rdma_create_ep(3)rdma_freeaddrinfo(3)rdma_resolve_addrinfo(3)rdma_query_addrinfo(3)
go read those too, iykyk. π
and that's the whole page, periodt. this one came from librdmacm and it's dated 2010-07-19 β vintage but still iconic, lowkey. stay resolving, bestie. πβ¨π
π¦ where this page comes from
- alpine 3.24: rdma-core-doc 61.0-r0 Β· GPL-2.0-only OR BSD-2-Clause
- arch rolling: rdma-core 65.0-1 Β· GPL-2.0-or-later OR LicenseRef-OpenIB.org-BSD-MIT AND GPL-2.0-or-later OR LicenseRef-OpenIB.org-BSD-FreeBSD AND GPL-2.0-or-later OR LicenseRef-Intel-BSD-3-Clause AND GPL-2.0-or-later OR LicenseRef-PathScale-BSD-Patent-License AND CC0-1.0 AND MIT AND BSD-2-Clause AND CPL-1.0 OR BSD-2-Clause OR GPL-2.0-or-later
- centos-stream 10: rdma-core-devel 62.0-3.el10 Β· GPLv2 or BSD
- centos-stream 9: rdma-core-devel 61.0-3.el9 Β· GPLv2 or BSD
- centos-stream 9: rdma-core-devel 61.0-3.el9 Β· GPLv2 or BSD
- fedora 44: rdma-core-devel 61.0-2.fc44 Β· GPL-2.0-only OR BSD-2-Clause AND BSD-3-Clause
- fedora 44: rdma-core-devel 61.0-2.fc44 Β· GPL-2.0-only OR BSD-2-Clause AND BSD-3-Clause
- fedora 44: rdma-core-devel 61.1^20260812git975bdaf-1.fc44 Β· GPL-2.0-only OR BSD-2-Clause AND BSD-3-Clause
- fedora 44: rdma-core-devel 61.1^20260812git975bdaf-1.fc44 Β· GPL-2.0-only OR BSD-2-Clause AND BSD-3-Clause
- nixos 26.05: rdma-core 62.0
- nixpkgs unstable: rdma-core 65.0
- ubuntu resolute: librdmacm-dev 61.0-2ubuntu3 Β· BSD-MIT OR GPL-2.0-only
- ubuntu stonking: librdmacm-dev 64.0-1ubuntu1 Β· BSD-MIT OR GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms