[PATCH V3 7/8] nvmet-loop: do not alloc admin tag set during reset
Daniel Wagner
dwagner at suse.de
Mon Apr 27 02:46:18 PDT 2026
On Fri, Apr 10, 2026 at 09:39:23AM +0200, Maurizio Lombardi wrote:
> @@ -375,12 +376,15 @@ static int nvme_loop_configure_admin_queue(struct nvme_loop_ctrl *ctrl)
> }
> ctrl->ctrl.queue_count = 1;
>
> - error = nvme_alloc_admin_tag_set(&ctrl->ctrl, &ctrl->admin_tag_set,
> - &nvme_loop_admin_mq_ops,
> - sizeof(struct nvme_loop_iod) +
> - NVME_INLINE_SG_CNT * sizeof(struct scatterlist));
> - if (error)
> - goto out_free_sq;
> + if (new) {
> + error = nvme_alloc_admin_tag_set(&ctrl->ctrl,
> + &ctrl->admin_tag_set,
> + &nvme_loop_admin_mq_ops,
> + sizeof(struct nvme_loop_iod) +
> + NVME_INLINE_SG_CNT * sizeof(struct scatterlist));
> + if (error)
> + goto out_free_sq;
> + }
>
> /* reset stopped state for the fresh admin queue */
> clear_bit(NVME_CTRL_ADMIN_Q_STOPPED, &ctrl->ctrl.flags);
> @@ -415,7 +419,7 @@ static int nvme_loop_configure_admin_queue(struct nvme_loop_ctrl *ctrl)
> return error;
> }
Personally, I am just not a big fan of conditional creation/removal of
resources controlled via a bool. If it's the cleanest solution fine with
me, but I wonder if here it wouldn't be cleaner to allocated the tagset
outside of nvme_loop_configure_admin_queue and obviously the same idea
for destroy.
Have you tried this approach, does it look too ugly?
More information about the Linux-nvme
mailing list