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 a void *, so it's flexible like that. only shows up when there's actually feature data to point at.
  • args_size β€” the size of struct 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. the if applicable is 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 an enum 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 from enum 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