libnvme(9)
π NAME π
struct libnvme_passthru_cmd β the nvme passthrough command structure, aka the little blueprint that lets you yeet a raw NVMe command straight through, bestie.
So this is libnvme we're talking about, and this page is literally just the one struct. Babygirl it is so important though β it's the whole "send whatever command I want" pipeline. π₯
β¨ SYNOPSIS β¨
Okay so here's the struct in all its glory, every single field, no skips:
struct libnvme_passthru_cmd {
__u8 opcode;
__u8 flags;
__u16 rsvd1;
__u32 nsid;
__u32 cdw2;
__u32 cdw3;
__u64 metadata;
__u64 addr;
__u32 metadata_len;
__u32 data_len;
__u32 cdw10;
__u32 cdw11;
__u32 cdw12;
__u32 cdw13;
__u32 cdw14;
__u32 cdw15;
__u32 timeout_ms;
__u32 rsvd2;
__u64 result;
};
She's giving "long list of dwords" and honestly? We respect her for it. π
πΈ Members πΈ
Breakdown time, one field at a time, no cap:
opcodeβ the Operation code, bestie. Go look atenum libnvme_io_opcodesandenum libnvme_admin_opcodesfor the full menu. πflagsβ Supported only for NVMe-MI. That's it, that's the note. πrsvd1β Reserved for future use. Not your business (yet). πnsidβ the Namespace Identifier, or a Fabrics type. Depends on the vibe. π¦cdw2β Command Dword 2 (no spec defined use). It's just there, existing, main character energy of a placeholder. πcdw3β Command Dword 3 (no spec defined use). Same situation, different dword. β¨metadataβ User space address to the metadata buffer (NULLif not used, so please don't point it at nonsense). π§addrβ User space address to the data buffer (NULLif not used). Same rules, same energy. βmetadata_lenβ Metadata buffer transfer length. How much metadata is actually travelling, fr fr. πdata_lenβ Data buffer transfer length. How much data is actually travelling. πcdw10β Command Dword 10 (command specific). Meaning lives in the command, not here. π₯cdw11β Command Dword 11 (command specific). Same deal. πcdw12β Command Dword 12 (command specific). Yep, again. π«Άcdw13β Command Dword 13 (command specific). The pattern is patterning. πcdw14β Command Dword 14 (command specific). Still going. πΈcdw15β Command Dword 15 (command specific). Last of the dword girlies, we love a finale. πtimeout_msβ If non-zero, this overrides the system default timeout, in milliseconds. So if you set it, you are the timeout now. β°rsvd2β Reserved for future use (and fills an implicit struct pad β yes the parenthesis is literally never closed in the source, iykyk, that's just how it shipped π). Still reserved though! π ββοΈresultβ Set on completion to the command's CQE DWORD 0-1 controller response. This is where you find out what actually happened. π
Ngl, a good chunk of this struct is "command specific" and "reserved for future use", so if you're confused, that's not a skill issue β the spec is just like that. π«Ά
π a lil sign-off π
That's the whole page, bestie β struct libnvme_passthru_cmd from the libnvme(9) API Manual, dated October 2026. Go forth and passthrough responsibly. Slay. π
β¨π¦
π¦ 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