-
enum libnbft_primary_admin_host_flag
Primary Administrative Host Descriptor Flags
Constants
LIBNBFT_PRIMARY_ADMIN_HOST_FLAG_NOT_INDICATEDNot Indicated by Driver: The driver that created this NBFT provided no administrative priority hint for this NBFT.
LIBNBFT_PRIMARY_ADMIN_HOST_FLAG_UNSELECTEDUnselected: The driver that created this NBFT explicitly indicated that this NBFT should not be prioritized over any other NBFT.
LIBNBFT_PRIMARY_ADMIN_HOST_FLAG_SELECTEDSelected: The driver that created this NBFT explicitly indicated that this NBFT should be prioritized over any other NBFT.
LIBNBFT_PRIMARY_ADMIN_HOST_FLAG_RESERVEDReserved.
-
struct libnbft_host
Host Descriptor
Definition
struct libnbft_host {
unsigned char *id;
char *nqn;
bool host_id_configured;
bool host_nqn_configured;
enum libnbft_primary_admin_host_flag primary;
};
Members
idHost ID (raw UUID, length = 16 bytes).
nqnHost NQN.
host_id_configuredHostID Configured Flag: value of True indicates that id contains administratively-configured value, or driver default value if False.
host_nqn_configuredHost NQN Configured Flag: value of True indicates that nqn contains administratively-configured value, or driver default value if False.
primaryPrimary Administrative Host Descriptor, see
enum libnbft_primary_admin_host_flag.
-
struct libnbft_hfi_info_tcp
HFI Transport Info Descriptor - NVMe/TCP
Definition
struct libnbft_hfi_info_tcp {
__u32 pci_sbdf;
__u8 mac_addr[6];
__u16 vlan;
__u8 ip_origin;
char ipaddr[40];
__u8 subnet_mask_prefix;
char gateway_ipaddr[40];
__u16 route_metric;
char primary_dns_ipaddr[40];
char secondary_dns_ipaddr[40];
char dhcp_server_ipaddr[40];
char *host_name;
bool this_hfi_is_default_route;
bool dhcp_override;
};
Members
pci_sbdfPCI Express Routing ID for the HFI Transport Function.
mac_addrMAC Address: The MAC address of this HFI, in EUI-48TM format.
vlanThe VLAN identifier if the VLAN is associated with this HFI, as defined in IEEE 802.1q-2018 or zeroes if no VLAN is associated with this HFI.
ip_originThe source of Ethernet L3 configuration information used by the driver or 0 if not used.
ipaddrThe IPv4 or IPv6 address of this HFI.
subnet_mask_prefixThe IPv4 or IPv6 subnet mask in CIDR routing prefix notation.
gateway_ipaddrThe IPv4 or IPv6 address of the IP gateway for this HFI or zeroes if no IP gateway is specified.
route_metricThe cost value for the route indicated by this HFI.
primary_dns_ipaddrThe IPv4 or IPv6 address of the Primary DNS server for this HFI.
secondary_dns_ipaddrThe IPv4 or IPv6 address of the Secondary DNS server for this HFI.
dhcp_server_ipaddrThe IPv4 or IPv6 address of the DHCP server used to assign this HFI address.
host_nameThe Host Name string.
this_hfi_is_default_routeIf True, then the BIOS utilized this interface described by HFI to be the default route with highest priority. If False, then routes are local to their own scope.
dhcp_overrideIf True, then HFI information was populated by consuming the DHCP on this interface. If False, then the HFI information was set administratively by a configuration interface to the driver and pre-OS envrionment.
-
struct libnbft_hfi
Host Fabric Interface (HFI) Descriptor
Definition
struct libnbft_hfi {
int index;
char transport[8];
struct libnbft_hfi_info_tcp tcp_info;
};
Members
indexHFI Descriptor Index: indicates the number of this HFI Descriptor in the Host Fabric Interface Descriptor List.
transportTransport Type string (e.g. ‘tcp’).
tcp_infoThe HFI Transport Info Descriptor, see
struct libnbft_hfi_info_tcp.
-
struct libnbft_discovery
Discovery Descriptor
Definition
struct libnbft_discovery {
int index;
struct libnbft_security *security;
struct libnbft_hfi *hfi;
char *uri;
char *nqn;
};
Members
indexThe number of this Discovery Descriptor in the Discovery Descriptor List.
securityThe Security Profile Descriptor, see
struct libnbft_security.hfiThe HFI Descriptor associated with this Discovery Descriptor. See
struct libnbft_hfi.uriA URI which indicates an NVMe Discovery controller associated with this Discovery Descriptor.
nqnAn NVMe Discovery controller NQN.
-
struct libnbft_security
Security Profile Descriptor
Definition
struct libnbft_security {
int index;
};
Members
indexThe number of this Security Profile Descriptor in the Security Profile Descriptor List.
-
enum libnbft_nid_type
Namespace Identifier Type (NIDT)
Constants
LIBNBFT_NID_TYPE_NONENo identifier available.
LIBNBFT_NID_TYPE_EUI64The EUI-64 identifier.
LIBNBFT_NID_TYPE_NGUIDThe NSGUID identifier.
LIBNBFT_NID_TYPE_NS_UUIDThe UUID identifier.
-
struct libnbft_subsystem_ns
Subsystem Namespace (SSNS) info
Definition
struct libnbft_subsystem_ns {
int index;
struct libnbft_discovery *discovery;
struct libnbft_security *security;
int num_hfis;
struct libnbft_hfi **hfis;
char transport[8];
char traddr[40];
char *trsvcid;
__u16 subsys_port_id;
__u32 nsid;
enum libnbft_nid_type nid_type;
__u8 *nid;
char *subsys_nqn;
bool pdu_header_digest_required;
bool data_digest_required;
int controller_id;
int asqsz;
char *dhcp_root_path_string;
bool discovered;
bool unavailable;
};
Members
indexSSNS Descriptor Index in the descriptor list.
discoveryPrimary Discovery Controller associated with this SSNS Descriptor.
securitySecurity Profile Descriptor associated with this namespace.
num_hfisNumber of HFIs.
hfisList of HFIs associated with this namespace. Includes the primary HFI at the first position and all secondary HFIs. This array is null-terminated.
transportTransport Type string (e.g. ‘tcp’).
traddrSubsystem Transport Address.
trsvcidSubsystem Transport Service Identifier.
subsys_port_idThe Subsystem Port ID.
nsidThe Namespace ID of this descriptor or when nid should be used instead.
nid_typeNamespace Identifier Type, see
enum libnbft_nid_type.nidThe Namespace Identifier value.
subsys_nqnSubsystem and Namespace NQN.
pdu_header_digest_requiredPDU Header Digest (HDGST) Flag: the use of NVM Header Digest Enabled is required.
data_digest_requiredData Digest (DDGST) Flag: the use of NVM Data Digest Enabled is required.
controller_idController ID (SSNS Extended Information Descriptor): The controller ID associated with the Admin Queue or 0 if not supported.
asqszAdmin Submission Queue Size (SSNS Extended Information Descriptor) or 0 if not supported.
dhcp_root_path_stringDHCP Root Path Override string (SSNS Extended Information Descriptor).
discoveredIndicates that this namespace was acquired through discovery.
unavailableNamespace is unavailable as indicated by the pre-OS driver.
-
struct libnbft_info
The parsed NBFT table data.
Definition
struct libnbft_info {
char *filename;
__u8 *raw_nbft;
ssize_t raw_nbft_size;
struct libnbft_host host;
struct libnbft_hfi **hfi_list;
struct libnbft_security **security_list;
struct libnbft_discovery **discovery_list;
struct libnbft_subsystem_ns **subsystem_ns_list;
};
Members
filenamePath to the NBFT table.
raw_nbftThe original NBFT table contents.
raw_nbft_sizeSize of raw_nbft.
hostThe Host Descriptor (should match other NBFTs).
hfi_listThe HFI Descriptor List (null-terminated array).
security_listThe Security Profile Descriptor List (null-terminated array).
discovery_listThe Discovery Descriptor List (null-terminated array).
subsystem_ns_listThe SSNS Descriptor List (null-terminated array).
-
int libnvmf_read_nbft(struct libnvme_global_ctx *ctx, struct libnbft_info **nbft, const char *filename)
Read and parse contents of an ACPI NBFT table
Parameters
struct libnvme_global_ctx *ctxstruct libnvme_global_ctx object
struct libnbft_info **nbftParsed NBFT table data.
const char *filenameFilename of the raw NBFT table to read.
Description
Read and parse the specified NBFT file into a struct libnbft_info. Free with libnvmf_free_nbft().
Return
0 on success, negative error code otherwise.
-
void libnvmf_free_nbft(struct libnvme_global_ctx *ctx, struct libnbft_info *nbft)
Free the struct libnbft_info and its contents
Parameters
struct libnvme_global_ctx *ctxstruct libnvme_global_ctx object
struct libnbft_info *nbftParsed NBFT table data.
-
struct nbft_file_entry
Linked list entry for NBFT files
Definition
struct nbft_file_entry {
struct nbft_file_entry *next;
struct libnbft_info *nbft;
};
Members
nextPointer to next entry
nbftPointer to NBFT info structure