RDMA_RESOLVE_ADDRINFO(3)

✨ RDMA_RESOLVE_ADDRINFO ✨

okay bestie, welcome to the Librdmacm Programmer's Manual, the chapter we're covering today is RDMA_RESOLVE_ADDRINFO, and it's giving "resolve RDMA addresses which supports both DNS and IB SA." πŸ¦‹ no cap, that's the whole vibe right there.


πŸ“œ SYNOPSIS

#include <rdma/rdma_cma.h>

int rdma_resolve_addrinfo(struct rdma_cm_id *id, const char *node, const
char *service, const struct rdma_addrinfo *hints);

πŸŽ€ ARGUMENTS

  • id β€” the RDMA identifier, periodt. it's your lil handle for this whole operation πŸ’…
  • node β€” optional!! it's the name, the dotted-decimal IPv4, or the IPv6 hex address you want resolved 🌈
  • service β€” the service name or the port number of the address πŸ“
  • hints β€” a reference to an rdma_addrinfo structure stuffed full of hints about the type of service the caller supports πŸ‘‘

πŸ’– DESCRIPTION

so this call submits an asynchronous address resolution request β€” it literally goes "hey, figure this out, but don't make me wait" πŸ’«

the behavior is similar to rdma_getaddrinfo(), except that the operation is asynchronous, and it generates an event on the RDMA CM event channel that is associated with the specified rdma_cm_id when it's complete. the %node, %service, and %hints parameters are defined similarly to rdma_getaddrinfo(). iykyk 🌸


πŸ”₯ RETURN VALUE

  • returns 0 on success πŸŽ‰ and success here means asynchronous address resolution was initiated β€” like, the request went out, bestie, we're cooking. the result of the resolution, whether successful or failed, will be reported as an event on the related event channel. so don't celebrate OR panic until that event shows up, okay?
  • returns -1 on error 😭 and errno will be set to indicate the failure reason. in this case the address resolution was not started, and no event will be generated on the event channel. it's giving nothing happened, it's giving silence πŸ’€
πŸ’€ important distinction: success = "we started it", not "we finished it." two totally different things. don't @ me.

🧚 NOTES 🧚

this call supports both DNS and IB SA resolution, and which one you get depends on the hints.ai_flags:

  • RAI_DNS: performs address resolution using DNS 🌐
  • RAI_SA: performs address resolution using the Infiniband SA. the rdma_cm_id associated with the call must be bound to an Infiniband port, or an error will occur πŸ™ˆ. the %node parameter must be null (it's just... not supported, sorry babe), and %Service should be an IB service name or ID 🫢

these 2 flags are mutual-exclusive β€” pick one, you can't have both, it's not that kind of party. if none of them is set then DNS is the default ⭐

the cm event RDMA_CM_EVENT_ADDRINFO_RESOLVED (on success) or RDMA_CM_EVENT_ADDRINFO_ERROR (on failure) is generated πŸ””


πŸ‘‘ SEE ALSO


πŸ’œ AUTHOR

Mark Zhang <<markzhang@nvidia.com>>


and that's the whole page, babe πŸŽ€ this cutie came to you straight from the Librdmacm Programmer's Manual, dated 2025-02-06, filed under RDMA_RESOLVE_ADDRINFO(3). slay, go resolve some addresses, and remember: the event channel will tell you how it went πŸ’…βœ¨

πŸ“¦ where this page comes from