fi_getinfo(3)
๐ fi_getinfo(3) ๐
okay so bestie, this is the Libfabric v2.5.1 manual page for fi_getinfo, fi_freeinfo, fi_allocinfo, and fi_dupinfo. We're talking fabric interface info, allocation, duplication, and freeing โ the whole lil ecosystem, no cap. ๐ฆ
โจ NAME โจ
fi_getinfo,fi_freeinfoโ obtain / free fabric interface information, periodt. ๐fi_allocinfo,fi_dupinfoโ allocate / duplicate anfi_infostructure, slay. ๐
๐ ๏ธ SYNOPSIS ๐ ๏ธ
#include <rdma/fabric.h>
int fi_getinfo(int version, const char *node, const char *service,
uint64_t flags, const struct fi_info *hints, struct fi_info **info);
void fi_freeinfo(struct fi_info *info);
struct fi_info *fi_allocinfo(void);
struct fi_info *fi_dupinfo(const struct fi_info *info);
๐ธ ARGUMENTS ๐ธ
versionโ the interface version your app is requesting. like, which version vibe are we on? ๐ซnodeโ optional, bestie: a name or fabric address to resolve. ๐งserviceโ optional: a service name or port number of the address. ๐flagsโ operation flags for thefi_getinfocall. ๐ฉhintsโ a reference to anfi_infostructure that specifies criteria for selecting the returned fabric information. Thefi_infohints structure must be allocated using eitherfi_allocinfo()orfi_dupinfo(). no random stack structs, okay? ๐infoโ a pointer to a linked list offi_infostructures containing response information. it's giving linked-list main character energy. ๐
๐ DESCRIPTION ๐
The fi_getinfo() call is your little discovery mission: it finds out what communication features are available in the system, and how your app might best use them. The call is loosely modeled on getaddrinfo(). fi_getinfo() lets your app and the libfabric providers exchange information about the exact set of communication your app needs. It's giving you access to complex network details while staying expressive and simple to use โ iconic balance, honestly. ๐
fi_getinfo returns information about available fabric services for reaching a specified node or service, subject to any provided hints. Callers may specify NULL for node, service, and hints to retrieve information about what providers are available and their optimal usage models. If no matching fabric information is available, info will be set to NULL and the call will return -FI_ENODATA. bestie, that's your "nothing matched, bestie" signal. ๐
Based on the input hints, node, and service parameters, a list of fabric domains and endpoints will be returned. Each fi_info structure will describe an endpoint that meets the application's specified communication criteria. Each endpoint will be associated with a domain. Applications can restrict the number of returned endpoints by including additional criteria in their search hints. Relaxing or eliminating input hints will increase the number and type of endpoints that are available. Providers that return multiple endpoints to a single fi_getinfo call should return the endpoints that are highest performing first. Providers may indicate that an endpoint and domain can support additional capabilities than those requested by the user only if such support will not adversely affect application performance or security. like, no sneaky side effects, please and thank you. โจ
The version parameter is used by the application to request the desired version of the interfaces. The version determines the format of all data structures used by any of the fabric interfaces. Applications should use the FI_VERSION(major, minor) macro to indicate the version, with hard-coded integer values for the major and minor values. The FI_MAJOR_VERSION and FI_MINOR_VERSION enum values defined in fabric.h specify the latest version of the installed library. However, it is recommended that the integer values for FI_MAJOR_VERSION and FI_MINOR_VERSION be used, rather than referencing the enum types in order to ensure compatibility with future versions of the library. This protects against the application being built from source against a newer version of the library that introduces new fields to data structures, which would not be initialized by the application. future-proofing era, we love to see it. ๐
node, service, or hints may be provided, with any combination being supported. If node is provided, fi_getinfo will attempt to resolve the fabric address to the given node. If node is not given, fi_getinfo will attempt to resolve the fabric addressing information based on the provided hints. node is commonly used to provide a network address (such as an IP address) or hostname. service is usually associated with a transport address (such as a TCP port number). node and service parameters may be mapped by providers to native fabric addresses. Applications may also pass in an FI_ADDR_STR formatted address (see format details below) as the node parameter. In such cases, the service parameter must be NULL. iykyk. ๐ซถ
The hints parameter, if provided, may be used to limit the resulting output as indicated below. As a general rule, specifying a non-zero value for input hints indicates that a provider must support the requested value or fail the operation with -FI_ENODATA. With the exception of mode bits, hints that are set to zero are treated as a wildcard. A zeroed hint value results in providers either returning a default value or a value that works best for their implementation. Mode bits that are set to zero indicate the application does not support any modes. so, zero mode bits = "no modes supported," not "surprise me." ๐
๐จ The caller must callfi_freeinfoto releasefi_infostructures returned by this call. do not ghost your allocated memory, bestie. ๐ญ
The fi_allocinfo call will allocate and zero an fi_info structure and all related substructures. The fi_dupinfo will duplicate a single fi_info structure and all the substructures within it. clean, zeroed, duplicated โ the whole glow-up. ๐
okay bestie, now the actual struct itself โ every field, in order, no skipping, we're reading the whole thing ๐
struct fi_info {
struct fi_info *next;
uint64_t caps;
uint64_t mode;
uint32_t addr_format;
size_t src_addrlen;
size_t dest_addrlen;
void *src_addr;
void *dest_addr;
fid_t handle;
struct fi_tx_attr *tx_attr;
struct fi_rx_attr *rx_attr;
struct fi_ep_attr *ep_attr;
struct fi_domain_attr *domain_attr;
struct fi_fabric_attr *fabric_attr;
struct fid_nic *nic;
};
nextโ pointer to the nextfi_infostructure in the list, bestie. It'sNULLwhen there are no more structures to vibe with. Periodt.capsโ fabric interface capabilities. If you set it, it's giving "these are the capabilities I desire" for the fabric interfaces โจ. The supported ones are listed down in the Capabilities section, iykyk.modeโ operational modes your application supports. Peep the Mode section below for the deets ๐ฅ.addr_formatโ address format. If specified, it tells you the format of the addresses that the fabric interfaces and data structures are referencing. Supported formats live in the Addressing formats section below, no cap ๐ .src_addrlenโ source address length, literally. It's the length of the source address. This value must be> 0ifsrc_addris non-NULL, okay? And heads up โ this field gets ignored in hints if theFI_SOURCEflag is set, or ifsrc_addrisNULL. ๐ซถdest_addrlenโ destination address length. Same energy: the value must be> 0ifdest_addris non-NULL. This field is ignored in hints unless the node and service parameters areNULLor theFI_SOURCEflag is set, or ifdst_addrisNULL. ๐src_addrโ source address. If you specify it, that's your source address. This field gets ignored in hints if theFI_SOURCEflag is set. On output, a provider shall return an address that corresponds to the indicated fabric, domain, node, and/or service fields ๐. The format of that address? That's what the returnedaddr_formatfield is telling you. Also important: any returned address is only used when opening a local endpoint โ it is not guaranteed to be usable by a peer process. So don't go handing it out like candy, ngl ๐.dest_addrโ destination address. If specified, that's the destination. This field is ignored in hints unless the node and service parameters areNULLor theFI_SOURCEflag is set. IfFI_SOURCEis not specified, then on output a provider shall return an address that corresponds to the indicated node and/or service fields, relative to the fabric and domain. And just like the source one โ any returned address is only usable locally ๐ฆ.handleโ provider context handle. This one is so operation specific, bestie. Ifhints->handleis set tostruct fid_pep, thenhints->handlegets copied toinfo->handleon output fromfi_getinfoโจ. Any other values ofhints->handleare handled in a provider specific manner. Thefi_info::handlefield is also used byfi_endpoint()andfi_reject()calls when processing connection requests, or to inherit another endpoint's attributes. Go seefi_eq(3),fi_reject(3), andfi_endpoint(3)for the lore ๐ . Oh, and theinfo->handlefield is straight up ignored byfi_dupinfoandfi_freeinfoโ like, not even looked at ๐ญ.tx_attrโ transmit context attributes, optionally supplied. These may be specified and returned as part offi_getinfo. When you provide them as hints, the requested values ofstruct fi_tx_ctx_attrshould be set. On output, the actual transmit context attributes that can be provided get returned โ and those output values will be greater than or equal to the requested input values. Slay ๐.rx_attrโ receive context attributes, optionally supplied. Also may be specified and returned as part offi_getinfo. When provided as hints, requested values ofstruct fi_rx_ctx_attrshould be set. On output, the actual receive context attributes that can be provided are returned, and output values will be greater than or equal to the requested input values ๐.ep_attrโ endpoint attributes, optionally supplied. May be specified and returned as part offi_getinfo. When provided as hints, requested values ofstruct fi_ep_attrshould be set. On output, the actual endpoint attributes that can be provided are returned โ output values greater than or equal to the requested input values. Seefi_endpoint(3)for the details ๐ธ.domain_attrโ domain attributes, optionally supplied. May be specified and returned as part offi_getinfo. When provided as hints, requested values ofstruct fi_domain_attrshould be set. On output, the actual domain attributes that can be provided are returned โ output values greater than or equal to requested input values. Seefi_domain(3)for more ๐.fabric_attrโ fabric attributes, optionally supplied. Same deal: may be specified and returned as part offi_getinfo. When provided as hints, requested values ofstruct fi_fabric_attrshould be set. On output, the actual fabric attributes that can be provided are returned. Seefi_fabric(3)for the tea โ.nicโ network interface details. These are optional attributes related to the hardware NIC associated with the specified fabric, domain, and endpoint data ๐ฆ. Heads up: this field is only valid for providers where the corresponding attributes are closely associated with a hardware NIC. Seefi_nic(3)for deets.
โจ CAPABILITIES โจ
okay so interface capabilities? you get them by OR-ing the following flags together. that's the whole vibe, no cap ๐ฅ
- If you hand over a
NULLhints structure, the underlying provider will return the set of capabilities which are supported. - If you provide a hints structure but the capabilities in it are set to
0, the underlying provider will only return the set of capabilities that the provider can support with the mode bits set by the application in the hints structure. - Otherwise โ if capabilities are specified with non-zero values โ providers will return data matching the set of capabilities you specified ๐ .
Providers may indicate support for additional capabilities beyond the ones you requested, but only when using those expanded capabilities will not adversely affect performance or expose your application to communication beyond what you asked for. Applications can use this little feature to request a minimal set of requirements, then check the returned capabilities to enable additional optimizations. It's giving "ask for the bare minimum, get a lil extra" โจ.
FI_ATOMICโ specifies that the endpoint supports some set of atomic operations. Endpoints supporting this capability support the operations defined bystruct fi_ops_atomic. In the absence of any relevant flags,FI_ATOMICimplies the ability to initiate and be the target of remote atomic reads and writes. Applications can use theFI_READ,FI_WRITE,FI_REMOTE_READ, andFI_REMOTE_WRITEflags to restrict the types of atomic operations supported by an endpoint ๐FI_AV_USER_IDโ requests that the provider support associating a user specified identifier with each address vector (AV) address. User identifiers get returned with completion data in place of the AV address. Seefi_domain(3)andfi_av(3)for more details ๐FI_COLLECTIVEโ requests support for collective operations. Endpoints that support this capability support the collective operations defined infi_collective(3)๐FI_DIRECTED_RECVโ requests that the communication endpoint use the source address of an incoming message when matching it with a receive buffer. If this capability is not set, then thesrc_addrparameter for msg and tagged receive operations is just ignored ๐FI_TAGGED_DIRECTED_RECVโ similar toFI_DIRECTED_RECV, but it only applies to tagged receive operations ๐FI_EXACT_DIRECTED_RECVโ also similar toFI_DIRECTED_RECV, but it requires the source address to be exact, i.e.FI_ADDR_UNSPECis not allowed. This capability can be used alone, or in conjunction withFI_DIRECTED_RECVorFI_TAGGED_DIRECTED_RECVas a modifier to disallowFI_ADDR_UNSPECbeing used as the source address ๐FI_FENCEโ indicates that the endpoint supports theFI_FENCEflag on data transfer operations. Support requires tracking that all previous transmit requests to a specified remote endpoint complete prior to initiating the fenced operation. Fenced operations are often used to enforce ordering between operations that are not otherwise guaranteed by the underlying provider or protocol ๐ฅFI_HMEMโ specifies that the endpoint should support transfers to and from device memory ๐FI_LOCAL_COMMโ indicates that the endpoint supports host local communication. This flag may be used in conjunction withFI_REMOTE_COMMto indicate that local and remote communication are required. If neitherFI_LOCAL_COMMnorFI_REMOTE_COMMare specified, then the provider will indicate support for the configuration that minimally affects performance. Providers that setFI_LOCAL_COMMbut notFI_REMOTE_COMMโ for example, a shared memory provider โ may only be used for communication between processes on the same system ๐ซถFI_MSGโ specifies that an endpoint should support sending and receiving messages or datagrams. Message capabilities imply support for send and/or receive queues. Endpoints supporting this capability support operations defined bystruct fi_ops_msgโจ
the caps field can also be used to specify or restrict the type of messaging operations that are supported. in the absence of any relevant flags, FI_MSG implies the ability to send and receive messages. applications can use the FI_SEND and FI_RECV flags to optimize an endpoint as send-only or receive-only ๐
FI_MULTICASTโ okay so this one says the endpoint supports multicast data transfers โจ. It has to be paired withFI_MSGโ no solo acts. Bestie bonus: apps can useFI_SENDandFI_RECVto optimize multicast as send-only or receive-only. Choose your vibe ๐FI_MULTI_RECVโ the endpoint must support theFI_MULTI_RECVflag when posting receive buffers. That's it, that's the whole flag ๐FI_TAGGED_MULTI_RECVโ same energy, but for tagged: the endpoint must support theFI_MULTI_RECVflag when posting tagged receive buffers ๐ฆFI_NAMED_RX_CTXโ asks that endpoints with multiple receive contexts let an initiator target (or name) a specific receive context as part of a data transfer operation. Very "I'm picking my seat" energy ๐FI_PEERโ the provider must support being used as a peer provider in the peer API flow ๐ซถ. Concretely: it must support importingowner_opswhen opening a CQ, counter, and shared receive queue.FI_READโ you're saying "I need an endpoint that can initiate reads against remote memory regions." This flag requires thatFI_RMAand/orFI_ATOMICbe set. No cap, read the fine print ๐FI_RECVโ you need an endpoint capable of receiving message data transfers ๐. Message transfers include base message operations as well as tagged message functionality. (Yes, both. Package deal.)FI_REMOTE_COMMโ the endpoint supports communication with endpoints located at remote nodes (across the fabric) ๐. SeeFI_LOCAL_COMMfor additional details. And here's the tea: providers that setFI_REMOTE_COMMbut notFI_LOCAL_COMMโ for example NICs that lack loopback support โ cannot be used to communicate with processes on the same system. Same machine, no chat. Tragic ๐FI_REMOTE_READโ you require an endpoint capable of receiving read memory operations from remote endpoints ๐ธ. Requires thatFI_RMAand/orFI_ATOMICbe set.FI_REMOTE_WRITEโ you require an endpoint capable of receiving write memory operations from remote endpoints ๐. Requires thatFI_RMAand/orFI_ATOMICbe set. (Yes, both of these require the same thing, they're twins, let them live.)FI_RMAโ the endpoint should support RMA read and write operations โจ. Endpoints supporting this capability support operations defined bystruct fi_ops_rma. In the absence of any relevant flags,FI_RMAimplies the ability to initiate and be the target of remote memory reads and writes. Want to narrow it down? Applications can use theFI_READ,FI_WRITE,FI_REMOTE_READ, andFI_REMOTE_WRITEflags to restrict the types of RMA operations supported by an endpoint. Build-a-bear but for permissions ๐งธFI_RMA_EVENTโ requests that an endpoint support the generation of completion events when it is the target of an RMA and/or atomic operation ๐ฅ. This flag requires thatFI_REMOTE_READand/orFI_REMOTE_WRITEbe enabled on the endpoint.FI_RMA_PMEMโ the provider ispersistent memory aware' and supports RMA operations to and from persistent memory ๐. Persistent memory aware providers must support registration of memory that is backed by non-volatile memory, RMA transfers to/from persistent memory, and enhanced completion semantics. This flag requires thatFI_RMA` be set. Also โ heads up โ this capability is experimental โ ๏ธ so like, hydrate before using.FI_SENDโ you require an endpoint capable of sending message data transfers ๐. Message transfers include base message operations as well as tagged message functionality. (Mirror image ofFI_RECV, matching outfits fr fr.)FI_SHARED_AVโ requests or indicates support for address vectors which may be shared among multiple processes ๐ค. Sharing is caring, allegedly.FI_SOURCEโ requests that the endpoint return source addressing data as part of its completion data ๐ฌ. This capability only applies to connectionless endpoints. Now the caveat, because there's always a caveat bestie: returning source address information may require that the provider perform address translation and/or look-up based on data available in the underlying protocol in order to provide the requested data, which may adversely affect performance ๐ญ. And the performance impact may be greater for address vectors of typeFI_AV_TABLE. Ouch.FI_SOURCE_ERRโ must be paired withFI_SOURCE๐ฏ. When specified, this requests that raw source addressing data be returned as part of completion data for any address that has not been inserted into the local address vector. Heads up though: use of this capability may require the provider to validate incoming source address data against addresses stored in the local address vector, which may adversely affect performance ๐. Again. Sorry.FI_TAGGEDโ the endpoint should handle tagged message transfers ๐ท๏ธโจ. Tagged message transfers associate a user-specified key or tag with each message that is used for matching purposes at the remote side. Endpoints supporting this capability support operations defined bystruct fi_ops_tagged. In the absence of any relevant flags,FI_TAGGEDimplies the ability to send and receive tagged messages. Want to be picky? Applications can use theFI_SENDandFI_RECVflags to optimize an endpoint as send-only or receive-only ๐FI_TRIGGERโ the endpoint should support triggered operations โก. Endpoints that support this capability must meet the usage model as described byfi_trigger(3). Go read it, iykyk.FI_WRITEโ you require an endpoint capable of initiating writes against remote memory regions โ๏ธ. This flag requires thatFI_RMAand/orFI_ATOMICbe set.FI_XPUโ the endpoint should support transfers that may be initiated from heterogenous computation devices, such as GPUs ๐ฎ๐ฅ. This flag requires thatFI_TRIGGERbe set. For additional details on XPU triggers seefi_trigger(3).
Okay so now the big picture โ capabilities may be grouped into three general categories: primary, secondary, and primary modifiers ๐. Buckle up, this is the lore.
Primary capabilities must explicitly be requested by an application, and a provider must enable support for only those primary capabilities which were selected. Primary modifiers are used to limit a primary capability, such as restricting an endpoint to being send-only ๐ฏ. And if no modifiers are specified for an applicable capability, all relevant modifiers are assumed. See above definitions for details โ๏ธ
Secondary capabilities may optionally be requested by an application ๐ซ. If requested, a provider must support the capability or fail the fi_getinfo request (FI_ENODATA) ๐ค. A provider may optionally report non-selected secondary capabilities if doing so would not compromise performance or security. Generous of them.
Primary capabilities: FI_MSG, FI_RMA, FI_TAGGED, FI_ATOMIC, FI_MULTICAST, FI_NAMED_RX_CTX, FI_DIRECTED_RECV, FI_TAGGED_DIRECTED_RECV, FI_HMEM, FI_COLLECTIVE, FI_XPU, FI_AV_USER_ID, FI_PEER ๐
Primary modifiers: FI_READ, FI_WRITE, FI_RECV, FI_SEND, FI_REMOTE_READ, FI_REMOTE_WRITE ๐
Secondary capabilities: FI_MULTI_RECV, FI_TAGGED_MULTI_RECV, FI_SOURCE, FI_RMA_EVENT, FI_SHARED_AV, FI_TRIGGER, FI_FENCE, FI_LOCAL_COMM, FI_REMOTE_COMM, FI_SOURCE_ERR, FI_RMA_PMEM ๐ฆ
๐ MODE ๐
okay so the operational mode bits are literally the requirements an app must adhere to when using the fabric interfaces, no cap. Modes specify optimal ways of accessing the reported endpoint or domain. Apps designed to support a specific mode of operation may see improved performance when that mode is desired by the provider. Itโs recommended that providers support apps that disable any provider preferred modes ๐ซถ.
On input to fi_getinfo, applications set the mode bits that they support. On output, providers will clear mode bits that are not necessary to achieve high-performance. Mode bits that remain set indicate application requirements for using the fabric interfaces created using the returned fi_info. The set of modes is listed below. If a NULL hints structure is provided, then the providerโs supported set of modes will be returned in the info structure(s) โจ.
FI_ASYNC_IOVโ applications can reference multiple data buffers as part of a single operation through the use of IO vectors (SGEs). Typically, the contents of an IO vector are copied by the provider into an internal buffer area, or directly to the underlying hardware. But when a large number of IOV entries are supported, IOV buffering may have a negative impact on performance and memory consumption ๐ฌ. TheFI_ASYNC_IOVmode indicates that the application must provide the buffering needed for the IO vectors. When set, an application must not modify an IO vector oflength > 1, including any related memory descriptor array, until the associated operation has completed. periodt.FI_CONTEXTโ specifies that the provider requires that applications usestruct fi_contextas their per operation context parameter for operations that generated full completions. This structure should be treated as opaque to the application. For performance reasons, this structure must be allocated by the user, but may be used by the fabric provider to track the operation. Typically, users embedstruct fi_contextwithin their own context structure ๐. Thestruct fi_contextmust remain valid until the corresponding operation completes or is successfully canceled. As such,fi_contextshould NOT be allocated on the stack ๐ญ. Doing so is likely to result in stack corruption that will be difficult to debug. Users should not update or interpret the fields in this structure, or reuse it until the original operation has completed. If an operation does not generate a completion (i.e. the endpoint was configured withFI_SELECTIVE_COMPLETIONand the operation was not initiated with theFI_COMPLETIONflag) then the context parameter is ignored by the fabric provider. The structure is specified inrdma/fabric.h๐.FI_CONTEXT2โ this bit is similar toFI_CONTEXT, but doubles the providerโs requirement on the size of the per context structure ๐. When set, this specifies that the provider requires that applications usestruct fi_context2as their per operation context parameter. Or, optionally, an application can provide an array of twofi_contextstructures (e.g.struct fi_context[2]) instead. The requirements for usingstruct fi_context2are identical as defined forFI_CONTEXTabove. same vibes, bigger context, iykyk.FI_LOCAL_MR(deprecated) โ this oneโs deprecated, bestie, so donโt build your whole personality around it. The provider is optimized around having applications register memory for locally accessed data buffers. Data buffers used in send and receive operations and as the source buffer for RMA and atomic operations must be registered by the application for access domains opened with this capability. This flag is defined for compatibility and is ignored if the application version is1.5or later and the domainmr_modeis set to anything other thanFI_MR_BASICorFI_MR_SCALABLE. See the domain attributemr_modefi_domain(3)andfi_mr(3)๐ซก.FI_MSG_PREFIXโ message prefix mode indicates that an application will provide buffer space in front of all message send and receive buffers for use by the provider. Typically, the provider uses this space to implement a protocol, with the protocol headers being written into the prefix area. The contents of the prefix space should be treated as opaque. The use ofFI_MSG_PREFIXmay improve application performance over certain providers by reducing the number of IO vectors referenced by underlying hardware and eliminating provider buffer allocation ๐ธ.
Real talk: FI_MSG_PREFIX only applies to send and receive operations, including tagged sends and receives. RMA and atomics do not require the application to provide prefix buffers. Prefix buffer space must be provided with all sends and receives, regardless of the size of the transfer or other transfer options. The ownership of prefix buffers is treated the same as the corresponding message buffers, but the size of the prefix buffer is not counted toward any message limits, including inject ๐.
Applications that support prefix mode must supply buffer space before their own message data. The size of space that must be provided is specified by the msg_prefix_size endpoint attribute. Providers are required to define a msg_prefix_size that is a multiple of 8 bytes. Additionally, applications may receive provider generated packets that do not contain application data. Such received messages will indicate a transfer size of that is equal to or smaller than msg_prefix_size ๐.
The buffer pointer given to all send and receive operations must point to the start of the prefix region of the buffer (as opposed to the payload). For scatter-gather send/recv operations, the prefix buffer must be a contiguous region, though it may or may not be directly adjacent to the payload portion of the buffer ๐ง.
FI_RX_CQ_DATAโ this mode bit only applies to data transfers that setFI_REMOTE_CQ_DATA. When set, a data transfer that carries remote CQ data will consume a receive buffer at the target. This is true even for operations that would normally not consume posted receive buffers, such as RMA write operations ๐ฅ. yes, even the ones that think theyโre too cool to eat a receive buffer.
๐บ๏ธ ADDRESSING FORMATS ๐บ๏ธ
Multiple fabric interfaces take as input either a source or destination address parameter. This includes struct fi_info (src_addr and dest_addr), CM calls (getname, getpeer, connect, join, and leave), and AV calls (insert, lookup, and straddr). The fi_info addr_format field indicates the expected address format for these operations ๐ฌ.
A provider may support one or more of the following addressing formats. In some cases, a selected addressing format may need to be translated or mapped into an address which is native to the fabric. See fi_av(3) โจ.
FI_ADDR_EFAโ address is an Amazon Elastic Fabric Adapter (EFA) proprietary format โ๏ธ.FI_ADDR_PSMX2โ address is an Intel proprietary format used with their Performance Scaled Messaging protocol version2๐.FI_ADDR_PSMX3โ address is an Intel proprietary format used with their Performance Scaled Messaging protocol version3๐.FI_ADDR_STRโ address is a formatted character string. The length and content of the string is address and/or provider specific, but in general follows a URI model:
address_format[://[node][:[service][/[field3]...][?[key=value][&k2=v2]...]]]
Examples:
- fi_sockaddr://10.31.6.12:7471
- fi_sockaddr_in6://[fe80::6:12]:7471
- fi_sockaddr://10.31.6.12:7471?qos=3
Since the string formatted address does not contain any provider information, the prov_name field of the fabric attribute structure should be used to filter by provider if necessary ๐.
FI_FORMAT_UNSPECโFI_FORMAT_UNSPECindicates that a provider specific address format should be selected. Provider specific addresses may be protocol specific or a vendor proprietary format. Applications that selectFI_FORMAT_UNSPECshould be prepared to treat returned addressing data as opaque ๐.FI_FORMAT_UNSPECtargets apps which make use of an out of band address exchange. Applications which useFI_FORMAT_UNSPECmay usefi_getname()to obtain a provider specific address assigned to an allocated endpoint. slay for out-of-band chaos.FI_SOCKADDRโ address is of typesockaddr. The specific socket address format will be determined at run time by interfaces examining thesa_familyfield ๐งฆ.FI_SOCKADDR_IBโ address is of typesockaddr_ib(defined in Linux kernel source) ๐ง.FI_SOCKADDR_INโ address is of typesockaddr_in(IPv4) ๐.FI_SOCKADDR_IN6โ address is of typesockaddr_in6(IPv6) ๐.FI_SOCKADDR_IPโ address is of typesockaddr_in(IPv4) orsockaddr_in6(IPv6). The specific socket address format will be determined at run time by interfaces examining thesa_familyfield. This format is different fromFI_SOCKADDRin that the address can only be IPv4 or IPv6, not any other socket address such assockaddr_ib๐ .
๐ฉ FLAGS ๐ฉ
The operation of the fi_getinfo call may be controlled through the use of input flags. Valid flags include the following ๐.
FI_NUMERICHOSTโ indicates that thenodeparameter is a numeric string representation of a fabric address, such as a dotted decimal IP address. Use of this flag will suppress any lengthy name resolution protocol โก. no waiting around for DNS to finish its little side quest.FI_PROV_ATTR_ONLYโ indicates that the caller is only querying for what providers are potentially available. All providers will return exactly onefi_infostruct, regardless of whether that provider is usable on the current platform or not. The returnedfi_infostruct will contain default values for all members, with the exception offabric_attr. Thefabric_attrmember will have theprov_nameandprov_versionvalues filled in ๐.FI_SOURCEโ indicates that thenodeandserviceparameters specify the local source address to associate with an endpoint. If specified, either thenodeand/orserviceparameter must be non-NULL. This flag is often used with passive endpoints ๐๏ธ.FI_RESCANโ indicates that the provider should rescan available network interfaces. This operation may be computationally expensive ๐ฎโ๐จ. like, itโs giving โIโm gonna need a minuteโ energy.
๐ RETURN VALUE ๐
Okay bestie, here's the vibe check on what comes back. fi_getinfo() is a success girlie and returns 0 when everything is slay. But on error? It returns a negative value corresponding to fabric errno โ and those fabric errno values are defined in rdma/fi_errno.h. No cap.
fi_allocinfo() returns a pointer to a new fi_info structure on success, or NULL on error. fi_dupinfo() duplicates a single fi_info structure and all the substructures within it, returning a pointer to the new fi_info structure on success, or NULL on error. Both calls require that the returned fi_info structure be freed via fi_freeinfo(). Periodt. ๐
๐จ ERRORS ๐จ
Here's the drama board of error codes, bestie:
FI_EBADFLAGSโ the specified endpoint or domain capability or operation flags are invalid. Not it.FI_ENODATAโ indicates that no providers could be found which support the requested fabric information. Literally nobody matched.FI_ENOMEMโ indicates that there was insufficient memory to complete the operation. The memory budget said no. ๐ญFI_ENOSYSโ indicates that requested version is newer than the library being used. You're asking for a future era, bestie. ๐ฆ
๐ NOTES ๐
Okay so important tea: various libfabric calls, including fi_getinfo, take a struct fi_info as input. Applications must use libfabric allocated fi_info structures. A zeroed struct fi_info can be allocated using fi_allocinfo, which may then be initialized by the user. A struct fi_info may be copied for modification using the fi_dupinfo() call. Slay.
If hints are provided, the operation will be controlled by the values that are supplied in the various fields (see section on fi_info). Applications that require specific communication interfaces, domains, capabilities or other requirements, can specify them using fields in hints. Libfabric returns a linked list in info that points to a list of matching interfaces. info is set to NULL if there are no communication interfaces or none match the input hints. ๐ซถ
If node is provided, fi_getinfo will attempt to resolve the fabric address to the given node. If node is not provided, fi_getinfo will attempt to resolve the fabric addressing information based on the provided hints. The caller must call fi_freeinfo to release fi_info structures returned by fi_getinfo. Don't forget the cleanup, bestie.
If neither node, service or hints are provided, then fi_getinfo simply returns the list all available communication interfaces. (Yes, grammar exactly like that, bestie.) Multiple threads may call fi_getinfo simultaneously, without any requirement for serialization. Iconic. ๐
๐ SEE ALSO ๐
The whole squad: fi_open(3), fi_endpoint(3), fi_domain(3), fi_nic(3) fi_trigger(3) โ go read those next, iykyk. ๐ฅ
๐ AUTHORS ๐
OpenFabrics. Periodt. ๐
And that's the whole page, bestie! This cutie came from the Libfabric Programmerโs Manual, dated 2025-10-31, and it's all about fi_getinfo(3). ๐
โจ
๐ฆ where this page comes from
- centos-stream 10: libfabric-devel 2.5.1-1.el10 ยท BSD-2-Clause OR GPL-2.0-only
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms