libnvme(2)
β¨ libnvme β API Manual β¨
okay bestie, welcome to libnvme(2) π this is the page where we meet struct nvme_passthru_cmd, aka the nvme passthrough command structure. yes it's a struct, yes it's giving main character energy, and yes you're gonna learn every single field, no skips, no cap π«Ά
πΈ NAME πΈ
struct nvme_passthru_cmd β the nvme passthrough command structure, your lil' backstage pass to talking straight to a controller π
β SYNOPSIS β
struct nvme_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 result;
};
look at her. seventeen fields. a whole queen π and now let's meet each one by name.
π Members π
this is the part where I introduce you to the whole squad, one by one, no one gets left out π
opcodeβ the Operation code, bestie. peek atenum nvme_io_opcodesandenum nvme_admin_opcodesto see your options πflagsβ not supported: it's intended for command flags (for example: SGL, FUSE), but it's not actually a thing yet πrsvd1β Reserved for future use. she's just vibing. do not touch πnsidβ Namespace Identifier, or the Fabrics type. yes, she does double duty, we love a multitasker β¨cdw2β Command Dword 2 (no spec defined use). literally no spec says what she does, iconic behavior πcdw3β Command Dword 3 (no spec defined use). twin sister ofcdw2, equally mysterious π¦metadataβ the user space address to the metadata buffer (NULLif not used). no metadata? just passNULL, we're chill πΈaddrβ the user space address to the data buffer (NULLif not used). same deal, no data meansNULLhoney π«Άmetadata_lenβ Metadata buffer transfer length. how much metadata are we moving, babes πdata_lenβ Data buffer transfer length. how much data are we moving, fr fr π¦cdw10β Command Dword 10 (command specific). she's special to her command and only her command πcdw11β Command Dword 11 (command specific). again, command specific πcdw12β Command Dword 12 (command specific). you get the vibe by now βcdw13β Command Dword 13 (command specific). yup πcdw14β Command Dword 14 (command specific). still going πcdw15β Command Dword 15 (command specific). the last of the command-specific dword girlies, we stan a full set π§timeout_msβ if she's non-zero, she overrides the system default timeout, in milliseconds β±οΈ a little "actually, we're waiting this long" energyresultβ gets set on completion to the command's CQE DWORD 0 controller response. that's the controller talking back to you, bestie π£οΈβ¨
quick reminder: flags is not supported β so don't go building your whole personality on passing SGL or FUSE through it, okay? π
that's the whole struct, you ate this π½οΈπ iykyk β and if you didn't know before, now you literally do. periodt.
this page is part of the libnvme(2) API Manual, documenting struct nvme_passthru_cmd, dated July 2026 π go forth and pass those 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