libnvme(2)
π NAME π
struct nvme_passthru_cmd64 β the 64-bit nvme passthrough command structure π¦
ok so bestie, welcome to section 2 of the libnvme API Manual β yes, the actual manual, manual name and all, and today's main character is a struct. A whole struct. And honestly? She deserves it. π
If you've ever wanted to just... tell an NVMe drive exactly what to do, no vibes-filtering, no fancy abstraction layer, no "the library will handle it" β that's what passthrough is. You hand the kernel a command basically as-is, and it goes straight to the controller. And this struct is the 64-bit version of that envelope. β¨
β¨ SYNOPSIS β¨
struct nvme_passthru_cmd64 {
__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;
};
look at her. so many __u32s. so many dwords. iconic. π§
π Members π
okay bestie, let's go field by field, no skipping, I see you trying to scroll past cdw13 π
opcodeβ the operation code. which command are we even doing? checkenum nvme_io_opcodesandenum nvme_admin_opcodes, that's where the answers live. πflagsβ not supported. like, the field is there but it's meant for command flags (eg:SGL,FUSE) and it doesn't do that. don't @ it. πrsvd1β reserved for future use. basically a little seat saved for a future era. πnsidβ Namespace Identifier, or a Fabrics type, depending on the situation. she contains multitudes. πΈcdw2β Command Dword 2, and there is no spec defined use for this one. it's just... hanging out. π¦cdw3β Command Dword 3, same situation, no spec defined use. her andcdw2are a duo fr fr. πmetadataβ user space address to the metadata buffer. if you're not using it, it'sNULL. periodt. β¨addrβ user space address to the data buffer. alsoNULLif you're not using it. πmetadata_lenβ Metadata buffer transfer length. how much metadata are we moving, bestie. πdata_lenβ Data buffer transfer length. how much data are we moving. π¦cdw10β Command Dword 10, and this one is command specific, so its meaning depends onopcode. iykyk. π§cdw11β Command Dword 11, also command specific. π₯cdw12β Command Dword 12, command specific, still going. βcdw13β Command Dword 13, command specific, the one you tried to skip. I saw that. πcdw14β Command Dword 14, command specific. πcdw15β Command Dword 15, command specific. and that's the whole dword lineup, slay. πtimeout_msβ if this is non-zero, it overrides the system default timeout, measured in milliseconds. non-zero = you're the boss now. β°rsvd2β reserved for future use (and fills an implicit struct pad β yeah the paren never closes, that's how the source text is, and honestly? she's valid to me. π«Ά)resultβ set on completion to the command's CQE DWORD 0-1 controller response. this is where you find out how it went. π
heads up bestie βflagsbeing unsupported andrsvd1/rsvd2being reserved are not suggestions. leave reserved stuff alone and don't expectflagsto do anything, no cap. π«
and that's the whole struct, every single field, nothing skipped, because you deserve to know all of her π₯Ή
cute lil sign-off moment: this page came from the struct nvme_passthru_cmd64 entry in the libnvme(2) manual, and it's dated July 2026 β so yeah, she's from the future and she's still out here describing a 64-bit passthrough command. timeless. go forth and pass commands through, bestie πβ¨
π¦ 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