libnvme(9)
π libnvme(9) β the API manual, but make it cute
okay bestie, you opened a manual page from libnvme, the NVMe library, and this one is all about one lil struct. yes, a struct. but it's an iconic struct, because it's the whole argument bundle for the NVMe Admin Get Feature command. let's get into it π
β¨ NAME β¨
struct nvme_get_features_args β Arguments for the NVMe Admin Get Feature command
like. the name literally tells you everything. it's the args struct. for get features. periodt. π
πΈ SYNOPSIS πΈ
struct nvme_get_features_args {
__u32 *result;
void *data;
int args_size;
int fd;
__u32 timeout;
__u32 nsid;
enum nvme_get_features_sel sel;
__u32 cdw11;
__u32 data_len;
__u8 fid;
__u8 uuidx;
};
no cap, that's the whole thing. every field, character for character, i am not touching a single one π
π«Ά Members π«Ά
okay so now the part where we meet everyone in the group chat one by one:
resultβ the command completion result that comes back from CQE dword0. this is where the answer lands, bestie. it's a pointer to__u32, so it hands you back the number by reference. lowkey the main character of this struct πdataβ user address of feature data, if applicable. it's avoid *, so it's flexible like that. only shows up when there's actually feature data to point at.args_sizeβ the size ofstruct nvme_get_features_args. yes it's self-referential and yes it's giving "i contain my own measurements" energy. it's just the size of this struct. simple. clean. πfdβ file descriptor of the nvme device. your ticket to the actual device. without it you're just vibing in userspace for no reason πtimeoutβ timeout in ms. in. milliseconds. so don't go putting seconds in there unless you want to wait a thousand times longer, which, respectfully, you do not.nsidβ namespace ID, if applicable. theif applicableis doing a lot of heavy lifting here, but that's on the command, not on us.selβ select which type of attribute to return. it's anenum nvme_get_features_sel, so go look at that enum for your options. iykyk πcdw11β feature specific command dword11 field. yes it's literally named after its position in the command. no we do not question the naming conventions of the ancients. it's feature specific, so the meaning depends on the feature. πdata_lenβ length of feature data, if applicable, in bytes. note: bytes. and again with the "if applicable". it's a recurring theme, it's a vibe. π¦fidβ feature identifier. it's a__u8, and you get the valid values fromenum nvme_features_id. this is the "which feature are we even asking about" field, so like. kinda important. βuuidxβ UUID Index for differentiating vendor specific encoding. so when vendors do vendor things, this is how you tell their encodings apart. shady? maybe. necessary? apparently. π
quick vibe check: every one of these fields matters, and args_size really does need to be the size of the struct. don't be out here guessing sizes, bestie, that's how you get sadness. π₯Ί
and that's the page!! slay π§
this was libnvme(9), the API Manual, from the libnvme source β dated August 2026, page title struct nvme_get_features_args. mwah, go read enum nvme_get_features_sel and enum nvme_features_id next, they're right there waiting for you ππΈ
π¦ 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