nvme_init_cancel(9)

πŸ“¦ version 3.2, in arch rolling

πŸ’… nvme_init_cancel β€” bestie's guide to the libnvme API manual

Okay so picture this: you're deep in the libnvme API manual (yes, the whole thing), and you've stumbled onto nvme_init_cancel(9). Don't panic 🫢 β€” it's literally just the setup girlie for the Cancel command, and she's way simpler than she looks. Let's get into it ✨


🌸 NAME 🌸

nvme_init_cancel β€” initializes the passthru command buffer so it's all cute and ready for the Cancel command πŸ’…


✨ SYNOPSIS ✨

void nvme_init_cancel (struct libnvme_passthru_cmd *cmd , __u32 nsid ,
       __u16 sqid , __u16 cid , enum nvme_cancel_acode acode );

No cap, that's the whole signature. Five args, zero drama. 🌈


πŸŽ€ ARGUMENTS πŸŽ€

  • cmd β€” the passthru command you're gonna use. This is the blank canvas, the main character, the one getting initialized. πŸ–ŒοΈ
  • nsid β€” Namespace identifier, or NVME_NSID_ALL if you're going for the "everybody" vibe. It's a __u32, so she's got range.
  • sqid β€” the Submission Queue Identifier (SQID) that the Cancel command is associated with. Think of it as the group chat this Cancel is getting sent into. πŸ’¬
  • cid β€” the Command Identifier (CID) of the command you're trying to abort. ⚠️ Big heads-up: this gets ignored if acode is NVME_CANCEL_ACODE_MULTIPLE_CMD. Like, completely ignored. Don't come for her. πŸ’€
  • acode β€” the Action Code (ACODE). Peep enum nvme_cancel_acode for the full menu of options. πŸ“

πŸ”₯ DESCRIPTION πŸ”₯

So here's the tea on what the Cancel command actually does β˜• β€” it requests an abort for specified commands submitted on the same I/O Submission Queue that the Cancel command itself was submitted to. Same queue, bestie. No hopping around. πŸ¦‹

And the receipts? The number of commands eligible for a deferred abort, plus the number of commands aborted, both come back in the CQE result β€” see enum nvme_cancel_cqe_dw0 if you wanna get into the nitty-gritty. πŸ‘‘

This function's whole job is initializing the passthru command buffer for the Cancel command. That's it. That's the job. And she ate. πŸ’…βœ¨


ngl, the cid-ignored-when-NVME_CANCEL_ACODE_MULTIPLE_CMD thing is the one detail people miss, so don't let it be you, okay? πŸ™ˆ

That's the whole page, bestie β€” straight from the libnvme API manual, dating all the way to October 2026 πŸ’–

πŸ“¦ where this page comes from