libnvme(9)
π libnvme(9) β the API Manual, but make it make sense π
okay bestie, so this is a page out of the libnvme API manual β yes, that libnvme β and today's main character is a struct. Pull up a chair, grab a strawberry π, and let's get into it, because this little guy is literally the receipt for every error your NVMe drive ever had.
β¨ NAME β¨
struct nvme_error_log_page β the Error Information Log Entry (that's Log Identifier 01h for the people keeping score π)
so basically: one entry in the error log. one bad day, fully documented.
πΈ SYNOPSIS πΈ
struct nvme_error_log_page {
__le64 error_count;
__le16 sqid;
__le16 cmdid;
__le16 status_field;
__le16 parm_error_location;
__le64 lba;
__le32 nsid;
__u8 vs;
__u8 trtype;
__u8 csi;
__u8 opcode;
__le64 cs;
__le16 trtype_spec_info;
__u8 rsvd[21];
__u8 log_page_version;
};
look at her. sixteen fields of pure "what went wrong and where." no notes. π
π¦ Members π¦
bestie these are the fields, and I'm gonna go through every single one because nothing gets skipped in this house π
error_countβ Error Count: it's a 64-bit incrementing error count, aka a unique identifier for this specific error. It starts at1h, gets incremented for each unique error log entry, and it's retained across power off conditions (so yes, it survives the nap π΄). A value of0hmeans invalid entry β that's what you'll see when there are lost entries, or when there are fewer errors than the maximum number of entries the controller supports. And if this field hitsFFFFFFFFh, then it shall be set to1hwhen incremented (i.e., it rolls over to1h). Heads up though: prior to NVMe 1.4, processing of incrementing beyondFFFFFFFFhis unspecified β so, undefined vibes, proceed with caution π.sqidβ Submission Queue ID: tells you the Submission Queue Identifier of the command that this error info is associated with. But if the error isn't specific to a particular command, then this field shall be set toFFFFh. not everything is about one command, sometimes it's just the universe, yk?cmdidβ Command ID: the Command Identifier of the command the error is associated with. Same deal as above β if the error isn't specific to a particular command, then this field shall be set toFFFFh.status_fieldβ okay so this one has bits, pay attention π«Ά:- Bits 15-1: Status Field β indicates the Status Field for the command that completed. If the error isn't specific to a particular command, then this field reports the most applicable status value.
- Bit 0: Phase Tag β may indicate the Phase Tag posted for the command.
parm_error_locationβ Parameter Error Location: indicates the byte and bit of the command parameter that the error is associated with, if applicable. If the parameter spans multiple bytes or bits, then the location indicates the first byte and bit of the parameter. Breakdown time:- Bits 10-8: Bit in command that contained the error. Valid values are
0to7. - Bits 7-0: Byte in command that contained the error. Valid values are
0to63.
- Bits 10-8: Bit in command that contained the error. Valid values are
lbaβ LBA: this field indicates the first LBA that experienced the error condition, if applicable. pointing at the exact spot like π―nsidβ Namespace: this field indicates the NSID of the namespace that the error is associated with, if applicable.vsβ Vendor Specific Information Available: if there's additional vendor specific error information available, this field provides the log page identifier associated with that page. A value of0hindicates that no additional information is available. Valid values are in the range of80htoFFh. so if it's not0h, go look at that other page, there's lore πtrtypeβ Transport Type (TRTYPE): indicates the Transport Type of the transport associated with the error. The values in this field are the same as the TRTYPE values in the Discovery Log Page Entry. If the error isn't transport related, this field shall be cleared to0h. If it is transport related, this field shall be set to the type of the transport β seeenum nvme_trtype.csiβ Command Set Indicator: this field contains the command set indicator for the command that the error is associated with.opcodeβ Opcode: this field contains the opcode for the command that the error is associated with. yeah. it's giving "which command did this."csβ Command Specific Information: this field contains command specific information. If it's used, the command definition specifies the information returned. so the individual command gets to decide what lives here. main character energy for the command ngl πtrtype_spec_infoβ Transport Type Specific Information. that's it, that's the description, she's mysterious like that β¨rsvdβ Reserved:[62:42]. do not perceive her. she is reserved. πlog_page_versionβ this field shall be set to1h. If it's set, thencsiandopcodewill have valid values. so1h= those two fields are actually saying something real, no cap.
β οΈ tiny PSA before you go:rsvdis reserved, so leave her alone, and remember that incrementing pastFFFFFFFFhbefore NVMe 1.4 is unspecified β don't come crying to me if it does something unhinged π
so that's the whole page, every field, every bit, every FFFFh and 0h accounted for. go forth and decode your error logs like the icon you are π§π
β much love from the struct nvme_error_log_page page itself, dated October 2026, part of the libnvme(9) lineup. slay, stay hydrated, and check your status fields bestie π
πβ
π¦ where this page comes from
- arch rolling: nvme-cli 3.2-1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms