libnvme(9)
π libnvme(9) β bestie edition π
okay so you're reading the libnvme API manual, section 9, and we're about to get SO cozy with one very specific struct. buckle up, this is gonna be a whole vibe π¦
β¨ NAME β¨
struct nvme_io_args β the lil argument bag you hand over when you wanna run NVMe I/O commands π
β¨ SYNOPSIS β¨
struct nvme_io_args {
__u64 slba;
__u64 storage_tag;
__u32 *result;
void *data;
void *metadata;
int args_size;
int fd;
__u32 timeout;
__u32 nsid;
__u32 reftag;
__u32 data_len;
__u32 metadata_len;
__u16 nlb;
__u16 control;
__u16 apptag;
__u16 appmask;
__u16 dspec;
__u8 dsm;
__u8 rsvd1[1];
__u64 reftag_u64;
__u8 sts;
__u8 pif;
};
like, look at her. twenty-one fields. every single one of them matters. no skipping. π
β¨ Members β¨
the whole roster, one by one π
slbaβ the starting logical block. that's it, that's the field. your launch point, bestie πstorage_tagβ this field specifies the Variable Sized Expected Logical Block Storage Tag (ELBST) or the Logical Block Storage Tag (LBST). two acronyms, one field, iconic behavior honestly.resultβ the command completion result, straight outta CQE dword0. this is where the answer lands.dataβ a pointer to the user address of the data buffer. where your actual bytes live π«Άmetadataβ a pointer to the user address of the metadata buffer. the data buffer's little sibling πargs_sizeβ the size ofstruct nvme_io_args. yes she knows her own size, self-aware queen.fdβ the file descriptor of the nvme device. your ticket in ποΈtimeoutβ timeout in ms. milliseconds. tick tock β³nsidβ Namespace ID. which namespace are we even talking to, bestie?reftagβ this field specifies the variable sized Expected Initial Logical Block Reference Tag (EILBRT) or the Initial Logical Block Reference Tag (ILBRT). it's only used if the namespace is formatted to use end-to-end protection information. read that again. only then. fr fr.data_lenβ the length of the user buffer,data, in bytes. count them, don't guess πmetadata_lenβ the length of the user buffer,metadata, in bytes. same energy, different buffer.nlbβ number of logical blocks to send. and yes it's a 0's based value, so be normal about the math.controlβ command control flags, seeenum nvme_io_control_flags. go look, iykyk.apptagβ this field specifies the Application Tag Mask expected value. used only if the namespace is formatted to use end-to-end protection information. yep, another one of those.appmaskβ this field specifies the Application Tag expected value. used only if the namespace is formatted to use end-to-end protection information. (and yes, the doc really does describeapptagas the mask andappmaskas the expected value β we don't make the rules, we just report them π)dspecβ directive specific value. short name, big responsibility.dsmβ data set management attributes, seeenum nvme_io_dsm_flags.rsvd1β Reserved. she's just sitting there. leave her alone. πreftag_u64β this field specifies the variable sized Expected Initial Logical Block Reference Tag (EILBRT) or the Initial Logical Block Reference Tag (ILBRT). it's the 8 byte version required for enhanced protection information. used only if the namespace is formatted to use end-to-end protection information. so basicallyreftag's glow-up β¨stsβ storage tag size in bits, set by the namespace Extended LBA Format. set by the namespace, not by you. let her cook.pifβ protection information format. it determines how the variable sizedstorage_tagandreftagget put into dwords 2, 3, and 14. set by the namespace Extended LBA Format. so if your tags look weird in those dwords, this field is the one who did it π§
πΈ quick vibe check: a whole bunch of these fields βreftag,reftag_u64,apptag,appmaskβ are only in play when the namespace is formatted for end-to-end protection information. andsts+pifget set by the namespace's Extended LBA Format. you don't get to freelance those. periodt.
and that's the page!! π this was struct nvme_io_args from the libnvme API Manual, section libnvme(9), dated August 2026. slay, go write some I/O π₯π
π¦ where this page comes from
- fedora 44: libnvme-doc 1.16.2-1.fc44 Β· 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