libnvme(2)

πŸ’– libnvme β€” the struct nvme_mi_read_ctrl_info era πŸ’–

okay bestie, so this is a page from the libnvme API Manual (yes, libnvme(2), that's the manual name, we're fancy like that ✨), and today's main character is a lil struct that carries Controller Information Data Structure energy. sit down, hydrate, let's go 🫢


✨ NAME ✨

struct nvme_mi_read_ctrl_info β€” the Controller Information Data Structure. it's giving "here's everything you need to know about this controller, no cap" πŸ’…


🌸 SYNOPSIS 🌸

struct nvme_mi_read_ctrl_info {
    __u8 portid;
    __u8 rsvd1[4];
    __u8 prii;
    __le16 pri;
    __le16 vid;
    __le16 did;
    __le16 ssvid;
    __le16 ssid;
    __u8 rsvd16[16];
 };

look at her. iconic. not a single byte out of place 😌 note that all the multibyte fields are __le16 β€” little-endian, always, don't play with endianness, that's not the vibe πŸ”₯


πŸŽ€ Members πŸŽ€

okay this is the part where we go field by field, and trust, you're gonna want to know all of them πŸ‘‘

  • portid β€” Port Identifier. literally the port's id. that's it, that's the job πŸ’«
  • rsvd1 β€” Reserved. do NOT touch. it's just sitting there, minding its business, holding space (4 bytes of space, to be exact) πŸ™ˆ
  • prii β€” PCIe Routing ID Information. the info about the routing id. the little pre-game before the actual routing id shows up πŸ¦‹
  • pri β€” PCIe Routing ID. the routing id itself, in all its __le16 glory ✨
  • vid β€” PCI Vendor ID. who made this thing πŸ‘‘
  • did β€” PCI Device ID. which thing is this thing πŸ‘‘
  • ssvid β€” PCI Subsystem Vendor ID. the vendor of the subsystem, not the vendor of the device. yes they can be different. yes that's on purpose πŸ’…
  • ssid β€” PCI Subsystem Device ID. the device id of the subsystem. the matching half of the ssvid situation πŸ’–
  • rsvd16 β€” Reserved. again. 16 whole bytes of reserved. not me spiralling over how much reserved space this struct is holding 😭 it's fine. it's fine. leave it ALONE 🌸

⚠️ quick ✨vibe check✨ for the reserved fields: rsvd1 and rsvd16 are Reserved, meaning you do not read meaning into them and you do not write your own little secrets in there. hands off, bestie 🫢

πŸ’œ the sign-off πŸ’œ

and that's the page, fr fr 🌈 this one came from the libnvm source/version, dated July 2026, and it answers to the name struct nvme_mi_read_ctrl_info under the libnvme(2) manual πŸŽ€

go forth and read your controller info correctly, you absolute legend πŸ‘‘πŸ’–

πŸ“¦ where this page comes from