libnvme(9)

πŸ“¦ version 3.2, in arch rolling

🌸 NAME 🌸

okay so this page is all about struct nbft_discovery β€” the Discovery Descriptor (Figure 26), bestie πŸ’–

This is from the libnvme API manual, and we're diving into one very specific little struct. Buckle up πŸŽ€


✨ SYNOPSIS ✨

here's the shape of it, exactly as it lives in the headers β€” no cap, copy it verbatim:

struct nbft_discovery {
    __u8 structure_id;
    __u8 flags;
    __u8 index;
    __u8 hfi_index;
    __u8 sec_index;
    __u8 reserved1;
    struct nbft_heap_obj discovery_ctrl_addr_obj;
    struct nbft_heap_obj discovery_ctrl_nqn_obj;
    __u8 reserved2[14];
 };

like, look at her. iconic field layout, honestly πŸ‘‘


πŸ’… Members πŸ’…

  • structure_id β€” the Structure ID, and it shall be set to 6h (that's the Discovery Descriptor, aka #NBFT_DESC_DISCOVERY). literally her whole identity in one byte 🫢
  • flags β€” the Discovery Descriptor Flags. for the actual flag meanings you gotta go check enum nbft_discovery_flags πŸ‘€
  • index β€” the Discovery Descriptor Index: this tells you which number this Discovery Descriptor is in the Discovery Descriptor List. yes bestie, she's numbered πŸŽ€
  • hfi_index β€” the HFI Descriptor Index: this one holds the value of the HFI Descriptor Index field of the HFI Descriptor that's associated with this Discovery Descriptor. and heads up β€” if multiple HFIs share a common Discovery controller, there shall be multiple Discovery Descriptor entries, one per HFI. so don't be surprised when you see duplicates, that's just how it works πŸ’€
  • sec_index β€” the Security Profile Descriptor Index: this holds the value of the Security Profile Descriptor Index field of the Security Descriptor that's associated with this Discovery Descriptor πŸ”
  • reserved1 β€” Reserved. nothing to see here, move along 🧚
  • discovery_ctrl_addr_obj β€” the Discovery Controller Address Heap Object Reference ✨ this field tells you the location and size of a heap object holding a URI, and that URI points at an NVMe Discovery controller associated with this Discovery Descriptor. and if this field is cleared to 0h, then no URI is specified β€” simple as that πŸ¦‹
  • discovery_ctrl_nqn_obj β€” the Discovery Controller NQN Heap Object Reference: if this is set to a non-zero value, it indicates the location and size of a heap object containing an NVMe Discovery controller NQN. and here's the spicy part 🌢️ β€” if the NVMe Discovery controller referenced by this record requires secure authentication with a well known Subsystem NQN, then this field indicates the unique NQN for that NVMe Discovery controller. the record is formatted as an NQN string. but if this field is cleared to 0h, then this field is reserved and the OS shall use the well known discovery NQN for this record. so like, two very different vibes depending on whether it's zero or not 😭
  • reserved2 β€” Reserved. again. it's giving "padding energy" πŸ™ˆ

quick vibe check bestie: reserved1 and reserved2 are Reserved, and structure_id shall be 6h. those aren't suggestions, mkay? πŸ’…

aaaand that's the whole page 🌈 this was struct nbft_discovery from the libnvme API manual (that's libnvme(9), section 9, for the record πŸ“š) β€” dropped October 2026, authored under the struct nbft_discovery heading, and published as part of libnvme(9). go forth and decode those descriptors, queen πŸ‘‘πŸ’œ

πŸ“¦ where this page comes from