libnvme(2)
π libnvme(2) β API Manual π
okay bestie, sit down, hydrate, because we're doing a whole manual page together and it's lowkey adorable. this is libnvme, section 2 of the manual (the API girly β¨), and today's main character is one very specific little struct. no cap, she's iconic.
πΈ NAME πΈ
struct nvmf_disc_log_entry β the Discovery Log Page entry. that's her. that's the whole vibe. she's one single entry in the Discovery Log Page, and she's holding so much info, it's giving overachiever π
β¨ SYNOPSIS β¨
here's the shape of her, exactly as she is, not a single byte moved:
struct nvmf_disc_log_entry {
__u8 trtype;
__u8 adrfam;
__u8 subtype;
__u8 treq;
__le16 portid;
__le16 cntlid;
__le16 asqsz;
__le16 eflags;
__u8 rsvd12[20];
char trsvcid[NVMF_TRSVCID_SIZE];
__u8 rsvd64[192];
char subnqn[NVME_NQN_LENGTH];
char traddr[NVMF_TRADDR_SIZE];
union nvmf_tsas tsas;
};
look at all those fields. she ate and left no crumbs π
π¦ Members π¦
okay so this is the part where we meet everybody one by one. no skipping, no summarising, we're doing the full roll call fr fr π
trtypeβ Transport Type (TRTYPE). this one says which NVMe Transport type it is. wanna know the actual options? go look atenum nvmf_trtype, she's got the list πadrfamβ Address Family (ADRFAM). specifies the address family. details live inenum nvmf_addr_familyβ¨subtypeβ Subsystem Type (SUBTYPE). says what type of NVM subsystem this entry is talking about. the tea is inenum nvme_subsys_typeπtreqβ Transport Requirements (TREQ). indicates the requirements for the NVMe Transport. go checkenum nvmf_treqfor the whole menu πportidβ Port ID (PORTID). points at a particular NVM subsystem port. important lil note bestie: different NVMe Transports or address families may utilize the same Port ID value β like, a Port ID can support bothiWARPandRoCEat the same time. she's not monogamous, she multi-tasks πcntlidβ Controller ID (CNTLID). specifies the controller ID, and the rules here are detailed, so listen up:- if the NVM subsystem uses a dynamic controller model, then this field shall be set to
FFFFh. - if the NVM subsystem uses a static controller model, then this field may be set to a specific controller ID (and values
0htoFFEFhare the valid ones). - and if the NVM subsystem uses a static controller model and the value indicated is
FFFEh, then the host should remember the Controller ID that came back as part of the Fabrics Connect command, so it can re-establish an association in the future with the same controller. like saving your ex's number but for admin purposes, iykyk π
- if the NVM subsystem uses a dynamic controller model, then this field shall be set to
asqszβ Admin Max SQ Size (ASQSZ). this is the maximum size of an Admin Submission Queue. it applies to all controllers in the NVM subsystem. and the value shall be a minimum of32entries β that's the floor, don't go below it π«eflagsβ Entry Flags (EFLAGS). extra info related to the current entry. the flag lore lives inenum nvmf_disc_eflagsπ©rsvd12β Reserved. not for you bestie. she's just chillin πtrsvcidβ Transport Service Identifier (TRSVCID). the NVMe Transport service identifier, as an ASCII string. this identifier is specified by the associated NVMe Transport binding specification. typecast queen πrsvd64β Reserved. again. same energy. just vibing πsubnqnβ NVM Subsystem Qualified Name (SUBNQN). this is the NVMe Qualified Name (NQN) that uniquely identifies the NVM subsystem. and yes, there's a whole two-branch situation here:- for a subsystem, if that Discovery subsystem has a unique NQN (meaning: the NVM Subsystem NVMe Qualified Name (SUBNQN) field in that Discovery subsystem's Identify Controller data structure contains a unique NQN value), then the value returned shall be that unique NQN.
- if the Discovery subsystem does not have a unique NQN, then the value returned shall be the well-known Discovery Service NQN β and that is literally
nqn.2014-08.org.nvmexpress.discovery. yes that whole string. she's a baddie with a government name π
traddrβ Transport Address (TRADDR). the address of the NVM subsystem, and it may be used for a Connect command as an ASCII string. btw the Address Family field is the one that describes the reference for parsing this field β soadrfamandtraddrare a package deal, they come as a set π€tsasβ Transport specific attribute settings. she's a union, she contains multitudes, we love her for that π«Ά
π¨ real talk bestie:rsvd12andrsvd64are reserved for a reason. don't get cute with them. the spec said reserved and the spec meant it π
π also thecntlidrules are not suggestions βFFFFhfor dynamic,0htoFFEFhvalid for static, andFFFEhmeans remember that Controller ID. read it twice, it's on the test.
π SEE YOU, BESTIE π
this absolute gem of a page is part of the libnvme API Manual, and this whole thing is dated July 2026 β yes, we're time travelling and we're doing it in style π« so when you're deep in the Discovery Log Page and everything's giving chaos, just remember: one entry at a time, one field at a time, and you'll slay it. bye bestie, drink water, check your return values πβ¨π
π¦ 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