nvme_io_passthru64(2)
β¨ nvme_io_passthru64(2) β¨
okay so bestie, welcome to nvme_io_passthru64 β it's a function from the libnvme API manual and it is literally the "send whatever raw command I want down to the NVMe device" button. it's giving backstage pass energy. π
πΈ NAME πΈ
nvme_io_passthru64 β submit an nvme io passthrough command. yes that's it, that's the whole vibe. π
π SYNOPSIS π
int nvme_io_passthru64 (int fd , __u8 opcode , __u8 flags , __u16 rsvd ,
__u32 nsid , __u32 cdw2 , __u32 cdw3 , __u32 cdw10 , __u32 cdw11 , __u32
cdw12 , __u32 cdw13 , __u32 cdw14 , __u32 cdw15 , __u32 data_len , void
*data , __u32 metadata_len , void *metadata , __u32 timeout_ms , __u64
*result );
look at all those parameters. she's got a lot going on and honestly? we respect it. π
π¦ ARGUMENTS π¦
here's the cast of characters, no cap. every single one, exactly as the original says, because we do not skip details in this house. π
fdβ the file descriptor of the nvme device. your little handle to the hardware, your main character's front door. πopcodeβ the nvme io command to send. this is which command you're yeeting at the device.flagsβ NVMe command flags (not used). she's on the list but she's lowkey not doing anything rn. πrsvdβ reserved for future use. don't touch, it's saving that seat for later. πnsidβ namespace identifier. which namespace we're talking to.cdw2β Command dword 2.cdw3β Command dword 3.cdw10β Command dword 10.cdw11β Command dword 11.cdw12β Command dword 12.cdw13β Command dword 13.cdw14β Command dword 14.cdw15β Command dword 15.
(yes, they really just go cdw2, cdw3, then straight to cdw10 through cdw15. iconic gaps. no notes. that's just how NVMe do. π)
data_lenβ length of the data transferred in this command, in bytes. πdataβ pointer to user address of the data buffer. where the actual payload lives.metadata_lenβ length of metadata transferred in this command.metadataβ pointer to user address of the metadata buffer.timeout_msβ how long the kernel waits for the command to complete. the patience meter. β³resultβ optional field to return the result from the CQE dword 0. optional bestie, so you can pass what you wanna pass here. β¨
π DESCRIPTION π
okay so here's the tea: this is the parameterized form of nvme_submit_io_passthru64. π«Ά
that means it sets up and submits a struct nvme_passthru_cmd64 for you. it's the ~fancy wrapper~ version of the thing, and it's doing all the assembling of that struct so you don't have to.
and the known values for opcode? those are defined in enum nvme_io_opcode. so if you're sitting there like "what number do I even put in the opcode slot", go look at that enum, bestie, that's where the answers live. π
also just like, a gentle nudge: passthrough commands are the raw, low-level, talk-directly-to-the-device kind of deal. they are powerful and the device will absolutely do what you tell it. be the responsible main character. π«‘
β RETURN β
the function gives you back the nvme command status if a response was received β see enum nvme_status_field for what the status values mean, iykyk.
or, if things went sideways and no response showed up, it returns -1 with errno set. so check that errno, she's telling you what happened. π
π SEE ALSO π
no SEE ALSO section on this page, bestie β the references you do get live right up in the text: nvme_submit_io_passthru64, struct nvme_passthru_cmd64, enum nvme_io_opcode, and enum nvme_status_field. go read those for the full lore. π
okay that's the whole page, you ate it, you understood it, periodt. π
this one's nvme_io_passthru64 from the libnvme API manual, and it dropped in July 2026. mwah, go submit some commands responsibly, bye 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