From 9302b87bf5c5d3a005b9381237147ff1d40133ad Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Mon, 13 Jul 2026 16:27:45 +0200 Subject: [PATCH 1/4] nvme-types-nbft: Update to Boot Specification rev. 1.3 Update the raw ACPI NBFT C type definitions to match the NVM Express Boot Specification Revision 1.3. Changes include: - nbft_hfi_info_tcp: hfi_ext_info, pcie_seg_num - Add NBFT_HFI_INFO_TCP_IPADDR_AUTOCONF - Add struct nbft_hfi_info_ext (descriptor type Ah) for HFI Transport Info Extended Information - Add enum nbft_hfi_info_ext_flags (VALID, DCI) - Extend struct nbft_ssns_ext_info with naed, cipeec, cto, nceec - Add enum nbft_ssns_ext_info_naed - Add enum nbft_ssns_ext_info_cipeec - Add enum nbft_ssns_ext_info_nceec Signed-off-by: Tomas Bzatek --- libnvme/src/nvme/nvme-types-nbft.h | 199 +++++++++++++++++++++++++++-- 1 file changed, 190 insertions(+), 9 deletions(-) diff --git a/libnvme/src/nvme/nvme-types-nbft.h b/libnvme/src/nvme/nvme-types-nbft.h index 3c6eea2114..325a7ac661 100644 --- a/libnvme/src/nvme/nvme-types-nbft.h +++ b/libnvme/src/nvme/nvme-types-nbft.h @@ -56,7 +56,7 @@ * @NBFT_DESC_SSNS_EXT_INFO: SSNS Extended Info Descriptor: indicated by an SSNS * Descriptor if required. * @NBFT_DESC_HFI_EXT_INFO: HFI Extended Info Descriptor: indicated by an HFI Transport - * Info descriptor (added in revision 1.1+). + * Info descriptor (since rev. 1.1). */ enum nbft_desc_type { NBFT_DESC_HEADER = 0, @@ -380,8 +380,8 @@ enum nbft_hfi_flags { * @version: Version: This field shall be set to 1h. * @trtype: HFI Transport Type, see &enum nbft_trtype: This field * shall be set to 03h (i.e., NVMe/TCP; #NBFT_TRTYPE_TCP). - * @trinfo_version: Transport Info Version: Implementations compliant to this - * specification shall set this field to 1h. + * @trinfo_version: Transport Info Version: This field shall be set to 2h, + * supported values include 1h (Boot Spec rev. 1.0). * @hfi_index: HFI Descriptor Index: The value of the HFI Descriptor Index * field of the HFI Descriptor (see &struct nbft_hfi.index) * whose HFI Transport Info Descriptor Heap Object Reference @@ -440,6 +440,16 @@ enum nbft_hfi_flags { * @host_name_obj: Host Name Heap Object Reference: If this field is set * to a non-zero value, then this field indicates the location * and size of a heap object containing a Host Name string. + * @hfi_ext_info_obj: HFI Transport Info Extended Information Descriptor Object + * Reference (since rev. 1.1): If this field is set to a + * non-zero value, then this field indicates the location and + * size of a heap object containing a HFI Transport Info + * Extended Information Descriptor (see &struct nbft_hfi_info_ext). + * @pcie_seg_num: PCIe Segment Number (since rev. 1.1): The Segment + * Number for the specified Controller when the PCI Express Link + * is in Flit mode. If the PCI Express interface is not in Flit + * mode, or if the pre-OS driver does not support Flit mode, + * then this field should be cleared to 0h. * @reserved2: Reserved. */ struct nbft_hfi_info_tcp { @@ -462,7 +472,9 @@ struct nbft_hfi_info_tcp { __u8 secondary_dns[16]; __u8 dhcp_server[16]; struct nbft_heap_obj host_name_obj; - __u8 reserved2[18]; + struct nbft_heap_obj hfi_ext_info_obj; + __u8 pcie_seg_num; + __u8 reserved2[11]; } __attribute__((packed)); /** @@ -481,11 +493,72 @@ struct nbft_hfi_info_tcp { * information was set administratively by * a configuration interface to the driver and * pre-OS envrionment. + * @NBFT_HFI_INFO_TCP_IPADDR_AUTOCONF: Interface Address Autoconfigured (since rev. + * 1.1): if set to 1h, then the IP Address, + * Subnet Mask Prefix, and IP Gateway fields are + * populated by an advanced stateless mechanism + * (e.g., IPv6-SLAAC or IPv6-ND); in addition, + * the DHCP Override bit shall be cleared to 0h, + * and the IP Origin field shall be cleared to 0h. + * If cleared to 0h, then the HFI information + * was not set by such a mechanism. */ enum nbft_hfi_info_tcp_flags { - NBFT_HFI_INFO_TCP_VALID = 1 << 0, - NBFT_HFI_INFO_TCP_GLOBAL_ROUTE = 1 << 1, - NBFT_HFI_INFO_TCP_DHCP_OVERRIDE = 1 << 2, + NBFT_HFI_INFO_TCP_VALID = 1 << 0, + NBFT_HFI_INFO_TCP_GLOBAL_ROUTE = 1 << 1, + NBFT_HFI_INFO_TCP_DHCP_OVERRIDE = 1 << 2, + NBFT_HFI_INFO_TCP_IPADDR_AUTOCONF = 1 << 3, +}; + +/** + * struct nbft_hfi_info_ext - HFI Transport Info Extended Information + * Descriptor (Figure 15, since rev. 1.1) + * @structure_id: Structure ID: This field shall be set to Ah + * (i.e., HFI Ext Info; #NBFT_DESC_HFI_EXT_INFO). + * @version: Version: This field shall be set to 1h. + * @hfi_trinfo_index: HFI Transport Info Descriptor Index: This field shall + * be set to the same value as the HFI Transport Info + * Descriptor Index field of the referencing HFI Transport + * Info Descriptor. + * @flags: Flags, see &enum nbft_hfi_info_ext_flags. + * @dhcp_iaid_obj: IPv4 and IPv6 DHCP Client Identifier Heap IAID Object + * Reference: If the DHCP Client Identifier bit is set to 1h, + * then this heap object references the Identity Association + * Identifier (IAID). This identifier shall be constructed + * conformant to RFC4361. The IAID is stored in little endian + * format within the heap object. + * @dhcp_duid_obj: IPv4 and IPv6 DHCP Client Identifier Heap DUID Object + * Reference: If the DHCP Client Identifier bit is set to 1h, + * then this heap object references the DHCP Unique Identifier + * (DUID). This identifier shall be constructed conformant + * to RFC4361. The DUID is stored in little endian format + * within the heap object. + */ +struct nbft_hfi_info_ext { + __u8 structure_id; + __u8 version; + __le16 hfi_trinfo_index; + __le32 flags; + struct nbft_heap_obj dhcp_iaid_obj; + struct nbft_heap_obj dhcp_duid_obj; +} __attribute__((packed)); + +/** + * enum nbft_hfi_info_ext_flags - HFI Transport Info Extended Information + * Descriptor Flags (since rev. 1.1) + * @NBFT_HFI_INFO_EXT_VALID: Descriptor Valid: If set to 1h, then this + * descriptor is valid. If cleared to 0h, then + * this descriptor is reserved. + * @NBFT_HFI_INFO_EXT_DCI: DHCP Client Identifier: If set to 1h, then the + * IPv4 and IPv6 DHCP Client Identifier Heap Object + * Reference fields are valid and the IP Origin field + * shall be set to 3h. If cleared to 0h, then the + * DHCP Client Identifier Heap Object References + * are reserved. + */ +enum nbft_hfi_info_ext_flags { + NBFT_HFI_INFO_EXT_VALID = 1 << 0, + NBFT_HFI_INFO_EXT_DCI = 1 << 1, }; /** @@ -737,6 +810,25 @@ enum nbft_ssns_trflags { * an DHCP Root Path String used by the driver. If the * SNSS DHCP Root Path Override flag bit is cleared to 0h, * then this field is reserved. + * @naed: Namespace Availability Enhanced Diagnostic (since + * rev. 1.1): If the Unavailable Namespace Flag bit + * is set to 1h (i.e., Unavailable) in the Subsystem + * Namespace Descriptor, this field may provide additional + * status codes provided by the pre-OS driver, + * see &enum nbft_ssns_ext_info_naed. + * @cipeec: Connect Invalid Parameters Extended Error Codes (since + * rev, 1.1): Connect Invalid Parameters may be returned + * with additional status details, + * see &enum nbft_ssns_ext_info_cipeec. + * @cto: Connection Timeout (since rev. 1.1): Specifies + * in seconds the timeout value used by the pre-OS driver + * for connecting to the object specified with this SSNS + * descriptor. If cleared to 0h, this indicates a timeout + * of 0 seconds. If set to FFFFh, this indicates that no + * timeout was specified. + * @nceec: Network and Connection Extended Error Codes (since + * rev, 1.1): Error codes specific to network and connectio + * errors, see &enum nbft_ssns_ext_info_nceec. */ struct nbft_ssns_ext_info { __u8 structure_id; @@ -746,8 +838,97 @@ struct nbft_ssns_ext_info { __le16 cntlid; __le16 asqsz; struct nbft_heap_obj dhcp_root_path_str_obj; + __u8 naed; + __u8 cipeec; + __le16 cto; + __u8 nceec; } __attribute__((packed)); +/** + * enum nbft_ssns_ext_info_naed - SSNS Extended Info Namespace Availability + * Enhanced Diagnostic values (since rev. 1.1) + * @NBFT_SSNS_EXT_INFO_NAED_NO_INFO: No additional information. + * @NBFT_SSNS_EXT_INFO_NAED_NETWORK_ERR: Network Error: The network HFI or + * SSNS destination was invalid. + * @NBFT_SSNS_EXT_INFO_NAED_CONN_FAILURE: Connection Failure: The connection + * to the controller was invalid. + * @NBFT_SSNS_EXT_INFO_NAED_CONN_INV_PARAMS: Connect Invalid Parameters. + * @NBFT_SSNS_EXT_INFO_NAED_CONN_INV_HOST: Connect Invalid Host. + * @NBFT_SSNS_EXT_INFO_NAED_CONN_TIMEOUT: Connection Timeout. + * @NBFT_SSNS_EXT_INFO_NAED_DLP_TIMEOUT: Discovery Log Page Traversal Timeout. + * @NBFT_SSNS_EXT_INFO_NAED_NS_MISSING: Namespace Missing: The referenced + * NID or NSID is missing. + * @NBFT_SSNS_EXT_INFO_NAED_NS_NOT_READY: Namespace Not Ready. + * @NBFT_SSNS_EXT_INFO_NAED_REDFISH_FAILURE: Redfish Secret Keypath Object: The + * pre-OS driver encountered a failure + * interacting with the Redfish Secret + * Keypath Object. + * @NBFT_SSNS_EXT_INFO_NAED_SEC_CHAN_NEG: Secure Channel Negotiation error. + * @NBFT_SSNS_EXT_INFO_NAED_AUTH_FAILURE: Authentication Failure. + * @NBFT_SSNS_EXT_INFO_NAED_AUTH_REQUIRED: Authentication Required. + * @NBFT_SSNS_EXT_INFO_NAED_DHCP_FAILURE: DHCP Failure. + * @NBFT_SSNS_EXT_INFO_NAED_DHCP_ROOT_PATH: SSNS DHCP Root-Path. + */ +enum nbft_ssns_ext_info_naed { + NBFT_SSNS_EXT_INFO_NAED_NO_INFO = 0x00, + NBFT_SSNS_EXT_INFO_NAED_NETWORK_ERR = 0x01, + NBFT_SSNS_EXT_INFO_NAED_CONN_FAILURE = 0x02, + NBFT_SSNS_EXT_INFO_NAED_CONN_INV_PARAMS = 0x03, + NBFT_SSNS_EXT_INFO_NAED_CONN_INV_HOST = 0x04, + NBFT_SSNS_EXT_INFO_NAED_CONN_TIMEOUT = 0x05, + NBFT_SSNS_EXT_INFO_NAED_DLP_TIMEOUT = 0x06, + NBFT_SSNS_EXT_INFO_NAED_NS_MISSING = 0x07, + NBFT_SSNS_EXT_INFO_NAED_NS_NOT_READY = 0x08, + NBFT_SSNS_EXT_INFO_NAED_REDFISH_FAILURE = 0x09, + NBFT_SSNS_EXT_INFO_NAED_SEC_CHAN_NEG = 0x10, + NBFT_SSNS_EXT_INFO_NAED_AUTH_FAILURE = 0x11, + NBFT_SSNS_EXT_INFO_NAED_AUTH_REQUIRED = 0x12, + NBFT_SSNS_EXT_INFO_NAED_DHCP_FAILURE = 0x13, + NBFT_SSNS_EXT_INFO_NAED_DHCP_ROOT_PATH = 0x14, +}; + +/** + * enum nbft_ssns_ext_info_cipeec - Connect Invalid Parameters Extended Error Codes + * (since rev. 1.1) + * @NBFT_SSNS_EXT_INFO_CIPEEC_NO_ERROR: No Extended Error Known. + * @NBFT_SSNS_EXT_INFO_CIPEEC_GENERAL: General Parameters Failure. + * @NBFT_SSNS_EXT_INFO_CIPEEC_INV_ATTR: Invalid Attributes in Connect Response. + * @NBFT_SSNS_EXT_INFO_CIPEEC_DH_MISMATCH: Diffie-Hellman Mismatch. + * @NBFT_SSNS_EXT_INFO_CIPEEC_INV_CTRLID: Invalid Controller ID. + * @NBFT_SSNS_EXT_INFO_CIPEEC_IO_CTRL_DIS: I/O Controller Disabled. + */ +enum nbft_ssns_ext_info_cipeec { + NBFT_SSNS_EXT_INFO_CIPEEC_NO_ERROR = 0x00, + NBFT_SSNS_EXT_INFO_CIPEEC_GENERAL = 0x01, + NBFT_SSNS_EXT_INFO_CIPEEC_INV_ATTR = 0x02, + NBFT_SSNS_EXT_INFO_CIPEEC_DH_MISMATCH = 0x03, + NBFT_SSNS_EXT_INFO_CIPEEC_INV_CTRLID = 0x04, + NBFT_SSNS_EXT_INFO_CIPEEC_IO_CTRL_DIS = 0x05, +}; + +/** + * enum nbft_ssns_ext_info_nceec - Network and Connection Extended Error Codes + * (since rev. 1.1) + * @NBFT_SSNS_EXT_INFO_NCEEC_NO_ERROR: No Extended Error Known. + * @NBFT_SSNS_EXT_INFO_NCEEC_LINK_ERR: Link Error. + * @NBFT_SSNS_EXT_INFO_NCEEC_CARRIER_ERR: Carrier Error. + * @NBFT_SSNS_EXT_INFO_NCEEC_CONN_REFUSED: Connection Refused. + * @NBFT_SSNS_EXT_INFO_NCEEC_NO_ROUTE: No Route to Host. + * @NBFT_SSNS_EXT_INFO_NCEEC_FRAG_ERR: Packet Fragmentation Error. + * @NBFT_SSNS_EXT_INFO_NCEEC_MTU_MISMATCH: MTU Mismatch. + * @NBFT_SSNS_EXT_INFO_NCEEC_NAME_RES: Name Resolution Failure. + */ +enum nbft_ssns_ext_info_nceec { + NBFT_SSNS_EXT_INFO_NCEEC_NO_ERROR = 0x00, + NBFT_SSNS_EXT_INFO_NCEEC_LINK_ERR = 0x01, + NBFT_SSNS_EXT_INFO_NCEEC_CARRIER_ERR = 0x02, + NBFT_SSNS_EXT_INFO_NCEEC_CONN_REFUSED = 0x03, + NBFT_SSNS_EXT_INFO_NCEEC_NO_ROUTE = 0x04, + NBFT_SSNS_EXT_INFO_NCEEC_FRAG_ERR = 0x05, + NBFT_SSNS_EXT_INFO_NCEEC_MTU_MISMATCH = 0x06, + NBFT_SSNS_EXT_INFO_NCEEC_NAME_RES = 0x07, +}; + /** * enum nbft_ssns_ext_info_flags - Subsystem and Namespace Extended Information * Descriptor Flags @@ -767,7 +948,7 @@ enum nbft_ssns_ext_info_flags { }; /** - * struct nbft_security - Security Profile Descriptor (Figure 22) + * struct nbft_security - Security Profile Descriptor (Figure 23) * @structure_id: Structure ID: This field shall be set to 5h * (i.e., Security; #NBFT_DESC_SECURITY). * @index: Security Profile Descriptor Index: This field indicates @@ -836,7 +1017,7 @@ struct nbft_security { }; /** - * enum nbft_security_flags - Security Profile Descriptor Flags (Figure 22/23) + * enum nbft_security_flags - Security Profile Descriptor Flags (Figure 24) * @NBFT_SECURITY_VALID: Descriptor Valid: If set to 1h, then * this descriptor is valid. If cleared * to 0h, then this descriptor is not valid. From c1fa85dd51530cd60b0e827dbdbcf2d3e8224e6d Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Mon, 13 Jul 2026 16:28:14 +0200 Subject: [PATCH 2/4] nbft: Extend the parser for Boot Specification rev. 1.3 Update the NBFT parser to handle both revision 1.0 and 1.1 NBFT files, and extend the convenient API with fields added in Boot Spec rev. 1.3. All new fields default to zero for rev. 1.0 NBFT data files. Signed-off-by: Tomas Bzatek --- libnvme/src/nvme/nbft.c | 59 +++++++++++++++++++++-- libnvme/src/nvme/nbft.h | 104 ++++++++++++++++++++++++++++++++++------ 2 files changed, 145 insertions(+), 18 deletions(-) diff --git a/libnvme/src/nvme/nbft.c b/libnvme/src/nvme/nbft.c index 586c81f791..174f6b1c2f 100644 --- a/libnvme/src/nvme/nbft.c +++ b/libnvme/src/nvme/nbft.c @@ -161,10 +161,13 @@ static struct libnbft_security *security_from_index(struct libnbft_info *nbft, static int read_ssns_exended_info(struct libnvme_global_ctx *ctx, struct libnbft_info *nbft, struct libnbft_subsystem_ns *ssns, - struct nbft_ssns_ext_info *raw_ssns_ei) + struct nbft_ssns_ext_info *raw_ssns_ei, __u16 descriptor_len) { struct nbft_header *header = (struct nbft_header *)nbft->raw_nbft; + /* Verify minimum size of the NBFT rev. 1.0 ssns_ext_info structure */ + verify(ctx, descriptor_len >= offsetof(struct nbft_ssns_ext_info, naed), + "SSNS extended info descriptor too short"); verify(ctx, raw_ssns_ei->structure_id == NBFT_DESC_SSNS_EXT_INFO, "invalid ID in SSNS extended info descriptor"); verify(ctx, raw_ssns_ei->version == 1, @@ -181,6 +184,14 @@ static int read_ssns_exended_info(struct libnvme_global_ctx *ctx, get_heap_obj(ctx, raw_ssns_ei, dhcp_root_path_str_obj, 1, &ssns->dhcp_root_path_string); + /* NBFT rev. 1.1 structure fields */ + if (descriptor_len >= sizeof(struct nbft_ssns_ext_info)) { + ssns->naed = raw_ssns_ei->naed; + ssns->cipeec = raw_ssns_ei->cipeec; + ssns->cto = le16_to_cpu(raw_ssns_ei->cto); + ssns->nceec = raw_ssns_ei->nceec; + } + return 0; } @@ -337,7 +348,8 @@ static int read_ssns(struct libnvme_global_ctx *ctx, if (!get_heap_obj(ctx, raw_ssns, ssns_extended_info_desc_obj, 0, (char **)&ssns_extended_info)) { read_ssns_exended_info(ctx, nbft, ssns, - ssns_extended_info); + ssns_extended_info, + le16_to_cpu(raw_ssns->ssns_extended_info_desc_obj.length)); } } @@ -349,6 +361,35 @@ static int read_ssns(struct libnvme_global_ctx *ctx, return ret; } +static void read_hfi_info_dhcp(struct libnvme_global_ctx *ctx, + struct libnbft_info *nbft, + struct nbft_hfi_info_ext *hfi_ext_info, + struct libnbft_hfi *hfi) +{ + struct nbft_header *header = (struct nbft_header *)nbft->raw_nbft; + char *iaid_raw = NULL; + char *duid_raw = NULL; + __u16 duid_len; + + if (hfi_ext_info->structure_id != NBFT_DESC_HFI_EXT_INFO || + hfi_ext_info->version != 1) + return; + if (!(le32_to_cpu(hfi_ext_info->flags) & NBFT_HFI_INFO_EXT_VALID)) + return; + if (!(le32_to_cpu(hfi_ext_info->flags) & NBFT_HFI_INFO_EXT_DCI)) + return; + + if (!get_heap_obj(ctx, hfi_ext_info, dhcp_iaid_obj, 0, &iaid_raw)) + hfi->tcp_info.dhcp_iaid = le32_to_cpu(*(__le32 *)iaid_raw); + if (!get_heap_obj(ctx, hfi_ext_info, dhcp_duid_obj, 0, &duid_raw)) { + duid_len = le16_to_cpu(hfi_ext_info->dhcp_duid_obj.length); + if (duid_len > sizeof(hfi->tcp_info.dhcp_duid)) + duid_len = sizeof(hfi->tcp_info.dhcp_duid); + memcpy(hfi->tcp_info.dhcp_duid, duid_raw, duid_len); + hfi->tcp_info.dhcp_duid_len = duid_len; + } +} + static int read_hfi_info_tcp(struct libnvme_global_ctx *ctx, struct libnbft_info *nbft, struct nbft_hfi_info_tcp *raw_hfi_info_tcp, @@ -396,6 +437,18 @@ static int read_hfi_info_tcp(struct libnvme_global_ctx *ctx, 1, &hfi->tcp_info.host_name); if (raw_hfi_info_tcp->flags & NBFT_HFI_INFO_TCP_GLOBAL_ROUTE) hfi->tcp_info.this_hfi_is_default_route = true; + if (raw_hfi_info_tcp->flags & NBFT_HFI_INFO_TCP_IPADDR_AUTOCONF) + hfi->tcp_info.ipaddr_autoconf = true; + + if (raw_hfi_info_tcp->trinfo_version >= 2) { + struct nbft_hfi_info_ext *hfi_ext_info; + + hfi->tcp_info.pcie_seg_num = raw_hfi_info_tcp->pcie_seg_num; + + if (!get_heap_obj(ctx, raw_hfi_info_tcp, hfi_ext_info_obj, + 0, (char **)&hfi_ext_info)) + read_hfi_info_dhcp(ctx, nbft, hfi_ext_info, hfi); + } return 0; } @@ -603,7 +656,7 @@ static int parse_raw_nbft(struct libnvme_global_ctx *ctx, struct libnbft_info *n "length in header exceeds table length"); verify(ctx, header->major_revision == 1, "unsupported major revision"); - verify(ctx, header->minor_revision == 0, + verify(ctx, header->minor_revision <= 1, "unsupported minor revision"); verify(ctx, le32_to_cpu(header->heap_length) + le32_to_cpu(header->heap_offset) <= le32_to_cpu(header->length), diff --git a/libnvme/src/nvme/nbft.h b/libnvme/src/nvme/nbft.h index f9c6a572f0..9946aa1f4d 100644 --- a/libnvme/src/nvme/nbft.h +++ b/libnvme/src/nvme/nbft.h @@ -17,18 +17,18 @@ /** * enum libnbft_primary_admin_host_flag - Primary Administrative Host Descriptor Flags * @LIBNBFT_PRIMARY_ADMIN_HOST_FLAG_NOT_INDICATED: Not Indicated by Driver: The driver - * that created this NBFT provided no - * administrative priority hint for - * this NBFT. + * that created this NBFT provided no + * administrative priority hint for + * this NBFT. * @LIBNBFT_PRIMARY_ADMIN_HOST_FLAG_UNSELECTED: Unselected: The driver that created - * this NBFT explicitly indicated that - * this NBFT should not be prioritized - * over any other NBFT. - * @LIBNBFT_PRIMARY_ADMIN_HOST_FLAG_SELECTED: Selected: The driver that created - * this NBFT explicitly indicated that - * this NBFT should be prioritized over - * any other NBFT. - * @LIBNBFT_PRIMARY_ADMIN_HOST_FLAG_RESERVED: Reserved. + * this NBFT explicitly indicated that + * this NBFT should not be prioritized + * over any other NBFT. + * @LIBNBFT_PRIMARY_ADMIN_HOST_FLAG_SELECTED: Selected: The driver that created + * this NBFT explicitly indicated that + * this NBFT should be prioritized over + * any other NBFT. + * @LIBNBFT_PRIMARY_ADMIN_HOST_FLAG_RESERVED: Reserved. */ enum libnbft_primary_admin_host_flag { LIBNBFT_PRIMARY_ADMIN_HOST_FLAG_NOT_INDICATED, @@ -90,6 +90,43 @@ struct libnbft_host { * then the HFI information was set administratively * by a configuration interface to the driver and * pre-OS envrionment. + * @ipaddr_autoconf: If True, then the IP Address, Subnet Mask Prefix, + * and IP Gateway fields were populated by an advanced + * stateless mechanism (e.g., IPv6-SLAAC or IPv6-ND). + * If True, @dhcp_override is always False and + * @ip_origin is always zero. NBFT rev. 1.1+, + * otherwise False. + * @pcie_seg_num: The PCIe Segment Number for the HFI Transport + * Function when the PCI Express Link is in Flit mode. + * Zero if not in Flit mode, not supported, or the NBFT + * data originates from a pre-NBFT rev. 1.1 driver. + * @dhcp_iaid: The DHCP Identity Association Identifier (IAID) + * as defined in RFC 4361. The IAID is a 32-bit value + * that uniquely identifies the client's network + * interface for DHCP purposes. NBFT rev. 1.1+; + * meaningful when @dhcp_duid_len is non-zero. + * @dhcp_duid: The raw DHCP Unique Identifier (DUID) as defined + * in RFC 8415 section 11 (NBFT rev. 1.1+). + * This is the complete DUID including its + * leading 2-byte type code followed by up to 128 + * bytes of type-specific identifier data. + * Known DUID type codes are: 1 (DUID-LLT, link-layer + * address plus time), 2 (DUID-EN, vendor-assigned + * based on enterprise number), 3 (DUID-LL, link-layer + * address), 4 (DUID-UUID, universally unique + * identifier). Multi-byte fields within the DUID are + * stored in little-endian byte order as specified by + * the NVMe Boot Specification. The consumer is + * responsible for parsing the type code and the + * type-specific data. This is a local copy of the + * data from the NBFT heap. This array is zero-filled + * when the DUID is not present; check @dhcp_duid_len. + * @dhcp_duid_len: The number of valid bytes in @dhcp_duid, ranging + * from 3 (minimum: 2-byte type code plus at least + * 1 byte of data) to 130 (maximum per RFC 8415). + * NBFT rev. 1.1+. A value of zero indicates that + * no DUID is present and both @dhcp_duid and + * @dhcp_iaid should be ignored. */ struct libnbft_hfi_info_tcp { __u32 pci_sbdf; @@ -106,6 +143,11 @@ struct libnbft_hfi_info_tcp { char *host_name; bool this_hfi_is_default_route; bool dhcp_override; + bool ipaddr_autoconf; + __u8 pcie_seg_num; + __u32 dhcp_iaid; + __u8 dhcp_duid[130]; + __u8 dhcp_duid_len; }; /** @@ -158,10 +200,10 @@ struct libnbft_security { * @LIBNBFT_NID_TYPE_NS_UUID: The UUID identifier. */ enum libnbft_nid_type { - LIBNBFT_NID_TYPE_NONE = 0, - LIBNBFT_NID_TYPE_EUI64 = 1, - LIBNBFT_NID_TYPE_NGUID = 2, - LIBNBFT_NID_TYPE_NS_UUID = 3, + LIBNBFT_NID_TYPE_NONE = 0, + LIBNBFT_NID_TYPE_EUI64 = 1, + LIBNBFT_NID_TYPE_NGUID = 2, + LIBNBFT_NID_TYPE_NS_UUID = 3, }; /** @@ -195,6 +237,34 @@ enum libnbft_nid_type { * Descriptor) or 0 if not supported. * @dhcp_root_path_string: DHCP Root Path Override string (SSNS Extended * Information Descriptor). + * @naed: Namespace Availability Enhanced Diagnostic + * (SSNS Extended Information Descriptor). Provides + * additional status codes from the pre-OS driver when + * the namespace is unavailable (@unavailable is True). + * See &enum nbft_ssns_ext_info_naed for values. + * Zero indicates no additional information. + * Only present in NBFT rev. 1.1+, zero otherwise. + * @cipeec: Connect Invalid Parameters Extended Error Code + * (SSNS Extended Information Descriptor). Provides + * additional error detail when the pre-OS driver + * received a Connect Invalid Parameters status. + * See &enum nbft_ssns_ext_info_cipeec for values. + * Zero indicates no extended error. + * Only present in NBFT rev. 1.1+, zero otherwise. + * @cto: Connection Timeout in seconds (SSNS Extended + * Information Descriptor). The timeout value used + * by the pre-OS driver for connecting to the object + * specified with this SSNS descriptor. A value of + * 0xFFFF indicates that no timeout was specified. + * Zero indicates either a timeout of zero seconds + * or that the field is not present (NBFT rev. 1.0). + * @nceec: Network and Connection Extended Error Code + * (SSNS Extended Information Descriptor). Provides + * error codes specific to network and connection + * errors encountered by the pre-OS driver. + * See &enum nbft_ssns_ext_info_nceec for values. + * Zero indicates no extended error. + * Only present in NBFT rev. 1.1+, zero otherwise. * @discovered: Indicates that this namespace was acquired * through discovery. * @unavailable: Namespace is unavailable as indicated by @@ -219,6 +289,10 @@ struct libnbft_subsystem_ns { int controller_id; int asqsz; char *dhcp_root_path_string; + __u8 naed; + __u8 cipeec; + __u16 cto; + __u8 nceec; bool discovered; bool unavailable; }; From 94ea44b0e1c5cb31ac90da644929592ba6777485 Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Tue, 14 Jul 2026 19:29:01 +0200 Subject: [PATCH 3/4] nbft: Use original flags instead of individual bool members Replace individual bool struct members in the nbft.h public API with raw enum bitmask fields that reuse existing enums from nvme-types-nbft.h. This prevents ABI breakage when future Boot Specification revisions add new flags to existing enums. Update nbft-dump.c to print all struct members from nbft.h and regenerate all test diffs. Update nvme.i to mirror the C API: expose raw flags instead of decoded bools. Update the nvme-cli nbft plugin JSON output with added fields while preserving the decoded bools from the old API to avoid breaking the format. Took the liberty to fully parse the DHCP DUID identifiers into individual JSON keys. Not all JSON keys are printed all the time, those not applicable either due to an older NBFT file revision or optional and not present are not printed out. Signed-off-by: Tomas Bzatek --- libnvme/libnvme3/nvme.i | 28 +- libnvme/libnvme3/tests/test-nbft.py | 27 +- libnvme/src/nvme/fabrics.c | 6 +- libnvme/src/nvme/nbft.c | 28 +- libnvme/src/nvme/nbft.h | 290 +++++++----------- ...ell.PowerEdge.R660-fw1.5.5-mpath+discovery | 158 ++++++---- .../NBFT-Dell.PowerEdge.R660-fw1.5.5-single | 31 +- .../test/nbft/diffs/NBFT-Dell.PowerEdge.R760 | 31 +- libnvme/test/nbft/diffs/NBFT-auto-ipv6 | 21 +- libnvme/test/nbft/diffs/NBFT-dhcp-ipv4 | 21 +- libnvme/test/nbft/diffs/NBFT-dhcp-ipv6 | 21 +- libnvme/test/nbft/diffs/NBFT-empty | 4 +- libnvme/test/nbft/diffs/NBFT-ipv6-noip+disc | 21 +- .../nbft/diffs/NBFT-mpath+disc-ipv4+6_half | 68 ++-- libnvme/test/nbft/diffs/NBFT-rhpoc | 21 +- libnvme/test/nbft/diffs/NBFT-static-ipv4 | 21 +- .../nbft/diffs/NBFT-static-ipv4-discovery | 21 +- libnvme/test/nbft/diffs/NBFT-static-ipv6 | 21 +- libnvme/test/nbft/nbft-dump.c | 23 +- plugins/nbft/nbft-plugin.c | 168 ++++++++-- 20 files changed, 587 insertions(+), 443 deletions(-) diff --git a/libnvme/libnvme3/nvme.i b/libnvme/libnvme3/nvme.i index 89166f9b65..1eaad674b2 100644 --- a/libnvme/libnvme3/nvme.i +++ b/libnvme/libnvme3/nvme.i @@ -340,8 +340,12 @@ static PyObject *ssns_to_dict(struct libnbft_subsystem_ns *ss) if (ss->dhcp_root_path_string) PyDict_SetItemStringDecRef(output, "dhcp_root_path_string", PyUnicode_FromString(ss->dhcp_root_path_string)); - PyDict_SetItemStringDecRef(output, "pdu_header_digest_required", PyBool_FromLong(ss->pdu_header_digest_required)); - PyDict_SetItemStringDecRef(output, "data_digest_required", PyBool_FromLong(ss->data_digest_required)); + PyDict_SetItemStringDecRef(output, "trflags", PyLong_FromLong(ss->trflags)); + PyDict_SetItemStringDecRef(output, "naed", PyLong_FromLong(ss->naed)); + PyDict_SetItemStringDecRef(output, "cipeec", PyLong_FromLong(ss->cipeec)); + PyDict_SetItemStringDecRef(output, "cto", PyLong_FromLong(ss->cto)); + PyDict_SetItemStringDecRef(output, "nceec", PyLong_FromLong(ss->nceec)); + PyDict_SetItemStringDecRef(output, "flags", PyLong_FromLong(ss->flags)); return output; } @@ -382,8 +386,15 @@ static PyObject *hfi_to_dict(struct libnbft_hfi *hfi) if (hfi->tcp_info.host_name) PyDict_SetItemStringDecRef(output, "host_name", PyUnicode_FromString(hfi->tcp_info.host_name)); - PyDict_SetItemStringDecRef(output, "this_hfi_is_default_route", PyBool_FromLong(hfi->tcp_info.this_hfi_is_default_route)); - PyDict_SetItemStringDecRef(output, "dhcp_override", PyBool_FromLong(hfi->tcp_info.dhcp_override)); + PyDict_SetItemStringDecRef(output, "flags", PyLong_FromLong(hfi->tcp_info.flags)); + PyDict_SetItemStringDecRef(output, "pcie_seg_num", PyLong_FromLong(hfi->tcp_info.pcie_seg_num)); + PyDict_SetItemStringDecRef(output, "dhcp_iaid", PyLong_FromLong(hfi->tcp_info.dhcp_iaid)); + { + PyObject *duid = PyBytes_FromStringAndSize((const char *)hfi->tcp_info.dhcp_duid, + hfi->tcp_info.dhcp_duid_len); + PyDict_SetItemStringDecRef(output, "dhcp_duid", duid); + } + PyDict_SetItemStringDecRef(output, "dhcp_duid_len", PyLong_FromLong(hfi->tcp_info.dhcp_duid_len)); } return output; @@ -407,7 +418,6 @@ static PyObject *discovery_to_dict(struct libnbft_discovery *disc) static PyObject *nbft_to_pydict(struct libnbft_info *nbft) { - PyObject *val; PyObject *output = PyDict_New(); { @@ -421,13 +431,7 @@ static PyObject *nbft_to_pydict(struct libnbft_info *nbft) PyDict_SetItemStringDecRef(host, "id", PyUnicode_FromString(uuid_str)); } - PyDict_SetItemStringDecRef(host, "host_id_configured", PyBool_FromLong(nbft->host.host_id_configured)); - PyDict_SetItemStringDecRef(host, "host_nqn_configured", PyBool_FromLong(nbft->host.host_nqn_configured)); - - val = PyUnicode_FromString(nbft->host.primary == LIBNBFT_PRIMARY_ADMIN_HOST_FLAG_NOT_INDICATED ? "not indicated" : - nbft->host.primary == LIBNBFT_PRIMARY_ADMIN_HOST_FLAG_UNSELECTED ? "unselected" : - nbft->host.primary == LIBNBFT_PRIMARY_ADMIN_HOST_FLAG_SELECTED ? "selected" : "reserved"); - PyDict_SetItemStringDecRef(host, "primary_admin_host_flag", val); + PyDict_SetItemStringDecRef(host, "flags", PyLong_FromLong(nbft->host.flags)); PyDict_SetItemStringDecRef(output, "host", host); } diff --git a/libnvme/libnvme3/tests/test-nbft.py b/libnvme/libnvme3/tests/test-nbft.py index 45cce3d7b6..378a2a15fb 100755 --- a/libnvme/libnvme3/tests/test-nbft.py +++ b/libnvme/libnvme3/tests/test-nbft.py @@ -18,57 +18,66 @@ def setUp(self): ], "hfi": [ { - "dhcp_override": True, + "dhcp_iaid": 0, + "dhcp_duid": b"", + "dhcp_duid_len": 0, "dhcp_server_ipaddr": "100.71.245.254", + "flags": 0x07, "gateway_ipaddr": "100.71.245.254", "ip_origin": 82, "ipaddr": "100.71.245.232", "mac_addr": "b0:26:28:e8:7c:0e", "pcidev": "0:40:0.0", + "pcie_seg_num": 0, "primary_dns_ipaddr": "100.64.0.5", "route_metric": 500, "secondary_dns_ipaddr": "100.64.0.6", "subnet_mask_prefix": 24, - "this_hfi_is_default_route": 1, "trtype": "tcp", "vlan": 0, } ], "host": { - "host_id_configured": True, - "host_nqn_configured": True, + "flags": 0x07, "id": "44454c4c-3400-1036-8038-b2c04f313233", "nqn": "nqn.1988-11.com.dell:PowerEdge.R760.1234567", - "primary_admin_host_flag": "not indicated", }, "subsystem": [ { "asqsz": 0, + "cipeec": 0, "controller_id": 5, - "data_digest_required": False, + "cto": 0, + "flags": 0x0051, "hfi_indexes": [0], + "naed": 0, + "nceec": 0, "nid": "c82404ed9c15f53b8ccf0968002e0fca", "nid_type": "nguid", "nsid": 148, - "pdu_header_digest_required": False, "subsys_nqn": "nqn.1988-11.com.dell:powerstore:00:2a64abf1c5b81F6C4549", "subsys_port_id": 0, "traddr": "100.71.103.48", + "trflags": 0x0000, "trsvcid": "4420", "trtype": "tcp", }, { "asqsz": 0, + "cipeec": 0, "controller_id": 4166, - "data_digest_required": False, + "cto": 0, + "flags": 0x0051, "hfi_indexes": [0], + "naed": 0, + "nceec": 0, "nid": "c82404ed9c15f53b8ccf0968002e0fca", "nid_type": "nguid", "nsid": 148, - "pdu_header_digest_required": False, "subsys_nqn": "nqn.1988-11.com.dell:powerstore:00:2a64abf1c5b81F6C4549", "subsys_port_id": 0, "traddr": "100.71.103.49", + "trflags": 0x0000, "trsvcid": "4420", "trtype": "tcp", }, diff --git a/libnvme/src/nvme/fabrics.c b/libnvme/src/nvme/fabrics.c index f7404ebea8..f73958ff4a 100644 --- a/libnvme/src/nvme/fabrics.c +++ b/libnvme/src/nvme/fabrics.c @@ -3132,7 +3132,7 @@ static int nbft_connect(struct libnvme_global_ctx *ctx, return ret; /* Pause logging for unavailable SSNSs */ - if (ss && ss->unavailable && saved_log_level < 1) + if (ss && (ss->flags & NBFT_SSNS_UNAVAIL_NAMESPACE_UNAVAIL) && saved_log_level < 1) libnvme_set_logging_level(ctx, -1, false, false); /* Update tls or concat */ @@ -3141,7 +3141,7 @@ static int nbft_connect(struct libnvme_global_ctx *ctx, ret = libnvmf_add_ctrl(h, c); /* Resume logging */ - if (ss && ss->unavailable && saved_log_level < 1) + if (ss && (ss->flags & NBFT_SSNS_UNAVAIL_NAMESPACE_UNAVAIL) && saved_log_level < 1) libnvme_set_logging_level(ctx, saved_log_level, saved_log_pid, @@ -3153,7 +3153,7 @@ static int nbft_connect(struct libnvme_global_ctx *ctx, * In case this SSNS was marked as 'unavailable' and * our connection attempt has failed, ignore it. */ - if (ss && ss->unavailable) { + if (ss && (ss->flags & NBFT_SSNS_UNAVAIL_NAMESPACE_UNAVAIL)) { libnvme_msg(ctx, LIBNVME_LOG_INFO, "SSNS %d reported as unavailable, skipping\n", ss->index); diff --git a/libnvme/src/nvme/nbft.c b/libnvme/src/nvme/nbft.c index 174f6b1c2f..6d90fc6ecb 100644 --- a/libnvme/src/nvme/nbft.c +++ b/libnvme/src/nvme/nbft.c @@ -224,14 +224,7 @@ static int read_ssns(struct libnvme_global_ctx *ctx, sizeof(ssns->transport)); /* transport specific flags */ - if (raw_ssns->trtype == NBFT_TRTYPE_TCP) { - if (le16_to_cpu(raw_ssns->trflags) & - NBFT_SSNS_PDU_HEADER_DIGEST) - ssns->pdu_header_digest_required = true; - if (le16_to_cpu(raw_ssns->trflags) & - NBFT_SSNS_DATA_DIGEST) - ssns->data_digest_required = true; - } + ssns->trflags = le16_to_cpu(raw_ssns->trflags); /* primary discovery controller */ if (raw_ssns->primary_discovery_ctrl_index) { @@ -265,10 +258,7 @@ static int read_ssns(struct libnvme_global_ctx *ctx, ssns->nid = raw_ssns->nid; /* flags */ - ssns->unavailable = !!(le16_to_cpu(raw_ssns->flags) & - NBFT_SSNS_UNAVAIL_NAMESPACE_UNAVAIL); - ssns->discovered = !!(le16_to_cpu(raw_ssns->flags) & - NBFT_SSNS_DISCOVERED_NAMESPACE); + ssns->flags = le16_to_cpu(raw_ssns->flags); /* security profile */ if (raw_ssns->security_desc_index) { @@ -427,18 +417,13 @@ static int read_hfi_info_tcp(struct libnvme_global_ctx *ctx, format_ip_addr(hfi->tcp_info.secondary_dns_ipaddr, sizeof(hfi->tcp_info.secondary_dns_ipaddr), raw_hfi_info_tcp->secondary_dns); - if (raw_hfi_info_tcp->flags & NBFT_HFI_INFO_TCP_DHCP_OVERRIDE) { - hfi->tcp_info.dhcp_override = true; + hfi->tcp_info.flags = raw_hfi_info_tcp->flags; + if (raw_hfi_info_tcp->flags & NBFT_HFI_INFO_TCP_DHCP_OVERRIDE) format_ip_addr(hfi->tcp_info.dhcp_server_ipaddr, sizeof(hfi->tcp_info.dhcp_server_ipaddr), raw_hfi_info_tcp->dhcp_server); - } get_heap_obj(ctx, raw_hfi_info_tcp, host_name_obj, 1, &hfi->tcp_info.host_name); - if (raw_hfi_info_tcp->flags & NBFT_HFI_INFO_TCP_GLOBAL_ROUTE) - hfi->tcp_info.this_hfi_is_default_route = true; - if (raw_hfi_info_tcp->flags & NBFT_HFI_INFO_TCP_IPADDR_AUTOCONF) - hfi->tcp_info.ipaddr_autoconf = true; if (raw_hfi_info_tcp->trinfo_version >= 2) { struct nbft_hfi_info_ext *hfi_ext_info; @@ -690,10 +675,7 @@ static int parse_raw_nbft(struct libnvme_global_ctx *ctx, struct libnbft_info *n nbft->host.id = (unsigned char *) &(host->host_id); if (get_heap_obj(ctx, host, host_nqn_obj, 1, &nbft->host.nqn) != 0) return -EINVAL; - nbft->host.host_id_configured = - host->flags & NBFT_HOST_HOSTID_CONFIGURED; - nbft->host.host_nqn_configured = - host->flags & NBFT_HOST_HOSTNQN_CONFIGURED; + nbft->host.flags = host->flags; /* * HFI diff --git a/libnvme/src/nvme/nbft.h b/libnvme/src/nvme/nbft.h index 9946aa1f4d..115d0c0ccb 100644 --- a/libnvme/src/nvme/nbft.h +++ b/libnvme/src/nvme/nbft.h @@ -8,125 +8,78 @@ */ #pragma once -#include - #include #include -/** - * enum libnbft_primary_admin_host_flag - Primary Administrative Host Descriptor Flags - * @LIBNBFT_PRIMARY_ADMIN_HOST_FLAG_NOT_INDICATED: Not Indicated by Driver: The driver - * that created this NBFT provided no - * administrative priority hint for - * this NBFT. - * @LIBNBFT_PRIMARY_ADMIN_HOST_FLAG_UNSELECTED: Unselected: The driver that created - * this NBFT explicitly indicated that - * this NBFT should not be prioritized - * over any other NBFT. - * @LIBNBFT_PRIMARY_ADMIN_HOST_FLAG_SELECTED: Selected: The driver that created - * this NBFT explicitly indicated that - * this NBFT should be prioritized over - * any other NBFT. - * @LIBNBFT_PRIMARY_ADMIN_HOST_FLAG_RESERVED: Reserved. - */ -enum libnbft_primary_admin_host_flag { - LIBNBFT_PRIMARY_ADMIN_HOST_FLAG_NOT_INDICATED, - LIBNBFT_PRIMARY_ADMIN_HOST_FLAG_UNSELECTED, - LIBNBFT_PRIMARY_ADMIN_HOST_FLAG_SELECTED, - LIBNBFT_PRIMARY_ADMIN_HOST_FLAG_RESERVED, -}; - /** * struct libnbft_host - Host Descriptor - * @id: Host ID (raw UUID, length = 16 bytes). - * @nqn: Host NQN. - * @host_id_configured: HostID Configured Flag: value of True indicates that @id - * contains administratively-configured value, or driver - * default value if False. - * @host_nqn_configured: Host NQN Configured Flag: value of True indicates that - * @nqn contains administratively-configured value, - * or driver default value if False. - * @primary: Primary Administrative Host Descriptor, see - * &enum libnbft_primary_admin_host_flag. + * @id: Host ID (raw UUID, length = 16 bytes). + * @nqn: Host NQN. + * @flags: Host Descriptor Flags bitmask, see &enum nbft_host_flags. */ struct libnbft_host { unsigned char *id; char *nqn; - bool host_id_configured; - bool host_nqn_configured; - enum libnbft_primary_admin_host_flag primary; + __u8 flags; }; /** * struct libnbft_hfi_info_tcp - HFI Transport Info Descriptor - NVMe/TCP - * @pci_sbdf: PCI Express Routing ID for the HFI Transport Function. - * @mac_addr: MAC Address: The MAC address of this HFI, - * in EUI-48TM format. - * @vlan: The 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_origin: The source of Ethernet L3 configuration information - * used by the driver or 0 if not used. - * @ipaddr: The IPv4 or IPv6 address of this HFI. - * @subnet_mask_prefix: The IPv4 or IPv6 subnet mask in CIDR routing prefix - * notation. - * @gateway_ipaddr: The IPv4 or IPv6 address of the IP gateway for this - * HFI or zeroes if no IP gateway is specified. - * @route_metric: The cost value for the route indicated by this HFI. - * @primary_dns_ipaddr: The IPv4 or IPv6 address of the Primary DNS server - * for this HFI. - * @secondary_dns_ipaddr: The IPv4 or IPv6 address of the Secondary DNS server - * for this HFI. - * @dhcp_server_ipaddr: The IPv4 or IPv6 address of the DHCP server used - * to assign this HFI address. - * @host_name: The Host Name string. - * @this_hfi_is_default_route: If 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_override: If 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. - * @ipaddr_autoconf: If True, then the IP Address, Subnet Mask Prefix, - * and IP Gateway fields were populated by an advanced - * stateless mechanism (e.g., IPv6-SLAAC or IPv6-ND). - * If True, @dhcp_override is always False and - * @ip_origin is always zero. NBFT rev. 1.1+, - * otherwise False. - * @pcie_seg_num: The PCIe Segment Number for the HFI Transport - * Function when the PCI Express Link is in Flit mode. - * Zero if not in Flit mode, not supported, or the NBFT - * data originates from a pre-NBFT rev. 1.1 driver. - * @dhcp_iaid: The DHCP Identity Association Identifier (IAID) - * as defined in RFC 4361. The IAID is a 32-bit value - * that uniquely identifies the client's network - * interface for DHCP purposes. NBFT rev. 1.1+; - * meaningful when @dhcp_duid_len is non-zero. - * @dhcp_duid: The raw DHCP Unique Identifier (DUID) as defined - * in RFC 8415 section 11 (NBFT rev. 1.1+). - * This is the complete DUID including its - * leading 2-byte type code followed by up to 128 - * bytes of type-specific identifier data. - * Known DUID type codes are: 1 (DUID-LLT, link-layer - * address plus time), 2 (DUID-EN, vendor-assigned - * based on enterprise number), 3 (DUID-LL, link-layer - * address), 4 (DUID-UUID, universally unique - * identifier). Multi-byte fields within the DUID are - * stored in little-endian byte order as specified by - * the NVMe Boot Specification. The consumer is - * responsible for parsing the type code and the - * type-specific data. This is a local copy of the - * data from the NBFT heap. This array is zero-filled - * when the DUID is not present; check @dhcp_duid_len. - * @dhcp_duid_len: The number of valid bytes in @dhcp_duid, ranging - * from 3 (minimum: 2-byte type code plus at least - * 1 byte of data) to 130 (maximum per RFC 8415). - * NBFT rev. 1.1+. A value of zero indicates that - * no DUID is present and both @dhcp_duid and - * @dhcp_iaid should be ignored. + * @pci_sbdf: PCI Express Routing ID for the HFI Transport Function. + * @mac_addr: MAC Address: The MAC address of this HFI, + * in EUI-48TM format. + * @vlan: The 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_origin: The source of Ethernet L3 configuration information + * used by the driver or 0 if not used. + * @ipaddr: The IPv4 or IPv6 address of this HFI. + * @subnet_mask_prefix: The IPv4 or IPv6 subnet mask in CIDR routing prefix + * notation. + * @gateway_ipaddr: The IPv4 or IPv6 address of the IP gateway for this + * HFI or zeroes if no IP gateway is specified. + * @route_metric: The cost value for the route indicated by this HFI. + * @primary_dns_ipaddr: The IPv4 or IPv6 address of the Primary DNS server + * for this HFI. + * @secondary_dns_ipaddr: The IPv4 or IPv6 address of the Secondary DNS server + * for this HFI. + * @dhcp_server_ipaddr: The IPv4 or IPv6 address of the DHCP server used + * to assign this HFI address. + * @host_name: The Host Name string. + * @flags: HFI Transport Flags bitmask, + * see &enum nbft_hfi_info_tcp_flags. + * @pcie_seg_num: The PCIe Segment Number for the HFI Transport + * Function when the PCI Express Link is in Flit mode. + * Zero if not in Flit mode, not supported, or the NBFT + * data originates from a pre-NBFT rev. 1.1 driver. + * @dhcp_iaid: The DHCP Identity Association Identifier (IAID) + * as defined in RFC 4361. The IAID is a 32-bit value + * that uniquely identifies the client's network + * interface for DHCP purposes. NBFT rev. 1.1+; + * meaningful when @dhcp_duid_len is non-zero. + * @dhcp_duid: The raw DHCP Unique Identifier (DUID) as defined + * in RFC 8415 section 11 (NBFT rev. 1.1+). + * This is the complete DUID including its + * leading 2-byte type code followed by up to 128 + * bytes of type-specific identifier data. + * Known DUID type codes are: 1 (DUID-LLT, link-layer + * address plus time), 2 (DUID-EN, vendor-assigned + * based on enterprise number), 3 (DUID-LL, link-layer + * address), 4 (DUID-UUID, universally unique + * identifier). Multi-byte fields within the DUID are + * stored in little-endian byte order as specified by + * the NVMe Boot Specification. The consumer is + * responsible for parsing the type code and the + * type-specific data. This is a local copy of the + * data from the NBFT heap. This array is zero-filled + * when the DUID is not present; check @dhcp_duid_len. + * @dhcp_duid_len: The number of valid bytes in @dhcp_duid, ranging + * from 3 (minimum: 2-byte type code plus at least + * 1 byte of data) to 130 (maximum per RFC 8415). + * NBFT rev. 1.1+. A value of zero indicates that + * no DUID is present and both @dhcp_duid and + * @dhcp_iaid should be ignored. */ struct libnbft_hfi_info_tcp { __u32 pci_sbdf; @@ -141,9 +94,7 @@ struct libnbft_hfi_info_tcp { char secondary_dns_ipaddr[40]; char dhcp_server_ipaddr[40]; char *host_name; - bool this_hfi_is_default_route; - bool dhcp_override; - bool ipaddr_autoconf; + __u8 flags; __u8 pcie_seg_num; __u32 dhcp_iaid; __u8 dhcp_duid[130]; @@ -208,67 +159,62 @@ enum libnbft_nid_type { /** * struct libnbft_subsystem_ns - Subsystem Namespace (SSNS) info - * @index: SSNS Descriptor Index in the descriptor list. - * @discovery: Primary Discovery Controller associated with - * this SSNS Descriptor. - * @security: Security Profile Descriptor associated with - * this namespace. - * @num_hfis: Number of HFIs. - * @hfis: List of HFIs associated with this namespace. - * Includes the primary HFI at the first position - * and all secondary HFIs. This array is null-terminated. - * @transport: Transport Type string (e.g. 'tcp'). - * @traddr: Subsystem Transport Address. - * @trsvcid: Subsystem Transport Service Identifier. - * @subsys_port_id: The Subsystem Port ID. - * @nsid: The Namespace ID of this descriptor or when @nid - * should be used instead. - * @nid_type: Namespace Identifier Type, see &enum libnbft_nid_type. - * @nid: The Namespace Identifier value. - * @subsys_nqn: Subsystem and Namespace NQN. - * @pdu_header_digest_required: PDU Header Digest (HDGST) Flag: the use of NVM Header - * Digest Enabled is required. - * @data_digest_required: Data Digest (DDGST) Flag: the use of NVM Data Digest - * Enabled is required. - * @controller_id: Controller ID (SSNS Extended Information Descriptor): - * The controller ID associated with the Admin Queue - * or 0 if not supported. - * @asqsz: Admin Submission Queue Size (SSNS Extended Information - * Descriptor) or 0 if not supported. - * @dhcp_root_path_string: DHCP Root Path Override string (SSNS Extended - * Information Descriptor). - * @naed: Namespace Availability Enhanced Diagnostic - * (SSNS Extended Information Descriptor). Provides - * additional status codes from the pre-OS driver when - * the namespace is unavailable (@unavailable is True). - * See &enum nbft_ssns_ext_info_naed for values. - * Zero indicates no additional information. - * Only present in NBFT rev. 1.1+, zero otherwise. - * @cipeec: Connect Invalid Parameters Extended Error Code - * (SSNS Extended Information Descriptor). Provides - * additional error detail when the pre-OS driver - * received a Connect Invalid Parameters status. - * See &enum nbft_ssns_ext_info_cipeec for values. - * Zero indicates no extended error. - * Only present in NBFT rev. 1.1+, zero otherwise. - * @cto: Connection Timeout in seconds (SSNS Extended - * Information Descriptor). The timeout value used - * by the pre-OS driver for connecting to the object - * specified with this SSNS descriptor. A value of - * 0xFFFF indicates that no timeout was specified. - * Zero indicates either a timeout of zero seconds - * or that the field is not present (NBFT rev. 1.0). - * @nceec: Network and Connection Extended Error Code - * (SSNS Extended Information Descriptor). Provides - * error codes specific to network and connection - * errors encountered by the pre-OS driver. - * See &enum nbft_ssns_ext_info_nceec for values. - * Zero indicates no extended error. - * Only present in NBFT rev. 1.1+, zero otherwise. - * @discovered: Indicates that this namespace was acquired - * through discovery. - * @unavailable: Namespace is unavailable as indicated by - * the pre-OS driver. + * @index: SSNS Descriptor Index in the descriptor list. + * @discovery: Primary Discovery Controller associated with + * this SSNS Descriptor. + * @security: Security Profile Descriptor associated with + * this namespace. + * @num_hfis: Number of HFIs. + * @hfis: List of HFIs associated with this namespace. + * Includes the primary HFI at the first position + * and all secondary HFIs. This array is null-terminated. + * @transport: Transport Type string (e.g. 'tcp'). + * @traddr: Subsystem Transport Address. + * @trsvcid: Subsystem Transport Service Identifier. + * @subsys_port_id: The Subsystem Port ID. + * @nsid: The Namespace ID of this descriptor or when @nid + * should be used instead. + * @nid_type: Namespace Identifier Type, see &enum libnbft_nid_type. + * @nid: The Namespace Identifier value. + * @subsys_nqn: Subsystem and Namespace NQN. + * @trflags: Transport Specific Flags bitmask, + * see &enum nbft_ssns_trflags. + * @controller_id: Controller ID (SSNS Extended Information Descriptor): + * The controller ID associated with the Admin Queue + * or 0 if not supported. + * @asqsz: Admin Submission Queue Size (SSNS Extended Information + * Descriptor) or 0 if not supported. + * @dhcp_root_path_string: DHCP Root Path Override string (SSNS Extended + * Information Descriptor). + * @naed: Namespace Availability Enhanced Diagnostic + * (SSNS Extended Information Descriptor). Provides + * additional status codes from the pre-OS driver when + * the namespace is unavailable. + * See &enum nbft_ssns_ext_info_naed for values. + * Zero indicates no additional information. + * Only present in NBFT rev. 1.1+, zero otherwise. + * @cipeec: Connect Invalid Parameters Extended Error Code + * (SSNS Extended Information Descriptor). Provides + * additional error detail when the pre-OS driver + * received a Connect Invalid Parameters status. + * See &enum nbft_ssns_ext_info_cipeec for values. + * Zero indicates no extended error. + * Only present in NBFT rev. 1.1+, zero otherwise. + * @cto: Connection Timeout in seconds (SSNS Extended + * Information Descriptor). The timeout value used + * by the pre-OS driver for connecting to the object + * specified with this SSNS descriptor. A value of + * 0xFFFF indicates that no timeout was specified. + * Zero indicates either a timeout of zero seconds + * or that the field is not present (NBFT rev. 1.0). + * @nceec: Network and Connection Extended Error Code + * (SSNS Extended Information Descriptor). Provides + * error codes specific to network and connection + * errors encountered by the pre-OS driver. + * See &enum nbft_ssns_ext_info_nceec for values. + * Zero indicates no extended error. + * Only present in NBFT rev. 1.1+, zero otherwise. + * @flags: SSNS Flags bitmask, see &enum nbft_ssns_flags. */ struct libnbft_subsystem_ns { int index; @@ -284,8 +230,7 @@ struct libnbft_subsystem_ns { enum libnbft_nid_type nid_type; __u8 *nid; char *subsys_nqn; - bool pdu_header_digest_required; - bool data_digest_required; + __u16 trflags; int controller_id; int asqsz; char *dhcp_root_path_string; @@ -293,8 +238,7 @@ struct libnbft_subsystem_ns { __u8 cipeec; __u16 cto; __u8 nceec; - bool discovered; - bool unavailable; + __u16 flags; }; /** diff --git a/libnvme/test/nbft/diffs/NBFT-Dell.PowerEdge.R660-fw1.5.5-mpath+discovery b/libnvme/test/nbft/diffs/NBFT-Dell.PowerEdge.R660-fw1.5.5-mpath+discovery index 7d44d9225e..fecb15fa54 100644 --- a/libnvme/test/nbft/diffs/NBFT-Dell.PowerEdge.R660-fw1.5.5-mpath+discovery +++ b/libnvme/test/nbft/diffs/NBFT-Dell.PowerEdge.R660-fw1.5.5-mpath+discovery @@ -1,9 +1,7 @@ raw_nbft_size=4147 host.id=44454c4c44010448030b8c04f445833 host.nqn=nqn.2014-08.org.nvmexpress:uuid:4c4c4544-0044-4410-8030-b8c04f445833 -host.host_id_configured=1 -host.host_nqn_configured=1 -host.primary=0 +host.flags=0x07 hfi_list[0]->index=1 hfi_list[0]->transport=tcp hfi_list[0]->tcp_info.pci_sbdf=27136 @@ -18,8 +16,11 @@ hfi_list[0]->tcp_info.primary_dns_ipaddr=0.0.0.0 hfi_list[0]->tcp_info.secondary_dns_ipaddr=0.0.0.0 hfi_list[0]->tcp_info.dhcp_server_ipaddr= hfi_list[0]->tcp_info.host_name=(null) -hfi_list[0]->tcp_info.this_hfi_is_default_route=1 -hfi_list[0]->tcp_info.dhcp_override=0 +hfi_list[0]->tcp_info.flags=0x03 +hfi_list[0]->tcp_info.pcie_seg_num=0 +hfi_list[0]->tcp_info.dhcp_iaid=0 +hfi_list[0]->tcp_info.dhcp_duid= +hfi_list[0]->tcp_info.dhcp_duid_len=0 hfi_list[1]->index=2 hfi_list[1]->transport=tcp hfi_list[1]->tcp_info.pci_sbdf=27137 @@ -34,8 +35,11 @@ hfi_list[1]->tcp_info.primary_dns_ipaddr=0.0.0.0 hfi_list[1]->tcp_info.secondary_dns_ipaddr=0.0.0.0 hfi_list[1]->tcp_info.dhcp_server_ipaddr= hfi_list[1]->tcp_info.host_name=(null) -hfi_list[1]->tcp_info.this_hfi_is_default_route=1 -hfi_list[1]->tcp_info.dhcp_override=0 +hfi_list[1]->tcp_info.flags=0x03 +hfi_list[1]->tcp_info.pcie_seg_num=0 +hfi_list[1]->tcp_info.dhcp_iaid=0 +hfi_list[1]->tcp_info.dhcp_duid= +hfi_list[1]->tcp_info.dhcp_duid_len=0 discovery_list[0]->index=1 discovery_list[0]->hfi->index=1 discovery_list[0]->uri=nvme+tcp://172.18.240.70:8009/ @@ -56,13 +60,15 @@ subsystem_ns_list[0]->nsid=270 subsystem_ns_list[0]->nid_type=2 subsystem_ns_list[0]->nid=5380b42fc0c5de718ccf9680be3ca7 subsystem_ns_list[0]->subsys_nqn=nqn.1988-11.com.dell:powerstore:00:88b402df2d762AA7AF94 -subsystem_ns_list[0]->pdu_header_digest_required=0 -subsystem_ns_list[0]->data_digest_required=0 +subsystem_ns_list[0]->trflags=0x0000 subsystem_ns_list[0]->controller_id=4186 subsystem_ns_list[0]->asqsz=0 subsystem_ns_list[0]->dhcp_root_path_string=(null) -subsystem_ns_list[0]->discovered=1 -subsystem_ns_list[0]->unavailable=0 +subsystem_ns_list[0]->naed=0x00 +subsystem_ns_list[0]->cipeec=0x00 +subsystem_ns_list[0]->cto=0 +subsystem_ns_list[0]->nceec=0x00 +subsystem_ns_list[0]->flags=0x0051 subsystem_ns_list[1]->index=2 subsystem_ns_list[1]->discovery->index=1 subsystem_ns_list[1]->num_hfis=1 @@ -75,13 +81,15 @@ subsystem_ns_list[1]->nsid=1671 subsystem_ns_list[1]->nid_type=2 subsystem_ns_list[1]->nid=f4c66fce74afdb8ccf96807eaeae subsystem_ns_list[1]->subsys_nqn=nqn.1988-11.com.dell:powerstore:00:88b402df2d762AA7AF94 -subsystem_ns_list[1]->pdu_header_digest_required=0 -subsystem_ns_list[1]->data_digest_required=0 +subsystem_ns_list[1]->trflags=0x0000 subsystem_ns_list[1]->controller_id=4186 subsystem_ns_list[1]->asqsz=0 subsystem_ns_list[1]->dhcp_root_path_string=(null) -subsystem_ns_list[1]->discovered=1 -subsystem_ns_list[1]->unavailable=0 +subsystem_ns_list[1]->naed=0x00 +subsystem_ns_list[1]->cipeec=0x00 +subsystem_ns_list[1]->cto=0 +subsystem_ns_list[1]->nceec=0x00 +subsystem_ns_list[1]->flags=0x0051 subsystem_ns_list[2]->index=3 subsystem_ns_list[2]->discovery->index=1 subsystem_ns_list[2]->num_hfis=1 @@ -94,13 +102,15 @@ subsystem_ns_list[2]->nsid=270 subsystem_ns_list[2]->nid_type=2 subsystem_ns_list[2]->nid=5380b42fc0c5de718ccf9680be3ca7 subsystem_ns_list[2]->subsys_nqn=nqn.1988-11.com.dell:powerstore:00:88b402df2d762AA7AF94 -subsystem_ns_list[2]->pdu_header_digest_required=0 -subsystem_ns_list[2]->data_digest_required=0 +subsystem_ns_list[2]->trflags=0x0000 subsystem_ns_list[2]->controller_id=52 subsystem_ns_list[2]->asqsz=0 subsystem_ns_list[2]->dhcp_root_path_string=(null) -subsystem_ns_list[2]->discovered=1 -subsystem_ns_list[2]->unavailable=0 +subsystem_ns_list[2]->naed=0x00 +subsystem_ns_list[2]->cipeec=0x00 +subsystem_ns_list[2]->cto=0 +subsystem_ns_list[2]->nceec=0x00 +subsystem_ns_list[2]->flags=0x0051 subsystem_ns_list[3]->index=4 subsystem_ns_list[3]->discovery->index=1 subsystem_ns_list[3]->num_hfis=1 @@ -113,13 +123,15 @@ subsystem_ns_list[3]->nsid=1671 subsystem_ns_list[3]->nid_type=2 subsystem_ns_list[3]->nid=f4c66fce74afdb8ccf96807eaeae subsystem_ns_list[3]->subsys_nqn=nqn.1988-11.com.dell:powerstore:00:88b402df2d762AA7AF94 -subsystem_ns_list[3]->pdu_header_digest_required=0 -subsystem_ns_list[3]->data_digest_required=0 +subsystem_ns_list[3]->trflags=0x0000 subsystem_ns_list[3]->controller_id=52 subsystem_ns_list[3]->asqsz=0 subsystem_ns_list[3]->dhcp_root_path_string=(null) -subsystem_ns_list[3]->discovered=1 -subsystem_ns_list[3]->unavailable=0 +subsystem_ns_list[3]->naed=0x00 +subsystem_ns_list[3]->cipeec=0x00 +subsystem_ns_list[3]->cto=0 +subsystem_ns_list[3]->nceec=0x00 +subsystem_ns_list[3]->flags=0x0051 subsystem_ns_list[4]->index=5 subsystem_ns_list[4]->discovery->index=1 subsystem_ns_list[4]->num_hfis=1 @@ -132,13 +144,15 @@ subsystem_ns_list[4]->nsid=1 subsystem_ns_list[4]->nid_type=3 subsystem_ns_list[4]->nid=6be5e52f7fa24d57805b8cdce240e4c subsystem_ns_list[4]->subsys_nqn=nqn.1992-08.com.netapp:sn.643ecb551e6b11eda647d039ea98949f:subsystem.dellr660 -subsystem_ns_list[4]->pdu_header_digest_required=0 -subsystem_ns_list[4]->data_digest_required=0 +subsystem_ns_list[4]->trflags=0x0000 subsystem_ns_list[4]->controller_id=6209 subsystem_ns_list[4]->asqsz=0 subsystem_ns_list[4]->dhcp_root_path_string=(null) -subsystem_ns_list[4]->discovered=1 -subsystem_ns_list[4]->unavailable=0 +subsystem_ns_list[4]->naed=0x00 +subsystem_ns_list[4]->cipeec=0x00 +subsystem_ns_list[4]->cto=0 +subsystem_ns_list[4]->nceec=0x00 +subsystem_ns_list[4]->flags=0x0051 subsystem_ns_list[5]->index=6 subsystem_ns_list[5]->discovery->index=1 subsystem_ns_list[5]->num_hfis=1 @@ -151,13 +165,15 @@ subsystem_ns_list[5]->nsid=1 subsystem_ns_list[5]->nid_type=3 subsystem_ns_list[5]->nid=6be5e52f7fa24d57805b8cdce240e4c subsystem_ns_list[5]->subsys_nqn=nqn.1992-08.com.netapp:sn.643ecb551e6b11eda647d039ea98949f:subsystem.dellr660 -subsystem_ns_list[5]->pdu_header_digest_required=0 -subsystem_ns_list[5]->data_digest_required=0 +subsystem_ns_list[5]->trflags=0x0000 subsystem_ns_list[5]->controller_id=6208 subsystem_ns_list[5]->asqsz=0 subsystem_ns_list[5]->dhcp_root_path_string=(null) -subsystem_ns_list[5]->discovered=1 -subsystem_ns_list[5]->unavailable=0 +subsystem_ns_list[5]->naed=0x00 +subsystem_ns_list[5]->cipeec=0x00 +subsystem_ns_list[5]->cto=0 +subsystem_ns_list[5]->nceec=0x00 +subsystem_ns_list[5]->flags=0x0051 subsystem_ns_list[6]->index=7 subsystem_ns_list[6]->discovery->index=1 subsystem_ns_list[6]->num_hfis=1 @@ -170,13 +186,15 @@ subsystem_ns_list[6]->nsid=0 subsystem_ns_list[6]->nid_type=0 subsystem_ns_list[6]->nid=0000000000000000 subsystem_ns_list[6]->subsys_nqn=nqn.1992-08.com.netapp:sn.643ecb551e6b11eda647d039ea98949f:subsystem.dellr660 -subsystem_ns_list[6]->pdu_header_digest_required=0 -subsystem_ns_list[6]->data_digest_required=0 +subsystem_ns_list[6]->trflags=0x0000 subsystem_ns_list[6]->controller_id=6208 subsystem_ns_list[6]->asqsz=0 subsystem_ns_list[6]->dhcp_root_path_string=(null) -subsystem_ns_list[6]->discovered=1 -subsystem_ns_list[6]->unavailable=1 +subsystem_ns_list[6]->naed=0x00 +subsystem_ns_list[6]->cipeec=0x00 +subsystem_ns_list[6]->cto=0 +subsystem_ns_list[6]->nceec=0x00 +subsystem_ns_list[6]->flags=0x0151 subsystem_ns_list[7]->index=8 subsystem_ns_list[7]->discovery->index=1 subsystem_ns_list[7]->num_hfis=1 @@ -189,13 +207,15 @@ subsystem_ns_list[7]->nsid=0 subsystem_ns_list[7]->nid_type=0 subsystem_ns_list[7]->nid=0000000000000000 subsystem_ns_list[7]->subsys_nqn=nqn.1992-08.com.netapp:sn.643ecb551e6b11eda647d039ea98949f:subsystem.dellr660 -subsystem_ns_list[7]->pdu_header_digest_required=0 -subsystem_ns_list[7]->data_digest_required=0 +subsystem_ns_list[7]->trflags=0x0000 subsystem_ns_list[7]->controller_id=6208 subsystem_ns_list[7]->asqsz=0 subsystem_ns_list[7]->dhcp_root_path_string=(null) -subsystem_ns_list[7]->discovered=1 -subsystem_ns_list[7]->unavailable=1 +subsystem_ns_list[7]->naed=0x00 +subsystem_ns_list[7]->cipeec=0x00 +subsystem_ns_list[7]->cto=0 +subsystem_ns_list[7]->nceec=0x00 +subsystem_ns_list[7]->flags=0x0151 subsystem_ns_list[8]->index=9 subsystem_ns_list[8]->discovery->index=2 subsystem_ns_list[8]->num_hfis=1 @@ -208,13 +228,15 @@ subsystem_ns_list[8]->nsid=270 subsystem_ns_list[8]->nid_type=2 subsystem_ns_list[8]->nid=5380b42fc0c5de718ccf9680be3ca7 subsystem_ns_list[8]->subsys_nqn=nqn.1988-11.com.dell:powerstore:00:88b402df2d762AA7AF94 -subsystem_ns_list[8]->pdu_header_digest_required=0 -subsystem_ns_list[8]->data_digest_required=0 +subsystem_ns_list[8]->trflags=0x0000 subsystem_ns_list[8]->controller_id=51 subsystem_ns_list[8]->asqsz=0 subsystem_ns_list[8]->dhcp_root_path_string=(null) -subsystem_ns_list[8]->discovered=1 -subsystem_ns_list[8]->unavailable=0 +subsystem_ns_list[8]->naed=0x00 +subsystem_ns_list[8]->cipeec=0x00 +subsystem_ns_list[8]->cto=0 +subsystem_ns_list[8]->nceec=0x00 +subsystem_ns_list[8]->flags=0x0051 subsystem_ns_list[9]->index=10 subsystem_ns_list[9]->discovery->index=2 subsystem_ns_list[9]->num_hfis=1 @@ -227,13 +249,15 @@ subsystem_ns_list[9]->nsid=1671 subsystem_ns_list[9]->nid_type=2 subsystem_ns_list[9]->nid=f4c66fce74afdb8ccf96807eaeae subsystem_ns_list[9]->subsys_nqn=nqn.1988-11.com.dell:powerstore:00:88b402df2d762AA7AF94 -subsystem_ns_list[9]->pdu_header_digest_required=0 -subsystem_ns_list[9]->data_digest_required=0 +subsystem_ns_list[9]->trflags=0x0000 subsystem_ns_list[9]->controller_id=51 subsystem_ns_list[9]->asqsz=0 subsystem_ns_list[9]->dhcp_root_path_string=(null) -subsystem_ns_list[9]->discovered=1 -subsystem_ns_list[9]->unavailable=0 +subsystem_ns_list[9]->naed=0x00 +subsystem_ns_list[9]->cipeec=0x00 +subsystem_ns_list[9]->cto=0 +subsystem_ns_list[9]->nceec=0x00 +subsystem_ns_list[9]->flags=0x0051 subsystem_ns_list[10]->index=11 subsystem_ns_list[10]->discovery->index=2 subsystem_ns_list[10]->num_hfis=1 @@ -246,13 +270,15 @@ subsystem_ns_list[10]->nsid=270 subsystem_ns_list[10]->nid_type=2 subsystem_ns_list[10]->nid=5380b42fc0c5de718ccf9680be3ca7 subsystem_ns_list[10]->subsys_nqn=nqn.1988-11.com.dell:powerstore:00:88b402df2d762AA7AF94 -subsystem_ns_list[10]->pdu_header_digest_required=0 -subsystem_ns_list[10]->data_digest_required=0 +subsystem_ns_list[10]->trflags=0x0000 subsystem_ns_list[10]->controller_id=4185 subsystem_ns_list[10]->asqsz=0 subsystem_ns_list[10]->dhcp_root_path_string=(null) -subsystem_ns_list[10]->discovered=1 -subsystem_ns_list[10]->unavailable=0 +subsystem_ns_list[10]->naed=0x00 +subsystem_ns_list[10]->cipeec=0x00 +subsystem_ns_list[10]->cto=0 +subsystem_ns_list[10]->nceec=0x00 +subsystem_ns_list[10]->flags=0x0051 subsystem_ns_list[11]->index=12 subsystem_ns_list[11]->discovery->index=2 subsystem_ns_list[11]->num_hfis=1 @@ -265,13 +291,15 @@ subsystem_ns_list[11]->nsid=1671 subsystem_ns_list[11]->nid_type=2 subsystem_ns_list[11]->nid=f4c66fce74afdb8ccf96807eaeae subsystem_ns_list[11]->subsys_nqn=nqn.1988-11.com.dell:powerstore:00:88b402df2d762AA7AF94 -subsystem_ns_list[11]->pdu_header_digest_required=0 -subsystem_ns_list[11]->data_digest_required=0 +subsystem_ns_list[11]->trflags=0x0000 subsystem_ns_list[11]->controller_id=4185 subsystem_ns_list[11]->asqsz=0 subsystem_ns_list[11]->dhcp_root_path_string=(null) -subsystem_ns_list[11]->discovered=1 -subsystem_ns_list[11]->unavailable=0 +subsystem_ns_list[11]->naed=0x00 +subsystem_ns_list[11]->cipeec=0x00 +subsystem_ns_list[11]->cto=0 +subsystem_ns_list[11]->nceec=0x00 +subsystem_ns_list[11]->flags=0x0051 subsystem_ns_list[12]->index=13 subsystem_ns_list[12]->discovery->index=2 subsystem_ns_list[12]->num_hfis=1 @@ -284,13 +312,15 @@ subsystem_ns_list[12]->nsid=1 subsystem_ns_list[12]->nid_type=3 subsystem_ns_list[12]->nid=6be5e52f7fa24d57805b8cdce240e4c subsystem_ns_list[12]->subsys_nqn=nqn.1992-08.com.netapp:sn.643ecb551e6b11eda647d039ea98949f:subsystem.dellr660 -subsystem_ns_list[12]->pdu_header_digest_required=0 -subsystem_ns_list[12]->data_digest_required=0 +subsystem_ns_list[12]->trflags=0x0000 subsystem_ns_list[12]->controller_id=6273 subsystem_ns_list[12]->asqsz=0 subsystem_ns_list[12]->dhcp_root_path_string=(null) -subsystem_ns_list[12]->discovered=1 -subsystem_ns_list[12]->unavailable=0 +subsystem_ns_list[12]->naed=0x00 +subsystem_ns_list[12]->cipeec=0x00 +subsystem_ns_list[12]->cto=0 +subsystem_ns_list[12]->nceec=0x00 +subsystem_ns_list[12]->flags=0x0051 subsystem_ns_list[13]->index=14 subsystem_ns_list[13]->discovery->index=2 subsystem_ns_list[13]->num_hfis=1 @@ -303,10 +333,12 @@ subsystem_ns_list[13]->nsid=1 subsystem_ns_list[13]->nid_type=3 subsystem_ns_list[13]->nid=6be5e52f7fa24d57805b8cdce240e4c subsystem_ns_list[13]->subsys_nqn=nqn.1992-08.com.netapp:sn.643ecb551e6b11eda647d039ea98949f:subsystem.dellr660 -subsystem_ns_list[13]->pdu_header_digest_required=0 -subsystem_ns_list[13]->data_digest_required=0 +subsystem_ns_list[13]->trflags=0x0000 subsystem_ns_list[13]->controller_id=6272 subsystem_ns_list[13]->asqsz=0 subsystem_ns_list[13]->dhcp_root_path_string=(null) -subsystem_ns_list[13]->discovered=1 -subsystem_ns_list[13]->unavailable=0 +subsystem_ns_list[13]->naed=0x00 +subsystem_ns_list[13]->cipeec=0x00 +subsystem_ns_list[13]->cto=0 +subsystem_ns_list[13]->nceec=0x00 +subsystem_ns_list[13]->flags=0x0051 diff --git a/libnvme/test/nbft/diffs/NBFT-Dell.PowerEdge.R660-fw1.5.5-single b/libnvme/test/nbft/diffs/NBFT-Dell.PowerEdge.R660-fw1.5.5-single index 17631fb338..9a4f76363d 100644 --- a/libnvme/test/nbft/diffs/NBFT-Dell.PowerEdge.R660-fw1.5.5-single +++ b/libnvme/test/nbft/diffs/NBFT-Dell.PowerEdge.R660-fw1.5.5-single @@ -1,9 +1,7 @@ raw_nbft_size=930 host.id=44454c4c44010448030b8c04f445833 host.nqn=nqn.2014-08.org.nvmexpress:uuid:4c4c4544-0044-4410-8030-b8c04f445833 -host.host_id_configured=1 -host.host_nqn_configured=1 -host.primary=0 +host.flags=0x07 hfi_list[0]->index=1 hfi_list[0]->transport=tcp hfi_list[0]->tcp_info.pci_sbdf=27136 @@ -18,8 +16,11 @@ hfi_list[0]->tcp_info.primary_dns_ipaddr=0.0.0.0 hfi_list[0]->tcp_info.secondary_dns_ipaddr=0.0.0.0 hfi_list[0]->tcp_info.dhcp_server_ipaddr= hfi_list[0]->tcp_info.host_name=(null) -hfi_list[0]->tcp_info.this_hfi_is_default_route=1 -hfi_list[0]->tcp_info.dhcp_override=0 +hfi_list[0]->tcp_info.flags=0x03 +hfi_list[0]->tcp_info.pcie_seg_num=0 +hfi_list[0]->tcp_info.dhcp_iaid=0 +hfi_list[0]->tcp_info.dhcp_duid= +hfi_list[0]->tcp_info.dhcp_duid_len=0 subsystem_ns_list[0]->index=1 subsystem_ns_list[0]->num_hfis=1 subsystem_ns_list[0]->hfis[0]->index=1 @@ -31,13 +32,15 @@ subsystem_ns_list[0]->nsid=270 subsystem_ns_list[0]->nid_type=2 subsystem_ns_list[0]->nid=5380b42fc0c5de718ccf9680be3ca7 subsystem_ns_list[0]->subsys_nqn=nqn.1988-11.com.dell:powerstore:00:88b402df2d762AA7AF94 -subsystem_ns_list[0]->pdu_header_digest_required=0 -subsystem_ns_list[0]->data_digest_required=0 +subsystem_ns_list[0]->trflags=0x0000 subsystem_ns_list[0]->controller_id=4105 subsystem_ns_list[0]->asqsz=0 subsystem_ns_list[0]->dhcp_root_path_string=(null) -subsystem_ns_list[0]->discovered=0 -subsystem_ns_list[0]->unavailable=0 +subsystem_ns_list[0]->naed=0x00 +subsystem_ns_list[0]->cipeec=0x00 +subsystem_ns_list[0]->cto=0 +subsystem_ns_list[0]->nceec=0x00 +subsystem_ns_list[0]->flags=0x0011 subsystem_ns_list[1]->index=2 subsystem_ns_list[1]->num_hfis=1 subsystem_ns_list[1]->hfis[0]->index=1 @@ -49,10 +52,12 @@ subsystem_ns_list[1]->nsid=1671 subsystem_ns_list[1]->nid_type=2 subsystem_ns_list[1]->nid=f4c66fce74afdb8ccf96807eaeae subsystem_ns_list[1]->subsys_nqn=nqn.1988-11.com.dell:powerstore:00:88b402df2d762AA7AF94 -subsystem_ns_list[1]->pdu_header_digest_required=0 -subsystem_ns_list[1]->data_digest_required=0 +subsystem_ns_list[1]->trflags=0x0000 subsystem_ns_list[1]->controller_id=4105 subsystem_ns_list[1]->asqsz=0 subsystem_ns_list[1]->dhcp_root_path_string=(null) -subsystem_ns_list[1]->discovered=0 -subsystem_ns_list[1]->unavailable=0 +subsystem_ns_list[1]->naed=0x00 +subsystem_ns_list[1]->cipeec=0x00 +subsystem_ns_list[1]->cto=0 +subsystem_ns_list[1]->nceec=0x00 +subsystem_ns_list[1]->flags=0x0011 diff --git a/libnvme/test/nbft/diffs/NBFT-Dell.PowerEdge.R760 b/libnvme/test/nbft/diffs/NBFT-Dell.PowerEdge.R760 index 5bb854cd61..fc6fab3c5d 100644 --- a/libnvme/test/nbft/diffs/NBFT-Dell.PowerEdge.R760 +++ b/libnvme/test/nbft/diffs/NBFT-Dell.PowerEdge.R760 @@ -1,9 +1,7 @@ raw_nbft_size=1017 host.id=44454c4c34010368038b2c04f313233 host.nqn=nqn.1988-11.com.dell:PowerEdge.R760.1234567 -host.host_id_configured=1 -host.host_nqn_configured=1 -host.primary=0 +host.flags=0x07 hfi_list[0]->index=1 hfi_list[0]->transport=tcp hfi_list[0]->tcp_info.pci_sbdf=16384 @@ -18,8 +16,11 @@ hfi_list[0]->tcp_info.primary_dns_ipaddr=100.64.0.5 hfi_list[0]->tcp_info.secondary_dns_ipaddr=100.64.0.6 hfi_list[0]->tcp_info.dhcp_server_ipaddr=100.71.245.254 hfi_list[0]->tcp_info.host_name=(null) -hfi_list[0]->tcp_info.this_hfi_is_default_route=1 -hfi_list[0]->tcp_info.dhcp_override=1 +hfi_list[0]->tcp_info.flags=0x07 +hfi_list[0]->tcp_info.pcie_seg_num=0 +hfi_list[0]->tcp_info.dhcp_iaid=0 +hfi_list[0]->tcp_info.dhcp_duid= +hfi_list[0]->tcp_info.dhcp_duid_len=0 discovery_list[0]->index=1 discovery_list[0]->hfi->index=1 discovery_list[0]->uri=nvme+tcp://100.71.103.50:8009/ @@ -36,13 +37,15 @@ subsystem_ns_list[0]->nsid=148 subsystem_ns_list[0]->nid_type=2 subsystem_ns_list[0]->nid=c8244ed9c15f53b8ccf96802efca subsystem_ns_list[0]->subsys_nqn=nqn.1988-11.com.dell:powerstore:00:2a64abf1c5b81F6C4549 -subsystem_ns_list[0]->pdu_header_digest_required=0 -subsystem_ns_list[0]->data_digest_required=0 +subsystem_ns_list[0]->trflags=0x0000 subsystem_ns_list[0]->controller_id=5 subsystem_ns_list[0]->asqsz=0 subsystem_ns_list[0]->dhcp_root_path_string=(null) -subsystem_ns_list[0]->discovered=1 -subsystem_ns_list[0]->unavailable=0 +subsystem_ns_list[0]->naed=0x00 +subsystem_ns_list[0]->cipeec=0x00 +subsystem_ns_list[0]->cto=0 +subsystem_ns_list[0]->nceec=0x00 +subsystem_ns_list[0]->flags=0x0051 subsystem_ns_list[1]->index=2 subsystem_ns_list[1]->discovery->index=1 subsystem_ns_list[1]->num_hfis=1 @@ -55,10 +58,12 @@ subsystem_ns_list[1]->nsid=148 subsystem_ns_list[1]->nid_type=2 subsystem_ns_list[1]->nid=c8244ed9c15f53b8ccf96802efca subsystem_ns_list[1]->subsys_nqn=nqn.1988-11.com.dell:powerstore:00:2a64abf1c5b81F6C4549 -subsystem_ns_list[1]->pdu_header_digest_required=0 -subsystem_ns_list[1]->data_digest_required=0 +subsystem_ns_list[1]->trflags=0x0000 subsystem_ns_list[1]->controller_id=4166 subsystem_ns_list[1]->asqsz=0 subsystem_ns_list[1]->dhcp_root_path_string=(null) -subsystem_ns_list[1]->discovered=1 -subsystem_ns_list[1]->unavailable=0 +subsystem_ns_list[1]->naed=0x00 +subsystem_ns_list[1]->cipeec=0x00 +subsystem_ns_list[1]->cto=0 +subsystem_ns_list[1]->nceec=0x00 +subsystem_ns_list[1]->flags=0x0051 diff --git a/libnvme/test/nbft/diffs/NBFT-auto-ipv6 b/libnvme/test/nbft/diffs/NBFT-auto-ipv6 index 4e19830945..43c9c6c49d 100644 --- a/libnvme/test/nbft/diffs/NBFT-auto-ipv6 +++ b/libnvme/test/nbft/diffs/NBFT-auto-ipv6 @@ -1,9 +1,7 @@ raw_nbft_size=721 host.id=1ee8b170eb4c864fb7957d179e201a host.nqn=nqn.2014-08.org.nvmexpress:uuid:70b1e81e-4ceb-4f86-b709-57d1079e201a -host.host_id_configured=1 -host.host_nqn_configured=1 -host.primary=0 +host.flags=0x07 hfi_list[0]->index=1 hfi_list[0]->transport=tcp hfi_list[0]->tcp_info.pci_sbdf=512 @@ -18,8 +16,11 @@ hfi_list[0]->tcp_info.primary_dns_ipaddr=:: hfi_list[0]->tcp_info.secondary_dns_ipaddr=:: hfi_list[0]->tcp_info.dhcp_server_ipaddr= hfi_list[0]->tcp_info.host_name=nvmepoc-sles15-sp5 -hfi_list[0]->tcp_info.this_hfi_is_default_route=1 -hfi_list[0]->tcp_info.dhcp_override=0 +hfi_list[0]->tcp_info.flags=0x03 +hfi_list[0]->tcp_info.pcie_seg_num=0 +hfi_list[0]->tcp_info.dhcp_iaid=0 +hfi_list[0]->tcp_info.dhcp_duid= +hfi_list[0]->tcp_info.dhcp_duid_len=0 subsystem_ns_list[0]->index=1 subsystem_ns_list[0]->num_hfis=1 subsystem_ns_list[0]->hfis[0]->index=1 @@ -31,10 +32,12 @@ subsystem_ns_list[0]->nsid=1 subsystem_ns_list[0]->nid_type=3 subsystem_ns_list[0]->nid=848f4dc06d394968bf180569b8eea97 subsystem_ns_list[0]->subsys_nqn=nqn.2022-12.de.suse.mwilck:zeus.vagrant-nvmet.subsys04 -subsystem_ns_list[0]->pdu_header_digest_required=0 -subsystem_ns_list[0]->data_digest_required=0 +subsystem_ns_list[0]->trflags=0x0000 subsystem_ns_list[0]->controller_id=1 subsystem_ns_list[0]->asqsz=0 subsystem_ns_list[0]->dhcp_root_path_string=(null) -subsystem_ns_list[0]->discovered=0 -subsystem_ns_list[0]->unavailable=0 +subsystem_ns_list[0]->naed=0x00 +subsystem_ns_list[0]->cipeec=0x00 +subsystem_ns_list[0]->cto=0 +subsystem_ns_list[0]->nceec=0x00 +subsystem_ns_list[0]->flags=0x0011 diff --git a/libnvme/test/nbft/diffs/NBFT-dhcp-ipv4 b/libnvme/test/nbft/diffs/NBFT-dhcp-ipv4 index 4c9c61cb3d..27ba5d210d 100644 --- a/libnvme/test/nbft/diffs/NBFT-dhcp-ipv4 +++ b/libnvme/test/nbft/diffs/NBFT-dhcp-ipv4 @@ -1,9 +1,7 @@ raw_nbft_size=825 host.id=e359b7a15d37747b3cc1754b8b819b9 host.nqn=nqn.2014-08.org.nvmexpress:uuid:a1b759e3-035d-4777-b3cc-1754b8b819b9 -host.host_id_configured=1 -host.host_nqn_configured=1 -host.primary=0 +host.flags=0x07 hfi_list[0]->index=1 hfi_list[0]->transport=tcp hfi_list[0]->tcp_info.pci_sbdf=8 @@ -18,8 +16,11 @@ hfi_list[0]->tcp_info.primary_dns_ipaddr=192.168.49.1 hfi_list[0]->tcp_info.secondary_dns_ipaddr=0.0.0.0 hfi_list[0]->tcp_info.dhcp_server_ipaddr=192.168.49.1 hfi_list[0]->tcp_info.host_name=nvmeof-sles -hfi_list[0]->tcp_info.this_hfi_is_default_route=1 -hfi_list[0]->tcp_info.dhcp_override=1 +hfi_list[0]->tcp_info.flags=0x07 +hfi_list[0]->tcp_info.pcie_seg_num=0 +hfi_list[0]->tcp_info.dhcp_iaid=0 +hfi_list[0]->tcp_info.dhcp_duid= +hfi_list[0]->tcp_info.dhcp_duid_len=0 discovery_list[0]->index=1 discovery_list[0]->hfi->index=1 discovery_list[0]->uri=nvme+tcp://192.168.49.10:4420/ @@ -36,10 +37,12 @@ subsystem_ns_list[0]->nsid=1 subsystem_ns_list[0]->nid_type=3 subsystem_ns_list[0]->nid=df669a88bd6f4dd68a505f97eb55c835 subsystem_ns_list[0]->subsys_nqn=nqn.2022-12.org.nvmexpress.boot.poc:bremer.vagrant-nvmet.subsys02 -subsystem_ns_list[0]->pdu_header_digest_required=0 -subsystem_ns_list[0]->data_digest_required=0 +subsystem_ns_list[0]->trflags=0x0000 subsystem_ns_list[0]->controller_id=7 subsystem_ns_list[0]->asqsz=0 subsystem_ns_list[0]->dhcp_root_path_string=(null) -subsystem_ns_list[0]->discovered=1 -subsystem_ns_list[0]->unavailable=0 +subsystem_ns_list[0]->naed=0x00 +subsystem_ns_list[0]->cipeec=0x00 +subsystem_ns_list[0]->cto=0 +subsystem_ns_list[0]->nceec=0x00 +subsystem_ns_list[0]->flags=0x0051 diff --git a/libnvme/test/nbft/diffs/NBFT-dhcp-ipv6 b/libnvme/test/nbft/diffs/NBFT-dhcp-ipv6 index 27c54fd7b9..957ab96fad 100644 --- a/libnvme/test/nbft/diffs/NBFT-dhcp-ipv6 +++ b/libnvme/test/nbft/diffs/NBFT-dhcp-ipv6 @@ -1,9 +1,7 @@ raw_nbft_size=725 host.id=e359b7a15d37747b3cc1754b8b819b9 host.nqn=nqn.2014-08.org.nvmexpress:uuid:a1b759e3-035d-4777-b3cc-1754b8b819b9 -host.host_id_configured=1 -host.host_nqn_configured=1 -host.primary=0 +host.flags=0x07 hfi_list[0]->index=1 hfi_list[0]->transport=tcp hfi_list[0]->tcp_info.pci_sbdf=8 @@ -18,8 +16,11 @@ hfi_list[0]->tcp_info.primary_dns_ipaddr=:: hfi_list[0]->tcp_info.secondary_dns_ipaddr=:: hfi_list[0]->tcp_info.dhcp_server_ipaddr=:: hfi_list[0]->tcp_info.host_name=nvmeof-sles -hfi_list[0]->tcp_info.this_hfi_is_default_route=1 -hfi_list[0]->tcp_info.dhcp_override=1 +hfi_list[0]->tcp_info.flags=0x07 +hfi_list[0]->tcp_info.pcie_seg_num=0 +hfi_list[0]->tcp_info.dhcp_iaid=0 +hfi_list[0]->tcp_info.dhcp_duid= +hfi_list[0]->tcp_info.dhcp_duid_len=0 subsystem_ns_list[0]->index=1 subsystem_ns_list[0]->num_hfis=1 subsystem_ns_list[0]->hfis[0]->index=1 @@ -31,10 +32,12 @@ subsystem_ns_list[0]->nsid=1 subsystem_ns_list[0]->nid_type=3 subsystem_ns_list[0]->nid=df669a88bd6f4dd68a505f97eb55c835 subsystem_ns_list[0]->subsys_nqn=nqn.2022-12.org.nvmexpress.boot.poc:bremer.vagrant-nvmet.subsys02 -subsystem_ns_list[0]->pdu_header_digest_required=0 -subsystem_ns_list[0]->data_digest_required=0 +subsystem_ns_list[0]->trflags=0x0000 subsystem_ns_list[0]->controller_id=34 subsystem_ns_list[0]->asqsz=0 subsystem_ns_list[0]->dhcp_root_path_string=(null) -subsystem_ns_list[0]->discovered=0 -subsystem_ns_list[0]->unavailable=0 +subsystem_ns_list[0]->naed=0x00 +subsystem_ns_list[0]->cipeec=0x00 +subsystem_ns_list[0]->cto=0 +subsystem_ns_list[0]->nceec=0x00 +subsystem_ns_list[0]->flags=0x0011 diff --git a/libnvme/test/nbft/diffs/NBFT-empty b/libnvme/test/nbft/diffs/NBFT-empty index b8b84e15d2..1cc8981630 100644 --- a/libnvme/test/nbft/diffs/NBFT-empty +++ b/libnvme/test/nbft/diffs/NBFT-empty @@ -1,6 +1,4 @@ raw_nbft_size=315 host.id=78563412aaaabbbbcccc123456789012 host.nqn=nqn.2014-08.org.nvmexpress:uuid:12345678-aaaa-bbbb-cccc-123456789012 -host.host_id_configured=1 -host.host_nqn_configured=1 -host.primary=0 +host.flags=0x07 diff --git a/libnvme/test/nbft/diffs/NBFT-ipv6-noip+disc b/libnvme/test/nbft/diffs/NBFT-ipv6-noip+disc index 620912f1c5..a185440319 100644 --- a/libnvme/test/nbft/diffs/NBFT-ipv6-noip+disc +++ b/libnvme/test/nbft/diffs/NBFT-ipv6-noip+disc @@ -1,9 +1,7 @@ raw_nbft_size=785 host.id=78563412aaaabbbbcccc123456789012 host.nqn=nqn.2014-08.org.nvmexpress:uuid:12345678-aaaa-bbbb-cccc-123456789012 -host.host_id_configured=1 -host.host_nqn_configured=1 -host.primary=0 +host.flags=0x07 hfi_list[0]->index=1 hfi_list[0]->transport=tcp hfi_list[0]->tcp_info.pci_sbdf=3329 @@ -18,8 +16,11 @@ hfi_list[0]->tcp_info.primary_dns_ipaddr=:: hfi_list[0]->tcp_info.secondary_dns_ipaddr=:: hfi_list[0]->tcp_info.dhcp_server_ipaddr=:: hfi_list[0]->tcp_info.host_name=(null) -hfi_list[0]->tcp_info.this_hfi_is_default_route=1 -hfi_list[0]->tcp_info.dhcp_override=1 +hfi_list[0]->tcp_info.flags=0x07 +hfi_list[0]->tcp_info.pcie_seg_num=0 +hfi_list[0]->tcp_info.dhcp_iaid=0 +hfi_list[0]->tcp_info.dhcp_duid= +hfi_list[0]->tcp_info.dhcp_duid_len=0 discovery_list[0]->index=1 discovery_list[0]->hfi->index=1 discovery_list[0]->uri=nvme+tcp://[4321:BBBB::1]:4420/ @@ -36,10 +37,12 @@ subsystem_ns_list[0]->nsid=0 subsystem_ns_list[0]->nid_type=0 subsystem_ns_list[0]->nid=0000000000000000 subsystem_ns_list[0]->subsys_nqn=nqn.2014-08.org.nvmexpress.discovery -subsystem_ns_list[0]->pdu_header_digest_required=0 -subsystem_ns_list[0]->data_digest_required=0 +subsystem_ns_list[0]->trflags=0x0000 subsystem_ns_list[0]->controller_id=0 subsystem_ns_list[0]->asqsz=0 subsystem_ns_list[0]->dhcp_root_path_string=(null) -subsystem_ns_list[0]->discovered=1 -subsystem_ns_list[0]->unavailable=1 +subsystem_ns_list[0]->naed=0x00 +subsystem_ns_list[0]->cipeec=0x00 +subsystem_ns_list[0]->cto=0 +subsystem_ns_list[0]->nceec=0x00 +subsystem_ns_list[0]->flags=0x0151 diff --git a/libnvme/test/nbft/diffs/NBFT-mpath+disc-ipv4+6_half b/libnvme/test/nbft/diffs/NBFT-mpath+disc-ipv4+6_half index 1e1d678c79..a3d4e9c836 100644 --- a/libnvme/test/nbft/diffs/NBFT-mpath+disc-ipv4+6_half +++ b/libnvme/test/nbft/diffs/NBFT-mpath+disc-ipv4+6_half @@ -1,9 +1,7 @@ raw_nbft_size=1922 host.id=12345678abcdabcdabcd123456789012 host.nqn=nqn.2014-08.org.nvmexpress:uuid:12345678-abcd-abcd-abcd-123456789012 -host.host_id_configured=1 -host.host_nqn_configured=1 -host.primary=0 +host.flags=0x07 hfi_list[0]->index=1 hfi_list[0]->transport=tcp hfi_list[0]->tcp_info.pci_sbdf=24 @@ -18,8 +16,11 @@ hfi_list[0]->tcp_info.primary_dns_ipaddr=0.0.0.0 hfi_list[0]->tcp_info.secondary_dns_ipaddr=0.0.0.0 hfi_list[0]->tcp_info.dhcp_server_ipaddr= hfi_list[0]->tcp_info.host_name=(null) -hfi_list[0]->tcp_info.this_hfi_is_default_route=1 -hfi_list[0]->tcp_info.dhcp_override=0 +hfi_list[0]->tcp_info.flags=0x03 +hfi_list[0]->tcp_info.pcie_seg_num=0 +hfi_list[0]->tcp_info.dhcp_iaid=0 +hfi_list[0]->tcp_info.dhcp_duid= +hfi_list[0]->tcp_info.dhcp_duid_len=0 hfi_list[1]->index=2 hfi_list[1]->transport=tcp hfi_list[1]->tcp_info.pci_sbdf=32 @@ -34,8 +35,11 @@ hfi_list[1]->tcp_info.primary_dns_ipaddr=:: hfi_list[1]->tcp_info.secondary_dns_ipaddr=:: hfi_list[1]->tcp_info.dhcp_server_ipaddr= hfi_list[1]->tcp_info.host_name=(null) -hfi_list[1]->tcp_info.this_hfi_is_default_route=1 -hfi_list[1]->tcp_info.dhcp_override=0 +hfi_list[1]->tcp_info.flags=0x03 +hfi_list[1]->tcp_info.pcie_seg_num=0 +hfi_list[1]->tcp_info.dhcp_iaid=0 +hfi_list[1]->tcp_info.dhcp_duid= +hfi_list[1]->tcp_info.dhcp_duid_len=0 discovery_list[0]->index=1 discovery_list[0]->hfi->index=1 discovery_list[0]->uri=nvme+tcp://192.168.122.1:4420/ @@ -56,13 +60,15 @@ subsystem_ns_list[0]->nsid=123 subsystem_ns_list[0]->nid_type=3 subsystem_ns_list[0]->nid=d592cdf3ffffffff84123fcf7d99df27 subsystem_ns_list[0]->subsys_nqn=nqn.2014-08.org.nvmexpress.boot.poc:test-target -subsystem_ns_list[0]->pdu_header_digest_required=0 -subsystem_ns_list[0]->data_digest_required=0 +subsystem_ns_list[0]->trflags=0x0000 subsystem_ns_list[0]->controller_id=0 subsystem_ns_list[0]->asqsz=0 subsystem_ns_list[0]->dhcp_root_path_string=(null) -subsystem_ns_list[0]->discovered=1 -subsystem_ns_list[0]->unavailable=0 +subsystem_ns_list[0]->naed=0x00 +subsystem_ns_list[0]->cipeec=0x00 +subsystem_ns_list[0]->cto=0 +subsystem_ns_list[0]->nceec=0x00 +subsystem_ns_list[0]->flags=0x0051 subsystem_ns_list[1]->index=2 subsystem_ns_list[1]->discovery->index=1 subsystem_ns_list[1]->num_hfis=1 @@ -75,13 +81,15 @@ subsystem_ns_list[1]->nsid=201 subsystem_ns_list[1]->nid_type=3 subsystem_ns_list[1]->nid=9b9e1b6ea02c427fbdeb2a0be9cb945 subsystem_ns_list[1]->subsys_nqn=nqn.2014-08.org.nvmexpress.boot.poc:test-target -subsystem_ns_list[1]->pdu_header_digest_required=0 -subsystem_ns_list[1]->data_digest_required=0 +subsystem_ns_list[1]->trflags=0x0000 subsystem_ns_list[1]->controller_id=0 subsystem_ns_list[1]->asqsz=0 subsystem_ns_list[1]->dhcp_root_path_string=(null) -subsystem_ns_list[1]->discovered=1 -subsystem_ns_list[1]->unavailable=0 +subsystem_ns_list[1]->naed=0x00 +subsystem_ns_list[1]->cipeec=0x00 +subsystem_ns_list[1]->cto=0 +subsystem_ns_list[1]->nceec=0x00 +subsystem_ns_list[1]->flags=0x0051 subsystem_ns_list[2]->index=3 subsystem_ns_list[2]->discovery->index=1 subsystem_ns_list[2]->num_hfis=1 @@ -94,13 +102,15 @@ subsystem_ns_list[2]->nsid=202 subsystem_ns_list[2]->nid_type=3 subsystem_ns_list[2]->nid=5353d4e551a40f492a563231b833c5 subsystem_ns_list[2]->subsys_nqn=nqn.2014-08.org.nvmexpress.boot.poc:test-target -subsystem_ns_list[2]->pdu_header_digest_required=0 -subsystem_ns_list[2]->data_digest_required=0 +subsystem_ns_list[2]->trflags=0x0000 subsystem_ns_list[2]->controller_id=0 subsystem_ns_list[2]->asqsz=0 subsystem_ns_list[2]->dhcp_root_path_string=(null) -subsystem_ns_list[2]->discovered=1 -subsystem_ns_list[2]->unavailable=0 +subsystem_ns_list[2]->naed=0x00 +subsystem_ns_list[2]->cipeec=0x00 +subsystem_ns_list[2]->cto=0 +subsystem_ns_list[2]->nceec=0x00 +subsystem_ns_list[2]->flags=0x0051 subsystem_ns_list[3]->index=4 subsystem_ns_list[3]->discovery->index=1 subsystem_ns_list[3]->num_hfis=1 @@ -113,13 +123,15 @@ subsystem_ns_list[3]->nsid=203 subsystem_ns_list[3]->nid_type=3 subsystem_ns_list[3]->nid=fb13e6ffac2940c0a988cb1c17d39f4b subsystem_ns_list[3]->subsys_nqn=nqn.2014-08.org.nvmexpress.boot.poc:test-target -subsystem_ns_list[3]->pdu_header_digest_required=0 -subsystem_ns_list[3]->data_digest_required=0 +subsystem_ns_list[3]->trflags=0x0000 subsystem_ns_list[3]->controller_id=0 subsystem_ns_list[3]->asqsz=0 subsystem_ns_list[3]->dhcp_root_path_string=(null) -subsystem_ns_list[3]->discovered=1 -subsystem_ns_list[3]->unavailable=0 +subsystem_ns_list[3]->naed=0x00 +subsystem_ns_list[3]->cipeec=0x00 +subsystem_ns_list[3]->cto=0 +subsystem_ns_list[3]->nceec=0x00 +subsystem_ns_list[3]->flags=0x0051 subsystem_ns_list[4]->index=5 subsystem_ns_list[4]->discovery->index=2 subsystem_ns_list[4]->num_hfis=1 @@ -132,10 +144,12 @@ subsystem_ns_list[4]->nsid=0 subsystem_ns_list[4]->nid_type=0 subsystem_ns_list[4]->nid=0000000000000000 subsystem_ns_list[4]->subsys_nqn=nqn.2014-08.org.nvmexpress.discovery -subsystem_ns_list[4]->pdu_header_digest_required=0 -subsystem_ns_list[4]->data_digest_required=0 +subsystem_ns_list[4]->trflags=0x0000 subsystem_ns_list[4]->controller_id=0 subsystem_ns_list[4]->asqsz=0 subsystem_ns_list[4]->dhcp_root_path_string=(null) -subsystem_ns_list[4]->discovered=1 -subsystem_ns_list[4]->unavailable=1 +subsystem_ns_list[4]->naed=0x00 +subsystem_ns_list[4]->cipeec=0x00 +subsystem_ns_list[4]->cto=0 +subsystem_ns_list[4]->nceec=0x00 +subsystem_ns_list[4]->flags=0x0151 diff --git a/libnvme/test/nbft/diffs/NBFT-rhpoc b/libnvme/test/nbft/diffs/NBFT-rhpoc index 027ea4021a..38fd07779d 100644 --- a/libnvme/test/nbft/diffs/NBFT-rhpoc +++ b/libnvme/test/nbft/diffs/NBFT-rhpoc @@ -1,9 +1,7 @@ raw_nbft_size=724 host.id=b4bb164e7f9be448c7f77d8b4fc9f39 host.nqn=nqn.2014-08.org.nvmexpress:uuid:f8131bac-cdef-4165-866b-5998c1e67890 -host.host_id_configured=1 -host.host_nqn_configured=1 -host.primary=0 +host.flags=0x07 hfi_list[0]->index=1 hfi_list[0]->transport=tcp hfi_list[0]->tcp_info.pci_sbdf=40 @@ -18,8 +16,11 @@ hfi_list[0]->tcp_info.primary_dns_ipaddr=0.0.0.0 hfi_list[0]->tcp_info.secondary_dns_ipaddr=0.0.0.0 hfi_list[0]->tcp_info.dhcp_server_ipaddr= hfi_list[0]->tcp_info.host_name=host-vm -hfi_list[0]->tcp_info.this_hfi_is_default_route=1 -hfi_list[0]->tcp_info.dhcp_override=0 +hfi_list[0]->tcp_info.flags=0x03 +hfi_list[0]->tcp_info.pcie_seg_num=0 +hfi_list[0]->tcp_info.dhcp_iaid=0 +hfi_list[0]->tcp_info.dhcp_duid= +hfi_list[0]->tcp_info.dhcp_duid_len=0 subsystem_ns_list[0]->index=1 subsystem_ns_list[0]->num_hfis=1 subsystem_ns_list[0]->hfis[0]->index=1 @@ -31,10 +32,12 @@ subsystem_ns_list[0]->nsid=1 subsystem_ns_list[0]->nid_type=3 subsystem_ns_list[0]->nid=bee9c2b7176144b5a4e6f69498a94b subsystem_ns_list[0]->subsys_nqn=nqn.2014-08.org.nvmexpress:uuid:0c468c4d-a385-47e0-8299-6e95051277db -subsystem_ns_list[0]->pdu_header_digest_required=0 -subsystem_ns_list[0]->data_digest_required=0 +subsystem_ns_list[0]->trflags=0x0000 subsystem_ns_list[0]->controller_id=12 subsystem_ns_list[0]->asqsz=0 subsystem_ns_list[0]->dhcp_root_path_string=(null) -subsystem_ns_list[0]->discovered=0 -subsystem_ns_list[0]->unavailable=0 +subsystem_ns_list[0]->naed=0x00 +subsystem_ns_list[0]->cipeec=0x00 +subsystem_ns_list[0]->cto=0 +subsystem_ns_list[0]->nceec=0x00 +subsystem_ns_list[0]->flags=0x0011 diff --git a/libnvme/test/nbft/diffs/NBFT-static-ipv4 b/libnvme/test/nbft/diffs/NBFT-static-ipv4 index 697d0e537c..26808120f8 100644 --- a/libnvme/test/nbft/diffs/NBFT-static-ipv4 +++ b/libnvme/test/nbft/diffs/NBFT-static-ipv4 @@ -1,9 +1,7 @@ raw_nbft_size=725 host.id=e359b7a15d37747b3cc1754b8b819b9 host.nqn=nqn.2014-08.org.nvmexpress:uuid:a1b759e3-035d-4777-b3cc-1754b8b819b9 -host.host_id_configured=1 -host.host_nqn_configured=1 -host.primary=0 +host.flags=0x07 hfi_list[0]->index=1 hfi_list[0]->transport=tcp hfi_list[0]->tcp_info.pci_sbdf=8 @@ -18,8 +16,11 @@ hfi_list[0]->tcp_info.primary_dns_ipaddr=0.0.0.0 hfi_list[0]->tcp_info.secondary_dns_ipaddr=0.0.0.0 hfi_list[0]->tcp_info.dhcp_server_ipaddr= hfi_list[0]->tcp_info.host_name=nvmeof-sles -hfi_list[0]->tcp_info.this_hfi_is_default_route=1 -hfi_list[0]->tcp_info.dhcp_override=0 +hfi_list[0]->tcp_info.flags=0x03 +hfi_list[0]->tcp_info.pcie_seg_num=0 +hfi_list[0]->tcp_info.dhcp_iaid=0 +hfi_list[0]->tcp_info.dhcp_duid= +hfi_list[0]->tcp_info.dhcp_duid_len=0 subsystem_ns_list[0]->index=1 subsystem_ns_list[0]->num_hfis=1 subsystem_ns_list[0]->hfis[0]->index=1 @@ -31,10 +32,12 @@ subsystem_ns_list[0]->nsid=1 subsystem_ns_list[0]->nid_type=3 subsystem_ns_list[0]->nid=df669a88bd6f4dd68a505f97eb55c835 subsystem_ns_list[0]->subsys_nqn=nqn.2022-12.org.nvmexpress.boot.poc:bremer.vagrant-nvmet.subsys02 -subsystem_ns_list[0]->pdu_header_digest_required=0 -subsystem_ns_list[0]->data_digest_required=0 +subsystem_ns_list[0]->trflags=0x0000 subsystem_ns_list[0]->controller_id=38 subsystem_ns_list[0]->asqsz=0 subsystem_ns_list[0]->dhcp_root_path_string=(null) -subsystem_ns_list[0]->discovered=0 -subsystem_ns_list[0]->unavailable=0 +subsystem_ns_list[0]->naed=0x00 +subsystem_ns_list[0]->cipeec=0x00 +subsystem_ns_list[0]->cto=0 +subsystem_ns_list[0]->nceec=0x00 +subsystem_ns_list[0]->flags=0x0011 diff --git a/libnvme/test/nbft/diffs/NBFT-static-ipv4-discovery b/libnvme/test/nbft/diffs/NBFT-static-ipv4-discovery index 22473a0dca..25faaceb94 100644 --- a/libnvme/test/nbft/diffs/NBFT-static-ipv4-discovery +++ b/libnvme/test/nbft/diffs/NBFT-static-ipv4-discovery @@ -1,9 +1,7 @@ raw_nbft_size=825 host.id=e359b7a15d37747b3cc1754b8b819b9 host.nqn=nqn.2014-08.org.nvmexpress:uuid:a1b759e3-035d-4777-b3cc-1754b8b819b9 -host.host_id_configured=1 -host.host_nqn_configured=1 -host.primary=0 +host.flags=0x07 hfi_list[0]->index=1 hfi_list[0]->transport=tcp hfi_list[0]->tcp_info.pci_sbdf=8 @@ -18,8 +16,11 @@ hfi_list[0]->tcp_info.primary_dns_ipaddr=0.0.0.0 hfi_list[0]->tcp_info.secondary_dns_ipaddr=0.0.0.0 hfi_list[0]->tcp_info.dhcp_server_ipaddr= hfi_list[0]->tcp_info.host_name=nvmeof-sles -hfi_list[0]->tcp_info.this_hfi_is_default_route=1 -hfi_list[0]->tcp_info.dhcp_override=0 +hfi_list[0]->tcp_info.flags=0x03 +hfi_list[0]->tcp_info.pcie_seg_num=0 +hfi_list[0]->tcp_info.dhcp_iaid=0 +hfi_list[0]->tcp_info.dhcp_duid= +hfi_list[0]->tcp_info.dhcp_duid_len=0 discovery_list[0]->index=1 discovery_list[0]->hfi->index=1 discovery_list[0]->uri=nvme+tcp://192.168.49.10:4420/ @@ -36,10 +37,12 @@ subsystem_ns_list[0]->nsid=1 subsystem_ns_list[0]->nid_type=3 subsystem_ns_list[0]->nid=df669a88bd6f4dd68a505f97eb55c835 subsystem_ns_list[0]->subsys_nqn=nqn.2022-12.org.nvmexpress.boot.poc:bremer.vagrant-nvmet.subsys02 -subsystem_ns_list[0]->pdu_header_digest_required=0 -subsystem_ns_list[0]->data_digest_required=0 +subsystem_ns_list[0]->trflags=0x0000 subsystem_ns_list[0]->controller_id=13 subsystem_ns_list[0]->asqsz=0 subsystem_ns_list[0]->dhcp_root_path_string=(null) -subsystem_ns_list[0]->discovered=1 -subsystem_ns_list[0]->unavailable=0 +subsystem_ns_list[0]->naed=0x00 +subsystem_ns_list[0]->cipeec=0x00 +subsystem_ns_list[0]->cto=0 +subsystem_ns_list[0]->nceec=0x00 +subsystem_ns_list[0]->flags=0x0051 diff --git a/libnvme/test/nbft/diffs/NBFT-static-ipv6 b/libnvme/test/nbft/diffs/NBFT-static-ipv6 index 12554f55f8..067de34117 100644 --- a/libnvme/test/nbft/diffs/NBFT-static-ipv6 +++ b/libnvme/test/nbft/diffs/NBFT-static-ipv6 @@ -1,9 +1,7 @@ raw_nbft_size=721 host.id=1ee8b170eb4c864fb7957d179e201a host.nqn=nqn.2014-08.org.nvmexpress:uuid:70b1e81e-4ceb-4f86-b709-57d1079e201a -host.host_id_configured=1 -host.host_nqn_configured=1 -host.primary=0 +host.flags=0x07 hfi_list[0]->index=1 hfi_list[0]->transport=tcp hfi_list[0]->tcp_info.pci_sbdf=512 @@ -18,8 +16,11 @@ hfi_list[0]->tcp_info.primary_dns_ipaddr=:: hfi_list[0]->tcp_info.secondary_dns_ipaddr=:: hfi_list[0]->tcp_info.dhcp_server_ipaddr= hfi_list[0]->tcp_info.host_name=nvmepoc-sles15-sp5 -hfi_list[0]->tcp_info.this_hfi_is_default_route=1 -hfi_list[0]->tcp_info.dhcp_override=0 +hfi_list[0]->tcp_info.flags=0x03 +hfi_list[0]->tcp_info.pcie_seg_num=0 +hfi_list[0]->tcp_info.dhcp_iaid=0 +hfi_list[0]->tcp_info.dhcp_duid= +hfi_list[0]->tcp_info.dhcp_duid_len=0 subsystem_ns_list[0]->index=1 subsystem_ns_list[0]->num_hfis=1 subsystem_ns_list[0]->hfis[0]->index=1 @@ -31,10 +32,12 @@ subsystem_ns_list[0]->nsid=1 subsystem_ns_list[0]->nid_type=3 subsystem_ns_list[0]->nid=aab2c3c8444c47c599f23632e6364528 subsystem_ns_list[0]->subsys_nqn=nqn.2022-12.de.suse.mwilck:zeus.vagrant-nvmet.subsys04 -subsystem_ns_list[0]->pdu_header_digest_required=0 -subsystem_ns_list[0]->data_digest_required=0 +subsystem_ns_list[0]->trflags=0x0000 subsystem_ns_list[0]->controller_id=9 subsystem_ns_list[0]->asqsz=0 subsystem_ns_list[0]->dhcp_root_path_string=(null) -subsystem_ns_list[0]->discovered=0 -subsystem_ns_list[0]->unavailable=0 +subsystem_ns_list[0]->naed=0x00 +subsystem_ns_list[0]->cipeec=0x00 +subsystem_ns_list[0]->cto=0 +subsystem_ns_list[0]->nceec=0x00 +subsystem_ns_list[0]->flags=0x0011 diff --git a/libnvme/test/nbft/nbft-dump.c b/libnvme/test/nbft/nbft-dump.c index b8e0688b52..b690698899 100644 --- a/libnvme/test/nbft/nbft-dump.c +++ b/libnvme/test/nbft/nbft-dump.c @@ -34,9 +34,7 @@ static void print_nbft(struct libnbft_info *table) print_hex(table->host.id, NVME_UUID_LEN); printf("\n"); printf("host.nqn=%s\n", table->host.nqn); - printf("host.host_id_configured=%d\n", table->host.host_id_configured); - printf("host.host_nqn_configured=%d\n", table->host.host_nqn_configured); - printf("host.primary=%d\n", table->host.primary); + printf("host.flags=0x%02x\n", table->host.flags); for (hfi = table->hfi_list, i = 0; hfi && *hfi; hfi++, i++) { printf("hfi_list[%u]->index=%d\n", i, (*hfi)->index); @@ -55,8 +53,13 @@ static void print_nbft(struct libnbft_info *table) printf("hfi_list[%u]->tcp_info.secondary_dns_ipaddr=%s\n", i, (*hfi)->tcp_info.secondary_dns_ipaddr); printf("hfi_list[%u]->tcp_info.dhcp_server_ipaddr=%s\n", i, (*hfi)->tcp_info.dhcp_server_ipaddr); printf("hfi_list[%u]->tcp_info.host_name=%s\n", i, (*hfi)->tcp_info.host_name); - printf("hfi_list[%u]->tcp_info.this_hfi_is_default_route=%d\n", i, (*hfi)->tcp_info.this_hfi_is_default_route); - printf("hfi_list[%u]->tcp_info.dhcp_override=%d\n", i, (*hfi)->tcp_info.dhcp_override); + printf("hfi_list[%u]->tcp_info.flags=0x%02x\n", i, (*hfi)->tcp_info.flags); + printf("hfi_list[%u]->tcp_info.pcie_seg_num=%u\n", i, (*hfi)->tcp_info.pcie_seg_num); + printf("hfi_list[%u]->tcp_info.dhcp_iaid=%"PRIu32"\n", i, (*hfi)->tcp_info.dhcp_iaid); + printf("hfi_list[%u]->tcp_info.dhcp_duid=", i); + print_hex((*hfi)->tcp_info.dhcp_duid, (*hfi)->tcp_info.dhcp_duid_len); + printf("\n"); + printf("hfi_list[%u]->tcp_info.dhcp_duid_len=%u\n", i, (*hfi)->tcp_info.dhcp_duid_len); } for (sec = table->security_list, i = 0; sec && *sec; sec++, i++) { @@ -92,13 +95,15 @@ static void print_nbft(struct libnbft_info *table) print_hex((*ssns)->nid, 16); printf("\n"); printf("subsystem_ns_list[%u]->subsys_nqn=%s\n", i, (*ssns)->subsys_nqn); - printf("subsystem_ns_list[%u]->pdu_header_digest_required=%d\n", i, (*ssns)->pdu_header_digest_required); - printf("subsystem_ns_list[%u]->data_digest_required=%d\n", i, (*ssns)->data_digest_required); + printf("subsystem_ns_list[%u]->trflags=0x%04x\n", i, (*ssns)->trflags); printf("subsystem_ns_list[%u]->controller_id=%d\n", i, (*ssns)->controller_id); printf("subsystem_ns_list[%u]->asqsz=%d\n", i, (*ssns)->asqsz); printf("subsystem_ns_list[%u]->dhcp_root_path_string=%s\n", i, (*ssns)->dhcp_root_path_string); - printf("subsystem_ns_list[%u]->discovered=%d\n", i, (*ssns)->discovered); - printf("subsystem_ns_list[%u]->unavailable=%d\n", i, (*ssns)->unavailable); + printf("subsystem_ns_list[%u]->naed=0x%02x\n", i, (*ssns)->naed); + printf("subsystem_ns_list[%u]->cipeec=0x%02x\n", i, (*ssns)->cipeec); + printf("subsystem_ns_list[%u]->cto=%"PRIu16"\n", i, (*ssns)->cto); + printf("subsystem_ns_list[%u]->nceec=0x%02x\n", i, (*ssns)->nceec); + printf("subsystem_ns_list[%u]->flags=0x%04x\n", i, (*ssns)->flags); } } diff --git a/plugins/nbft/nbft-plugin.c b/plugins/nbft/nbft-plugin.c index 071f690ddf..95f97ad9ef 100644 --- a/plugins/nbft/nbft-plugin.c +++ b/plugins/nbft/nbft-plugin.c @@ -1,6 +1,7 @@ // SPDX-License-Identifier: GPL-2.0-or-later #include +#include #include #include @@ -48,6 +49,18 @@ static char *mac_addr_to_string(unsigned char mac_addr[6]) } #ifdef CONFIG_JSONC +static const char *hex_str(const __u8 *data, int len, char *buf, size_t bufsz) +{ + int i, pos = 0; + + for (i = 0; i < len && pos + 3 < bufsz; i++) + pos += snprintf(buf + pos, bufsz - pos, "%s%02x", + i ? ":" : "", data[i]); + if (!len && bufsz > 0) + buf[0] = '\0'; + return buf; +} + static json_object *hfi_to_json(struct libnbft_hfi *hfi) { struct json_object *hfi_json; @@ -87,12 +100,107 @@ static json_object *hfi_to_json(struct libnbft_hfi *hfi) && json_object_add_value_string(hfi_json, "host_name", hfi->tcp_info.host_name)) || json_object_add_value_int(hfi_json, "this_hfi_is_default_route", - hfi->tcp_info.this_hfi_is_default_route) + !!(hfi->tcp_info.flags & NBFT_HFI_INFO_TCP_GLOBAL_ROUTE)) || json_object_add_value_int(hfi_json, "dhcp_override", - hfi->tcp_info.dhcp_override)) + !!(hfi->tcp_info.flags & NBFT_HFI_INFO_TCP_DHCP_OVERRIDE)) + || json_object_add_value_int(hfi_json, "ipaddr_autoconf", + !!(hfi->tcp_info.flags & NBFT_HFI_INFO_TCP_IPADDR_AUTOCONF))) goto fail; - else - return hfi_json; + + if (hfi->tcp_info.pcie_seg_num > 0 + && json_object_add_value_int(hfi_json, "pcie_seg_num", + hfi->tcp_info.pcie_seg_num)) + goto fail; + + if (hfi->tcp_info.dhcp_duid_len > 0) { + const __u8 *duid = hfi->tcp_info.dhcp_duid; + __u8 dlen = hfi->tcp_info.dhcp_duid_len; + __u16 duid_type = dlen >= 2 ? duid[0] | (duid[1] << 8) : 0; + char hexbuf[400]; + + if (json_object_add_value_uint(hfi_json, "dhcp_iaid", + hfi->tcp_info.dhcp_iaid)) + goto fail; + + switch (duid_type) { + case 1: { + if (json_object_add_value_string(hfi_json, "dhcp_duid_type", "DUID-LLT")) + goto fail; + if (dlen >= 4 + && json_object_add_value_int(hfi_json, "dhcp_duid_hwtype", + duid[2] | (duid[3] << 8))) + goto fail; + if (dlen >= 8 + && json_object_add_value_uint(hfi_json, "dhcp_duid_time", + duid[4] | (duid[5] << 8) | + (duid[6] << 16) | ((__u32)duid[7] << 24))) + goto fail; + if (dlen > 8 + && json_object_add_value_string(hfi_json, "dhcp_duid_lladdr", + hex_str(duid + 8, dlen - 8, + hexbuf, sizeof(hexbuf)))) + goto fail; + break; + } + case 2: { + if (json_object_add_value_string(hfi_json, "dhcp_duid_type", "DUID-EN")) + goto fail; + if (dlen >= 6 + && json_object_add_value_uint(hfi_json, "dhcp_duid_enterprise", + duid[2] | (duid[3] << 8) | + (duid[4] << 16) | ((__u32)duid[5] << 24))) + goto fail; + if (dlen > 6 + && json_object_add_value_string(hfi_json, "dhcp_duid_id", + hex_str(duid + 6, dlen - 6, + hexbuf, sizeof(hexbuf)))) + goto fail; + break; + } + case 3: { + if (json_object_add_value_string(hfi_json, "dhcp_duid_type", "DUID-LL")) + goto fail; + if (dlen >= 4 + && json_object_add_value_int(hfi_json, "dhcp_duid_hwtype", + duid[2] | (duid[3] << 8))) + goto fail; + if (dlen > 4 + && json_object_add_value_string(hfi_json, "dhcp_duid_lladdr", + hex_str(duid + 4, dlen - 4, + hexbuf, sizeof(hexbuf)))) + goto fail; + break; + } + case 4: { + char uuid_str[NVME_UUID_LEN_STRING]; + unsigned char uuid[NVME_UUID_LEN]; + + if (json_object_add_value_string(hfi_json, "dhcp_duid_type", "DUID-UUID")) + goto fail; + if (dlen >= 18) { + memcpy(uuid, duid + 2, NVME_UUID_LEN); + libnvme_uuid_to_string(uuid, uuid_str); + if (json_object_add_value_string(hfi_json, "dhcp_duid_uuid", + uuid_str)) + goto fail; + } + break; + } + default: { + char type_str[16]; + + snprintf(type_str, sizeof(type_str), "unknown(%u)", duid_type); + if (json_object_add_value_string(hfi_json, "dhcp_duid_type", type_str) + || json_object_add_value_string(hfi_json, "dhcp_duid_raw", + hex_str(duid, dlen, + hexbuf, sizeof(hexbuf)))) + goto fail; + break; + } + } + } + + return hfi_json; } fail: json_free_object(hfi_json); @@ -168,13 +276,26 @@ static json_object *ssns_to_json(struct libnbft_subsystem_ns *ss) && json_object_add_value_string(ss_json, "dhcp_root_path_string", ss->dhcp_root_path_string)) || json_object_add_value_int(ss_json, "pdu_header_digest_required", - ss->pdu_header_digest_required) + !!(ss->trflags & NBFT_SSNS_PDU_HEADER_DIGEST)) || json_object_add_value_int(ss_json, "data_digest_required", - ss->data_digest_required) + !!(ss->trflags & NBFT_SSNS_DATA_DIGEST)) || json_object_add_value_int(ss_json, "discovered", - ss->discovered) + !!(ss->flags & NBFT_SSNS_DISCOVERED_NAMESPACE)) || json_object_add_value_int(ss_json, "unavailable", - ss->unavailable)) + !!(ss->flags & NBFT_SSNS_UNAVAIL_NAMESPACE_UNAVAIL))) + goto fail; + + if (ss->naed + && json_object_add_value_int(ss_json, "naed", ss->naed)) + goto fail; + if (ss->cipeec + && json_object_add_value_int(ss_json, "cipeec", ss->cipeec)) + goto fail; + if (ss->cto != 0xffff + && json_object_add_value_int(ss_json, "connection_timeout", ss->cto)) + goto fail; + if (ss->nceec + && json_object_add_value_int(ss_json, "nceec", ss->nceec)) goto fail; return ss_json; @@ -206,18 +327,18 @@ static json_object *discovery_to_json(struct libnbft_discovery *disc) return disc_json; } -static const char *primary_admin_host_flag_to_str(unsigned int primary) +static const char *primary_admin_host_flag_to_str(__u8 host_flags) { - static const char * const str[] = { - [LIBNBFT_PRIMARY_ADMIN_HOST_FLAG_NOT_INDICATED] = "not indicated", - [LIBNBFT_PRIMARY_ADMIN_HOST_FLAG_UNSELECTED] = "unselected", - [LIBNBFT_PRIMARY_ADMIN_HOST_FLAG_SELECTED] = "selected", - [LIBNBFT_PRIMARY_ADMIN_HOST_FLAG_RESERVED] = "reserved", - }; - - if (primary > LIBNBFT_PRIMARY_ADMIN_HOST_FLAG_RESERVED) - return "INVALID"; - return str[primary]; + switch (host_flags & NBFT_HOST_PRIMARY_ADMIN_MASK) { + case NBFT_HOST_PRIMARY_ADMIN_NOT_INDICATED: + return "not indicated"; + case NBFT_HOST_PRIMARY_ADMIN_UNSELECTED: + return "unselected"; + case NBFT_HOST_PRIMARY_ADMIN_SELECTED: + return "selected"; + default: + return "reserved"; + } } static struct json_object *nbft_to_json(struct libnbft_info *nbft, bool show_subsys, @@ -242,11 +363,11 @@ static struct json_object *nbft_to_json(struct libnbft_info *nbft, bool show_sub util_uuid_to_string(nbft->host.id)))) goto fail; json_object_add_value_int(host_json, "host_id_configured", - nbft->host.host_id_configured); + !!(nbft->host.flags & NBFT_HOST_HOSTID_CONFIGURED)); json_object_add_value_int(host_json, "host_nqn_configured", - nbft->host.host_nqn_configured); + !!(nbft->host.flags & NBFT_HOST_HOSTNQN_CONFIGURED)); json_object_add_value_string(host_json, "primary_admin_host_flag", - primary_admin_host_flag_to_str(nbft->host.primary)); + primary_admin_host_flag_to_str(nbft->host.flags)); if (json_object_object_add(nbft_json, "host", host_json)) { json_free_object(host_json); goto fail; @@ -391,7 +512,8 @@ static void print_nbft_hfi_info(struct libnbft_info *nbft) (*hfi)->transport, pci_sbdf_to_string((*hfi)->tcp_info.pci_sbdf), mac_addr_to_string((*hfi)->tcp_info.mac_addr), - (*hfi)->tcp_info.dhcp_override ? "yes" : "no", + ((*hfi)->tcp_info.flags & + NBFT_HFI_INFO_TCP_DHCP_OVERRIDE) ? "yes" : "no", ip_width, ip_width, (*hfi)->tcp_info.ipaddr, (*hfi)->tcp_info.subnet_mask_prefix, gw_width, gw_width, (*hfi)->tcp_info.gateway_ipaddr, From c9d9d88b5eb8b8e6714312a1f2366bc84e24d202 Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Wed, 15 Jul 2026 17:43:21 +0200 Subject: [PATCH 4/4] nbft: Add Security Profile Descriptor API While we're intentionally not going to support Security Descriptors yet, the public API needs to be finalized before it gets stabilized and frozen for libnvme-3.0. Signed-off-by: Tomas Bzatek --- libnvme/src/nvme/nbft.h | 49 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 46 insertions(+), 3 deletions(-) diff --git a/libnvme/src/nvme/nbft.h b/libnvme/src/nvme/nbft.h index 115d0c0ccb..6e531cae88 100644 --- a/libnvme/src/nvme/nbft.h +++ b/libnvme/src/nvme/nbft.h @@ -135,12 +135,55 @@ struct libnbft_discovery { /** * struct libnbft_security - Security Profile Descriptor - * @index: The number of this Security Profile Descriptor in the Security - * Profile Descriptor List. + * @index: The number of this Security Profile Descriptor in the + * Security Profile Descriptor List. + * @flags: Security Profile Descriptor Flags bitmask, + * see &enum nbft_security_flags. + * @secret_type: Secret Type, see &enum nbft_security_secret_type. + * @sec_chan_algs: Secure Channel Algorithm list: an array of bytes + * whose values are the Security Type (SECTYPE) field, + * see &enum nvmf_tcp_sectype. NULL if not present + * in the NBFT heap. + * @sec_chan_algs_len: Length in bytes of @sec_chan_algs. + * @auth_protocols: Authentication Protocol identifier list. Values + * are Authentication Protocol Identifiers as defined + * in the NVM Express Base Specification. NULL if not + * present in the NBFT heap. + * @auth_protocols_len: Length in bytes of @auth_protocols. + * @cipher_suites: Cipher Suite identifier list: raw byte data containing + * cipher suite identifiers as defined in the IANA TLS + * Parameters Registry. Each entry is a 16-bit value; + * the number of entries is @cipher_suites_len / 2. + * NULL if not present in the NBFT heap. + * @cipher_suites_len: Length in bytes of @cipher_suites. + * @dh_groups: DH-HMAC-CHAP Diffie-Hellman group identifier list. + * Values are DH Group Identifiers as defined in the + * NVM Express Base Specification. NULL if not present + * in the NBFT heap. + * @dh_groups_len: Length in bytes of @dh_groups. + * @sec_hash_funcs: DH-HMAC-CHAP hash function identifier list, + * see &enum libnvmf_hmac_alg. NULL if not present + * in the NBFT heap. + * @sec_hash_funcs_len: Length in bytes of @sec_hash_funcs. + * @secret_keypath: URI string for the secret key path. The type of + * the URI is specified by @secret_type. + * NULL if not present. */ struct libnbft_security { int index; - /* TODO add fields */ + __u16 flags; + __u8 secret_type; + __u8 *sec_chan_algs; + __u16 sec_chan_algs_len; + __u8 *auth_protocols; + __u16 auth_protocols_len; + __u8 *cipher_suites; + __u16 cipher_suites_len; + __u8 *dh_groups; + __u16 dh_groups_len; + __u8 *sec_hash_funcs; + __u16 sec_hash_funcs_len; + char *secret_keypath; }; /**