[PATCH v2 7/7] nvme: add reserved ioq tags for cancel

Keith Busch kbusch at kernel.org
Wed Jun 26 12:03:18 PDT 2024


On Wed, Jun 26, 2024 at 02:38:19PM -0400, John Meneghini wrote:
> If the nvme Cancel command is supported, we need to reserve 2 tags for
> each IO queue. Note that one addition tag is reserved to account for
> the case where this is a fabrics controller.
 
> @@ -4580,9 +4581,13 @@ int nvme_alloc_io_tag_set(struct nvme_ctrl *ctrl, struct blk_mq_tag_set *set,
>  	 */
>  	if (ctrl->quirks & NVME_QUIRK_SHARED_TAGS)
>  		set->reserved_tags = NVME_AQ_DEPTH;
> +	else if  (effects & NVME_CMD_EFFECTS_CSUPP)
> +		/* Reserve 2 X io_queue count for NVMe Cancel */
> +		set->reserved_tags = (2 * ctrl->queue_count);

The reserved_tags are already per queue, no need to multiply.

>  	else if (ctrl->ops->flags & NVME_F_FABRICS)
>  		/* Reserved for fabric connect */
>  		set->reserved_tags = 1;

You mentioned an addtional tags is supposed to be reserved for fabrics.
Shouldn't this just be an "if", not an "else if", and then increment
reserved_tags?



More information about the Linux-nvme mailing list