libnvme(2)

πŸ’– libnvme β€” libnvme(2), the API manual, bestie edition πŸ’–

okay so we're deep in the API manual today and the main character is struct nbft_hfi_info_tcp β€” the HFI Transport Info Descriptor for NVMe/TCP (Figure 13, she's numbered, she's iconic). grab a strawberry drink πŸ“ and let's get into it.


✨ NAME ✨

struct nbft_hfi_info_tcp β€” the HFI Transport Info Descriptor for NVMe/TCP, aka Figure 13. that's her. that's the whole vibe. 🫢


🌈 SYNOPSIS 🌈

struct nbft_hfi_info_tcp {
    __u8 structure_id;
    __u8 version;
    __u8 trtype;
    __u8 trinfo_version;
    __le16 hfi_index;
    __u8 flags;
    __le32 pci_sbdf;
    __u8 mac_addr[6];
    __le16 vlan;
    __u8 ip_origin;
    __u8 ip_address[16];
    __u8 subnet_mask_prefix;
    __u8 ip_gateway[16];
    __u8 reserved1;
    __le16 route_metric;
    __u8 primary_dns[16];
    __u8 secondary_dns[16];
    __u8 dhcp_server[16];
    struct nbft_heap_obj host_name_obj;
    __u8 reserved2[18];
 };

look at her. so many fields. so much lore. no cap. πŸ’…


πŸ‘‘ Members πŸ‘‘

πŸ’« structure_id

Structure ID. this one shall be set to 7h β€” that's HFI Transport Info, aka #NBFT_DESC_HFI_TRINFO. like, it literally tells you what she is. periodt.

πŸ’« version

Version. shall be set to 1h. yes queen, stay consistent.

πŸ’« trtype

HFI Transport Type β€” go peek at enum nbft_trtype. this field shall be set to 03h, which means NVMe/TCP, aka #NBFT_TRTYPE_TCP. it's giving transport. πŸ¦‹

πŸ’« trinfo_version

Transport Info Version. if your implementation is compliant with this specification, you shall set this to 1h. no freelancing, bestie.

πŸ’« hfi_index

HFI Descriptor Index. this holds the value of the HFI Descriptor Index field of the HFI Descriptor (check struct nbft_hfi.index) whose HFI Transport Info Descriptor Heap Object Reference field points at this HFI Transport Info Descriptor. yes, it's a whole chain of pointing. iykyk. πŸ”₯

πŸ’« flags

HFI Transport Flags β€” see enum nbft_hfi_info_tcp_flags for the full menu. 🌸

πŸ’« pci_sbdf

PCI Express Routing ID for the HFI Transport Function. this field indicates the PCI Express Routing ID exactly as specified in the PCI Express Base Specification. no notes, it's a standard. ⭐

πŸ’« mac_addr

MAC Address. the MAC address of this HFI, in EUI-48TM format, as defined in the IEEE Guidelines for Use of Extended Unique Identifiers. heads up: this field shall be set to a non-zero value. zero is not the moment. πŸ’€

πŸ’« vlan

VLAN. if this field is set to a non-zero value, then it contains the VLAN identifier of the VLAN associated with this HFI, as defined in IEEE 802.1q-2018. if no VLAN is associated with this HFI, then this field shall be cleared to 0h. simple as that.

πŸ’« ip_origin

IP Origin. if this field is non-zero, it indicates the source of the Ethernet L3 configuration information that the driver uses for this interface. the valid values are defined in the Win 32 API: NL_PREFIX_ORIGIN enumeration specification. if the driver doesn't use IP Origin, this field should be cleared to 0h. 🧚

πŸ’« ip_address

IP Address. this field indicates the IPv4 or IPv6 address of this HFI. and β€” important β€” this field shall be set to a non-zero value. πŸ‘‘

πŸ’« subnet_mask_prefix

Subnet Mask Prefix. this one indicates the IPv4 or IPv6 subnet mask, written in CIDR routing prefix notation. math but make it networking. ✨

πŸ’« ip_gateway

IP Gateway. if this field is non-zero, it holds the IPv4 or IPv6 address of the IP gateway for this HFI. if it's cleared to 0h, then no IP gateway is specified. that's it, that's the rule.

πŸ’« reserved1

Reserved. don't touch, she's resting. πŸ™ˆ

πŸ’« route_metric

Route Metric. if this field is non-zero, it indicates the cost value for the route indicated by this HF. this is the value the pre-OS driver uses when choosing among all available routes. lower values = higher priority, so keep that in mind. refer to IETF RFC 4249.

okay and the defaults: if the pre-OS driver supports routing but didn't configure a specific route metric for this interface, it should set this value to 500. if the pre-OS driver doesn't support routing at all, then this field should be cleared to 0h.

πŸ’« primary_dns

Primary DNS. if this field is non-zero, it indicates the IPv4 or IPv6 address of the Primary DNS server for this HFI, if any, from byte offset 0h of the NBFT Table Header. if it's cleared to 0h, then no Primary DNS is specified. πŸ’œ

πŸ’« secondary_dns

Secondary DNS. if this field is non-zero, it indicates the IPv4 or IPv6 address of the Secondary DNS server for this HFI, if any, from byte offset 0h of the NBFT Table Header. if it's cleared to 0h, then no Secondary DNS is specified. the sequel, basically. πŸŽ€

πŸ’« dhcp_server

DHCP Server. if the DHCP Override bit is set to 1h, then this field indicates the IPv4 or IPv6 address of the DHCP server that was used to assign this HFI address. if that bit is cleared to 0h, then this field is reserved. so it depends on the bit, bestie. keep up. πŸ’…

πŸ’« host_name_obj

Host Name Heap Object Reference. if this field is non-zero, it indicates the location and size of a heap object that contains a Host Name string. cute little pointer moment. πŸ¦‹

πŸ’« reserved2

Reserved. also resting. let her sleep. 😭


and that's the whole descriptor, no skips, no crumbs left. πŸ’–

written up by the libnvme crew, struct nbft_hfi_info_tcp, libnvme(2), dated July 2026 β€” mwah, sending this one straight to the group chat. slay, bye. 🌈✨
πŸ“¦ where this page comes from