---
name: "fi_fabric"
section: "3"
platform: "linux"
package: "libfabric"
version: "2.7.0-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/fi_fabric"
---

# fi\_fabric(3)

Fabric network operations

## NAME

fi\_fabric - Fabric network operations

- fi\_fabric / fi\_close

  Open / close a fabric network

- fi\_tostr / fi\_tostr\_r

  Convert fabric attributes, flags, and capabilities to printable string

## SYNOPSIS

-

  ```
  #include <rdma/fabric.h>
  int fi_fabric(struct fi_fabric_attr *attr,
      struct fid_fabric **fabric, void *context);
  int fi_close(struct fid *fabric);
  char * fi_tostr(const void *data, enum fi_type datatype);
  char * fi_tostr_r(char *buf, size_t len, const void *data,
      enum fi_type datatype);
  ```

## ARGUMENTS

- *attr*

  Attributes of fabric to open.

- *fabric*

  Fabric network

- *context*

  User specified context associated with the opened object. This context is returned as part of any associated asynchronous event.

- *buf*

  Output buffer to write string.

- *len*

  Size in bytes of memory referenced by buf.

- *data*

  Input data to convert into a string. The format of data is determined by the datatype parameter.

- *datatype*

  Indicates the data to convert to a printable string.

## DESCRIPTION

A fabric identifier is used to reference opened fabric resources and library related objects.

The fabric network represents a collection of hardware and software resources that access a single physical or virtual network. All network ports on a system that can communicate with each other through their attached networks belong to the same fabric. A fabric network shares network addresses and can span multiple providers. An application must open a fabric network prior to allocating other network resources, such as communication endpoints.

### fi\_fabric

Opens a fabric network provider. The attributes of the fabric provider are specified through the open call, and may be obtained by calling fi\_getinfo.

### fi\_close

The fi\_close call is used to release all resources associated with a fabric object. All items associated with the opened fabric must be released prior to calling fi\_close.

### fi\_tostr / fi\_tostr\_r

Converts fabric interface attributes, capabilities, flags, and enum values into a printable string. The data parameter accepts a pointer to the attribute or value(s) to display, with the datatype parameter indicating the type of data referenced by the data parameter. Valid values for the datatype are listed below, along with the corresponding datatype or field value.

- *FI\_TYPE\_INFO*

  struct fi\_info, including all substructures and fields

- *FI\_TYPE\_EP\_TYPE*

  struct fi\_info::type field

- *FI\_TYPE\_CAPS*

  struct fi\_info::caps field

- *FI\_TYPE\_OP\_FLAGS*

  struct fi\_info::op\_flags field, or general uint64\_t flags

- *FI\_TYPE\_ADDR\_FORMAT*

  struct fi\_info::addr\_format field

- *FI\_TYPE\_TX\_ATTR*

  struct fi\_tx\_attr

- *FI\_TYPE\_RX\_ATTR*

  struct fi\_rx\_attr

- *FI\_TYPE\_EP\_ATTR*

  struct fi\_ep\_attr

- *FI\_TYPE\_DOMAIN\_ATTR*

  struct fi\_domain\_attr

- *FI\_TYPE\_FABRIC\_ATTR*

  struct fi\_fabric\_attr

- *FI\_TYPE\_THREADING*

  enum fi\_threading

- *FI\_TYPE\_PROGRESS*

  enum fi\_progress

- *FI\_TYPE\_PROTOCOL*

  struct fi\_ep\_attr::protocol field

- *FI\_TYPE\_MSG\_ORDER*

  struct fi\_ep\_attr::msg\_order field

- *FI\_TYPE\_MODE*

  struct fi\_info::mode field

- *FI\_TYPE\_AV\_TYPE*

  enum fi\_av\_type

- *FI\_TYPE\_ATOMIC\_TYPE*

  enum fi\_datatype

- *FI\_TYPE\_ATOMIC\_OP*

  enum fi\_op

- *FI\_TYPE\_VERSION*

  Returns the library version of libfabric in string form. The data parameter is ignored.

- *FI\_TYPE\_EQ\_EVENT*

  uint32\_t event parameter returned from fi\_eq\_read(). See [fi\_eq(3)](/fi_eq/3.md) for a list of known values.

- *FI\_TYPE\_CQ\_EVENT\_FLAGS*

  uint64\_t flags field in fi\_cq\_xxx\_entry structures. See [fi\_cq(3)](/fi_cq/3.md) for valid flags.

- *FI\_TYPE\_MR\_MODE*

  struct fi\_domain\_attr::mr\_mode flags

- *FI\_TYPE\_OP\_TYPE*

  enum fi\_op\_type

- *FI\_TYPE\_FID*

  struct fid \*

- *FI\_TYPE\_HMEM\_IFACE*

  enum fi\_hmem\_iface \*

- *FI\_TYPE\_CQ\_FORMAT*

  enum fi\_cq\_format

- *FI\_TYPE\_LOG\_LEVEL*

  enum fi\_log\_level

- *FI\_TYPE\_LOG\_SUBSYS*

  enum fi\_log\_subsys

- *FI\_TYPE\_AV\_ATTR*

  struct fi\_av\_attr

- *FI\_TYPE\_CQ\_ATTR*

  struct fi\_cq\_attr

- *FI\_TYPE\_MR\_ATTR*

  struct fi\_mr\_attr

- *FI\_TYPE\_CNTR\_ATTR*

  struct fi\_cntr\_attr

- *FI\_TYPE\_COLLECTIVE\_OP*

  enum fi\_collective\_op

- *FI\_TYPE\_CQ\_ERR\_ENTRY*

  struct fi\_cq\_err\_entry

- *FI\_TYPE\_WAIT\_OBJ*

  enum fi\_wait\_obj

- *FI\_TYPE\_CQ\_WAIT\_COND*

  enum fi\_cq\_wait\_cond

fi\_tostr() will return a pointer to an internal libfabric buffer that should not be modified, and will be overwritten the next time fi\_tostr() is invoked. fi\_tostr() is not thread safe.

The fi\_tostr\_r() function is a re-entrant and thread safe version of fi\_tostr(). It writes the string into a buffer provided by the caller. fi\_tostr\_r() returns the start of the caller’s buffer.

## NOTES

The following resources are associated with fabric domains: access domains, passive endpoints, and CM event queues.

## FABRIC ATTRIBUTES

The fi\_fabric\_attr structure defines the set of attributes associated with a fabric and a fabric provider.

-

  ```
  struct fi_fabric_attr {
      struct fid_fabric *fabric;
      char              *name;
      char              *prov_name;
      uint32_t          prov_version;
      uint32_t          api_version;
  };
  ```

### fabric

On input to fi\_getinfo, a user may set this to an opened fabric instance to restrict output to the given fabric. On output from fi\_getinfo, if no fabric was specified, but the user has an opened instance of the named fabric, this will reference the first opened instance. If no instance has been opened, this field will be NULL.

The fabric instance returned by fi\_getinfo should only be considered valid if the application does not close any fabric instances from another thread while fi\_getinfo is being processed.

### name

A fabric identifier.

### prov\_name - Provider Name

The name of the underlying fabric provider.

To request an utility provider layered over a specific core provider, both the provider names have to be specified using “;” as delimiter.

e.g. “ofi\_rxm;verbs” or “verbs;ofi\_rxm”

For debugging and administrative purposes, environment variables can be used to control which fabric providers will be registered with libfabric. Specifying “FI\_PROVIDER=foo,bar” will allow any providers with the names “foo” or “bar” to be registered. Similarly, specifying “FI\_PROVIDER=^foo,bar” will prevent any providers with the names “foo” or “bar” from being registered. Providers which are not registered will not appear in fi\_getinfo results. Applications which need a specific set of providers should implement their own filtering of fi\_getinfo’s results rather than relying on these environment variables in a production setting.

### prov\_version - Provider Version

Version information for the fabric provider, in a major.minor format. The use of the FI\_MAJOR() and FI\_MINOR() version macros may be used to extract the major and minor version data. See [fi\_version(3)](/fi_version/3.md).

In case of an utility provider layered over a core provider, the version would always refer to that of the utility provider.

### api\_version

The interface version requested by the application. This value corresponds to the version parameter passed into [fi\_getinfo(3)](/fi_getinfo/3.md).

## RETURN VALUE

Returns FI\_SUCCESS on success. On error, a negative value corresponding to fabric errno is returned. Fabric errno values are defined in rdma/fi\_errno.h.

## ERRORS

## SEE ALSO

[fabric(7)](/fabric/7.md), [fi\_getinfo(3)](/fi_getinfo/3.md), [fi\_domain(3)](/fi_domain/3.md), [fi\_eq(3)](/fi_eq/3.md), [fi\_endpoint(3)](/fi_endpoint/3.md)

## AUTHORS

OpenFabrics.
