All of lore.kernel.org
 help / color / mirror / Atom feed
From: Maurizio Lombardi <m.lombardi85@mail.ru>
To: John Meneghini <jmeneghi@redhat.com>
Cc: Keith Busch <kbusch@kernel.org>,
	sagi@grimberg.me, emilne@redhat.com, hare@kernel.org,
	kbusch@meta.com, linux-nvme@lists.infradead.org,
	mlombard@redhat.com
Subject: Re: [PATCH v2 7/7] nvme: add reserved ioq tags for cancel
Date: Thu, 27 Jun 2024 10:12:13 +0200	[thread overview]
Message-ID: <Zn0e0PK+PM0G4Xkl@kalibr> (raw)
In-Reply-To: <fc2fd513-ab39-4d87-b2ce-e1f86bdf5d45@redhat.com>

V Wed, Jun 26, 2024 at 03:20:08PM -0400, John Meneghini napsal(a):
> > >   	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?
> 
> Yes, good point. I was thinking we don't need more than 2 tags if it's a fabric.
> 
> So you want to reserve 3 tags when both cancel and fabrics are true?

You dropped the reserved tag for the connect command, this is from
the V2 patchset I am working on:

From: Maurizio Lombardi <mlombard@redhat.com>
Date: Tue, 25 Jun 2024 15:45:54 +0200
Subject: [PATCH 3/8] nvme-core: reserve tags for cancel commands

If the controller supports cancel commands, reserve two tags for them

Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
---
 drivers/nvme/host/core.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index fea5400ddf92..1b20f1a10321 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -4532,9 +4532,14 @@ 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 (ctrl->ops->flags & NVME_F_FABRICS)
+       else if (ctrl->ops->flags & NVME_F_FABRICS) {
                /* Reserved for fabric connect */
                set->reserved_tags = 1;
+               if (nvme_io_command_supported(ctrl, nvme_cmd_cancel)) {
+                       /* Reserved for cancel commands */
+                       set->reserved_tags += 2;
+               }
+       }
        set->numa_node = ctrl->numa_node;
        set->flags = BLK_MQ_F_SHOULD_MERGE;
        if (ctrl->ops->flags & NVME_F_BLOCKING)
-- 
2.43.0

Maurizio



  reply	other threads:[~2024-06-27  8:12 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-10 16:30 [PATCH 0/5] Support for Cancel commands for host (TCP and RDMA) Maurizio Lombardi
2024-05-10 16:30 ` [PATCH 1/5] nvme: add definitions for cancel command Maurizio Lombardi
2024-05-10 16:30 ` [PATCH 2/5] nvme-core: add a function to submit a " Maurizio Lombardi
2024-05-12 14:06   ` Sagi Grimberg
2024-06-20  8:31     ` Maurizio Lombardi
2024-06-20 13:01       ` Maurizio Lombardi
2024-06-24 10:06         ` Sagi Grimberg
2024-06-26 18:38           ` [PATCH v2 7/7] nvme: add reserved ioq tags for cancel John Meneghini
2024-06-26 19:03             ` Keith Busch
2024-06-26 19:20               ` John Meneghini
2024-06-27  8:12                 ` Maurizio Lombardi [this message]
2024-06-26 19:10             ` John Meneghini
2024-05-10 16:30 ` [PATCH 3/5] nvme-tcp: use the cancel command to perform an abort if target supports it Maurizio Lombardi
2024-05-10 16:30 ` [PATCH 4/5] nvme-rdma: " Maurizio Lombardi
2024-05-10 16:30 ` [donotmerge PATCH 5/5] nvmet: target support for cancel commands Maurizio Lombardi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Zn0e0PK+PM0G4Xkl@kalibr \
    --to=m.lombardi85@mail.ru \
    --cc=emilne@redhat.com \
    --cc=hare@kernel.org \
    --cc=jmeneghi@redhat.com \
    --cc=kbusch@kernel.org \
    --cc=kbusch@meta.com \
    --cc=linux-nvme@lists.infradead.org \
    --cc=mlombard@redhat.com \
    --cc=sagi@grimberg.me \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.