[PATCH v8 1/2] nvme: add per-queue sysfs directories
Nilay Shroff
nilay at linux.ibm.com
Mon Nov 9 03:27:23 PST 2026
On 11/7/26 3:23 PM, Saravanan D wrote:
> Per I/O queue transport state, such as the nvme-tcp io_cpu, has
> nowhere to live in sysfs, since the core has no directory for
> individual queues.
>
> Add helpers that create the controller's queues directory and add or
> remove one directory per queue
>
> /sys/class/nvme/nvmeX/queues/<qid>/
>
> carrying the attributes a transport sets in the new queue_attr_groups
> member of struct nvme_ctrl_ops. For such transports nvme_add_ctrl()
> creates the queues directory. It holds a reference on the controller
> device, so nvme_uninit_ctrl() deletes it before deleting the device,
> after the transport has removed the queue directories.
>
> The transport adds a queue's directory when it sets the queue up and
> removes it when it frees the queue, so the directories follow the
> queues across reconnects and changes in the queue count. The core
> allocates each queue directory and its release frees only that
> allocation. Removal waits for running attribute callbacks, so the
> transport may tear the queue down once it returns.
>
> Suggested-by: Sagi Grimberg<sagi at grimberg.me>
> Link:https://lore.kernel.org/linux-nvme/13c160d0-0657-47ce-9a16-58d348267ab0@grimberg.me/
> Assisted-by: Claude:claude-opus-5-5 [Claude Code]
> Signed-off-by: Saravanan D<saravanand at crusoe.ai>
Looks good to me:
Reviewed-by: Nilay Shroff <nilay at linux.ibm.com>
More information about the Linux-nvme
mailing list