[ofiwg] getting hardware details from libfabric
Hefty, Sean
sean.hefty at intel.com
Thu May 24 17:49:12 PDT 2018
This is an initial proposal:
The device attributes are per fi_info structure (which includes the network address, domain, and ep attributes). The app does not need to open any resources to obtain the data.
When fi_getinfo() is called with FI_DEVICE_ATTR flag set, each fi_info::handle will reference a struct fid_attr, if valid.
// Definition of struct fid_attr. Field types could change.
struct fid_attr {
struct fid; /* fclass = FI_TYPE_DEVICE_ATTR */
struct dev_attr {
char *interface;
char *device_id;
char *device_version;
char *vendor_id;
char *firmware;
};
struct bus_attr {
char *domain_id;
char *bus_id;
char *device_id;
char *function_id;
};
struct link_attr {
char *address;
size_t mtu;
enum fi_link_state state; /* up, down, unknown */
char *protocol;
size_t speed; /* bits per second */
};
struct prov_attr {
size_t size;
char data[];
};
};
The prov_attr structure can be cast to a provider specific structure (e.g. usnic_devinfo) if the app knows the structure format. I would add a new public header for all definitions. Additionally, fi_tostr() can be used to display the attributes. fid_attr allows fi_tostr() to route the call to the provider to handle the prov_attr portion (done using new fi_control FI_TOSTR option).
I'm still debating whether fi_freeinfo() will free fid_attr, or if the app must call fi_close() separately.
- Sean
More information about the ofiwg
mailing list