libnvme(2)

✨ libnvme β€” struct nvme_error_log_page ✨

okay bestie, sit down, hydrate, and let me tell you about this little struct from the libnvme API manual πŸ’– this is the one that holds one (1) single entry from the Error Information Log, aka Log Identifier 01h. she's the receipt for when something went wrong πŸ§ΎπŸ’€


πŸŽ€ NAME πŸŽ€

struct nvme_error_log_page β€” Error Information Log Entry (Log Identifier 01h). that's it, that's the girl πŸ’…


🌸 SYNOPSIS 🌸

here's the shape of her, no cap, copy it exactly:

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;
 };

πŸ¦‹ Members πŸ¦‹

field by field, no skips, no shortcuts, we're doing the whole roster:

  • error_count β€” Error Count: a 64-bit incrementing error count, and it's basically this error's unique identifier πŸ†” she starts at 1h, gets bumped up for every unique error log entry, and she stays that way across power off conditions (loyal fr). a value of 0h means the entry is invalid β€” that's what shows up when entries got lost or when there are fewer errors than the maximum number of entries the controller supports. and if this field hits FFFFFFFFh, then it shall be set to 1h when incremented (yep, she rolls over to 1h). ⚠️ heads up though: prior to NVMe 1.4, processing of incrementing beyond FFFFFFFFh is unspecified β€” undefined behaviour era, we don't talk about it 😭
  • sqid β€” Submission Queue ID: the Submission Queue Identifier of the command this error info is associated with. if the error isn't specific to a particular command, this field shall be set to FFFFh.
  • cmdid β€” Command ID: the Command Identifier of the command the error is associated with. if the error isn't specific to a particular command, this field shall be set to FFFFh.
  • status_field β€” Bits 15-1: Status Field for the command that completed. if the error isn't specific to a particular command, this field reports the most applicable status value. Bit 0: Phase Tag β€” may indicate the Phase Tag posted for the command. two-for-one, she contains multitudes πŸ’…
  • parm_error_location β€” Parameter Error Location: the byte and bit of the command parameter the error is associated with, if applicable. if the parameter spans multiple bytes or bits, the location points at the first byte and bit of the parameter.
    • Bits 10-8: Bit in command that contained the error. Valid values are 0 to 7.
    • Bits 7-0: Byte in command that contained the error. Valid values are 0 to 63.
  • lba β€” LBA: the first LBA that experienced the error condition, if applicable. the scene of the crime πŸ•΅οΈ
  • nsid β€” Namespace: the NSID of the namespace the error is associated with, if applicable.
  • vs β€” Vendor Specific Information Available: if there's additional vendor specific error info available, this field provides the log page identifier associated with that page. a value of 0h means no additional information is available. valid values are in the range of 80h to FFh.
  • trtype β€” Transport Type (TRTYPE): 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 to 0h. if the error is transport related, this field shall be set to the type of the transport β€” see enum nvme_trtype.
  • csi β€” Command Set Indicator: holds the command set indicator for the command the error is associated with.
  • opcode β€” Opcode: holds the opcode for the command the error is associated with.
  • cs β€” Command Specific Information: holds command specific information. if used, the command definition specifies the information returned.
  • trtype_spec_info β€” Transport Type Specific Information. short and sweet, she said what she said ✨
  • rsvd β€” Reserved: [62:42] β€” do not touch, she's reserved, respect the boundary πŸ™ˆ
  • log_page_version β€” this field shall be set to 1h. if it's set, csi and opcode will have valid values. set it or lose the lore πŸ”₯

not me writing a whole struct biography bestie but like… the details MATTER. set log_page_version to 1h or csi and opcode are just background characters, no cap πŸ’€

okay that's the whole page, we ate and left no crumbs πŸ“ mwah! this was struct nvme_error_log_page from the libnvme(2) API Manual, dated July 2026 β€” periodt, love u, go read your error logs bestie πŸ«ΆπŸ‘‘

πŸ“¦ where this page comes from