NVME_MI_MI_READ_MI_DATA_PORT(2)

πŸ’– NAME πŸ’–

nvme_mi_mi_read_mi_data_port β€” bestie, this one runs a Read MI Data Structure command and pulls the port data back for you ✨

Oh and hey, you're reading the libnvme API manual rn, welcome welcome 🫢


🌸 SYNOPSIS 🌸

int nvme_mi_mi_read_mi_data_port (nvme_mi_ep_t ep , __u8 portid , struct nvme_mi_read_port_info *p );

πŸŽ€ ARGUMENTS πŸŽ€

  • ep β€” the endpoint for MI communication, aka the whole reason we can talk at all πŸ’…
  • portid β€” the id of the port data you wanna retrieve, like which port's tea are we spilling
  • p β€” port information to populate, i.e. where the answers get dropped off πŸ“¬

πŸ¦‹ DESCRIPTION πŸ¦‹

So basically it retrieves the Port information for the port ID you specify, no cap. 🫢

And here's the little detail that matters: the subsystem data (the one from nvme_mi_mi_read_mi_data_subsys) has an nmp field, and that field is the thing holding the allowed range of port IDs. So that's your vibe check on which portid values are even legal to ask for πŸ‘‘

Also, peep struct nvme_mi_read_port_info for the shape of what you're getting back β€” it's giving very much "read this struct, know your data" energy 🌈


⭐ RETURN ⭐

  • If a response came back: you get the nvme command status (go look at enum nvme_status_field for the deets πŸ‘€)
  • Otherwise: -1 with errno set. It's not you, it's the error. 😭

fr fr bestie, always check that errno when you see -1 β€” the answer is right there πŸ’€

That's the whole page, periodt. πŸ’œ Signed off from July 2026, live from the libnvme API manual β€” stay slaying, and may all your port IDs be in range πŸ§šβ€β™€οΈπŸŒΈ

πŸ“¦ where this page comes from