libnvme(2)

πŸ‘‘ libnvme(2) β€” okay bestie, sit DOWN, we're doing struct nbft_control πŸ’…

Hi hiiii πŸ’– so this is a page straight out of the libnvme API manual (section 2, the C-API zone, iykyk), and today's main character is struct nbft_control β€” aka the NBFT Table Control Descriptor (Figure 8, she has a figure number, she's famous). It's the little header struct at the top of an NBFT table that tells you where everything else lives. No cap, she's literally the group chat admin of the NBFT world. πŸŽ€


✨ NAME ✨

struct nbft_control β€” NBFT Table Control Descriptor (Figure 8). Like, the descriptor that runs the whole descriptor situation. πŸ¦‹


🌸 SYNOPSIS 🌸

struct nbft_control {
    __u8 structure_id;
    __u8 major_revision;
    __u8 minor_revision;
    __u8 reserved1;
    __le16 csl;
    __u8 flags;
    __u8 reserved2;
    struct nbft_heap_obj hdesc;
    __u8 hsv;
    __u8 reserved3;
    __le32 hfio;
    __le16 hfil;
    __u8 hfiv;
    __u8 num_hfi;
    __le32 ssnso;
    __le16 ssnsl;
    __u8 ssnsv;
    __u8 num_ssns;
    __le32 seco;
    __le16 secl;
    __u8 secv;
    __u8 num_sec;
    __le32 disco;
    __le16 discl;
    __u8 discv;
    __u8 num_disc;
    __u8 reserved4[16];
 };

Look at her. So many fields. So much structure. We love a well-organized queen. πŸ’–


πŸŽ€ Members πŸŽ€

Every single one of these, no skipping, bestie. Reserved fields included, because respect the reserved fields. πŸ™ˆ

  • structure_id β€” Structure ID: this field specifies the element (refer to enum nbft_desc_type). And she shall be set to 1h (i.e., Control, #NBFT_DESC_CONTROL). It's giving "hello, I am the control descriptor."
  • major_revision β€” Major Revision: the major revision of the structure that corresponds to the Signature field. Heads up: larger major revision numbers should not be assumed backward compatible with lower major revision numbers that have the same signature. So like, don't assume, okay? 😭
  • minor_revision β€” Minor Revision: the minor revision of the structure that corresponds to the signature field. If the major revision numbers are the same, then any minor revision number differences shall be backwards compatible with the same signature. Same major = we're chill. 🀝
  • reserved1 β€” Reserved. (She's reserved. Respect it. πŸ’…)
  • csl β€” Control Structure Length (CSL): this field indicates the length in bytes of the Control Descriptor. The receipt. The itemized bill. πŸ’Έ
  • flags β€” Flags, see enum nbft_control_flags. Go check the enum, bestie.
  • reserved2 β€” Reserved. ✨
  • hdesc β€” Host Descriptor (HDESC): this field indicates the location and length of the Host Descriptor (see struct nbft_host). Little pointer bestie to another struct. 🫢
  • hsv β€” Host Descriptor Version (HSV): this field indicates the version of the Host Descriptor.
  • reserved3 β€” Reserved. 🌸
  • hfio β€” HFI Descriptor List Offset (HFIO): if this field is set to a non-zero value, then this field indicates the offset in bytes of the HFI Descriptor List, if any, from byte offset 0h of the NBFT Table Header. But β€” plot twist β€” if the num_hfi field is cleared to 0h, then this field is reserved. Conditional queen. πŸ‘‘
  • hfil β€” HFI Descriptor Length (HFIL): this field indicates the length in bytes of each HFI Descriptor, if any. And again: if num_hfi is cleared to 0h, this field is reserved.
  • hfiv β€” HFI Descriptor Version (HFIV): this field indicates the version of each HFI Descriptor.
  • num_hfi β€” Number of Host Fabric Interface Descriptors (NumHFI): this field indicates the number of HFI Descriptors (see struct nbft_hfi) in the HFI Descriptor List, if any. And if no interfaces have been configured, then this field shall be cleared to 0h. Empty set, empty field. πŸ•³οΈ
  • ssnso β€” SSNS Descriptor List Offset (SSNSO): this field indicates the offset in bytes of the SSNS Descriptor List, if any, from byte offset 0h of the NBFT Table Header. If the num_ssns field is cleared to 0h, then this field is reserved.
  • ssnsl β€” SSNS Descriptor Length (SSNSL): this field indicates the length in bytes of each SSNS Descriptor, if any. If the num_ssns field is cleared to 0h, then this field is reserved.
  • ssnsv β€” SSNS Descriptor Version (SSNSV): this field indicates the version of the SSNS Descriptor.
  • num_ssns β€” Number of Subsystem and Namespace Descriptors (NumSSNS): this field indicates the number of Subsystem Namespace (SSNS) Descriptors (see struct nbft_ssns) in the SSNS Descriptor List, if any.
  • seco β€” Security Profile Descriptor List Offset (SECO): this field indicates the offset in bytes of the Security Profile Descriptor List, if any, from byte offset 0h of the NBFT Table Header. If the num_sec field is cleared to 0h, then this field is reserved.
  • secl β€” Security Profile Descriptor Length (SECL): this field indicates the length in bytes of each Security Profile Descriptor, if any. If the num_sec field is cleared to 0h, then this field is reserved.
  • secv β€” Security Profile Descriptor Version (SECV): this field indicates the version of the Security Profile Descriptor. Security girlies stay versioned. πŸ”
  • num_sec β€” Number of Security Profile Descriptors (NumSec): this field indicates the number of Security Profile Descriptors (see struct nbft_security), if any, in the Security Profile Descriptor List.
  • disco β€” Discovery Descriptor Offset (DISCO): this field indicates the offset in bytes of the Discovery Descriptor List, if any, from byte offset 0h of the NBFT Table Header. If the num_disc field is cleared to 0h, then this field is reserved. Yes it's called DISCO. Yes that's iconic. πŸͺ©
  • discl β€” Discovery Descriptor Length (DISCL): this field indicates the length in bytes of each Discovery Descriptor, if any. If the num_disc field is cleared to 0h, then this field is reserved.
  • discv β€” Discovery Descriptor Version (DISCV): this field indicates the version of the Discovery Descriptor.
  • num_disc β€” Number of Discovery Descriptors (NumDisc): this field indicates the number of Discovery Descriptors (see struct nbft_discovery), if any, in the Discovery Descriptor List, if any. (The "if any" is doing so much work here, honestly 😭)
  • reserved4 β€” Reserved. That's the __u8 reserved4[16]; one, sixteen whole bytes of "not your business." πŸ’€

Small vibe check: sooo many of these fields turn into "reserved" the moment their matching num_* field is cleared to 0h. If the list doesn't exist, neither does the pointer to it. Periodt. 🫢

And that's the whole entire page, bestie!! 🌈 No details skipped, no fields abandoned, every offset, length, version and reserved byte accounted for. You now know struct nbft_control better than you know your own sleep schedule. Slay. πŸ’œ

Much love from the libnvme API manual, section 2 β€” this page was dated July 2026, so yeah, fresh off the press fr fr. πŸŽ€βœ¨

πŸ“¦ where this page comes from