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 toenum nbft_desc_type). And she shall be set to1h(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, seeenum 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 (seestruct 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 offset0hof the NBFT Table Header. But β plot twist β if thenum_hfifield is cleared to0h, 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: ifnum_hfiis cleared to0h, 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 (seestruct nbft_hfi) in the HFI Descriptor List, if any. And if no interfaces have been configured, then this field shall be cleared to0h. 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 offset0hof the NBFT Table Header. If thenum_ssnsfield is cleared to0h, then this field is reserved.ssnslβ SSNS Descriptor Length (SSNSL): this field indicates the length in bytes of each SSNS Descriptor, if any. If thenum_ssnsfield is cleared to0h, 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 (seestruct 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 offset0hof the NBFT Table Header. If thenum_secfield is cleared to0h, 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 thenum_secfield is cleared to0h, 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 (seestruct 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 offset0hof the NBFT Table Header. If thenum_discfield is cleared to0h, 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 thenum_discfield is cleared to0h, 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 (seestruct 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 matchingnum_*field is cleared to0h. 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
- ubuntu stonking: libnvme-dev 1.16.2-1build1 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms