public inbox for linux-nvme@lists.infradead.org
 help / color / mirror / Atom feed
From: Chao Leng <lengchao@huawei.com>
To: Christoph Hellwig <hch@lst.de>, Keith Busch <kbusch@kernel.org>,
	Sagi Grimberg <sagi@grimberg.me>
Cc: James Smart <james.smart@broadcom.com>,
	Chaitanya Kulkarni <kch@nvidia.com>,
	<linux-nvme@lists.infradead.org>
Subject: Re: [PATCH 2/5] nvme: consolidate setting the tagset flags
Date: Tue, 6 Dec 2022 16:43:45 +0800	[thread overview]
Message-ID: <3b03aa7f-ea25-2973-3efc-900676f11220@huawei.com> (raw)
In-Reply-To: <20221130174240.227616-3-hch@lst.de>



On 2022/12/1 1:42, Christoph Hellwig wrote:
> All nvme transports should be using the same flags for their tagsets,
> with the exception for the blocking flag that should only be set for
> transports that can block in ->queue_rq.
> 
> Add a NVME_F_BLOCKING flag to nvme_ctrl_ops to control the blocking
> behavior and lift setting the flags into nvme_alloc_{admin,io}_tag_set.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
>   drivers/nvme/host/core.c   | 15 +++++++++------
>   drivers/nvme/host/fc.c     |  4 ++--
>   drivers/nvme/host/nvme.h   |  9 +++++----
>   drivers/nvme/host/rdma.c   |  3 +--
>   drivers/nvme/host/tcp.c    |  3 +--
>   drivers/nvme/target/loop.c |  4 ++--
>   6 files changed, 20 insertions(+), 18 deletions(-)
> 
> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
> index 3b369900928fde..f31586c4689334 100644
> --- a/drivers/nvme/host/core.c
> +++ b/drivers/nvme/host/core.c
> @@ -4831,8 +4831,7 @@ void nvme_complete_async_event(struct nvme_ctrl *ctrl, __le16 status,
>   EXPORT_SYMBOL_GPL(nvme_complete_async_event);
>   
>   int nvme_alloc_admin_tag_set(struct nvme_ctrl *ctrl, struct blk_mq_tag_set *set,
> -		const struct blk_mq_ops *ops, unsigned int flags,
> -		unsigned int cmd_size)
> +		const struct blk_mq_ops *ops, unsigned int cmd_size)
>   {
>   	int ret;
>   
> @@ -4842,7 +4841,9 @@ int nvme_alloc_admin_tag_set(struct nvme_ctrl *ctrl, struct blk_mq_tag_set *set,
>   	if (ctrl->ops->flags & NVME_F_FABRICS)
>   		set->reserved_tags = NVMF_RESERVED_TAGS;
>   	set->numa_node = ctrl->numa_node;
> -	set->flags = flags;
> +	set->flags = BLK_MQ_F_NO_SCHED;
> +	if (ctrl->ops->flags & NVME_F_BLOCKING)
> +		set->flags |= BLK_MQ_F_BLOCKING;
>   	set->cmd_size = cmd_size;
>   	set->driver_data = ctrl;
>   	set->nr_hw_queues = 1;
> @@ -4890,8 +4891,8 @@ void nvme_remove_admin_tag_set(struct nvme_ctrl *ctrl)
>   EXPORT_SYMBOL_GPL(nvme_remove_admin_tag_set);
>   
>   int nvme_alloc_io_tag_set(struct nvme_ctrl *ctrl, struct blk_mq_tag_set *set,
> -		const struct blk_mq_ops *ops, unsigned int flags,
> -		unsigned int nr_maps, unsigned int cmd_size)
> +		const struct blk_mq_ops *ops, unsigned int nr_maps,
> +		unsigned int cmd_size)
>   {
>   	int ret;
>   
> @@ -4900,7 +4901,9 @@ int nvme_alloc_io_tag_set(struct nvme_ctrl *ctrl, struct blk_mq_tag_set *set,
>   	set->queue_depth = ctrl->sqsize + 1;
>   	set->reserved_tags = NVMF_RESERVED_TAGS;
>   	set->numa_node = ctrl->numa_node;
> -	set->flags = flags;
> +	set->flags = BLK_MQ_F_SHOULD_MERGE;
> +	if (ctrl->ops->flags & NVME_F_BLOCKING)
> +		set->flags |= BLK_MQ_F_BLOCKING;
>   	set->cmd_size = cmd_size,
>   	set->driver_data = ctrl;
>   	set->nr_hw_queues = ctrl->queue_count - 1;
> diff --git a/drivers/nvme/host/tcp.c b/drivers/nvme/host/tcp.c
> index fa245a50f630b8..7cfc1bc021085f 100644
> --- a/drivers/nvme/host/tcp.c
> +++ b/drivers/nvme/host/tcp.c
> @@ -1858,7 +1858,6 @@ static int nvme_tcp_configure_io_queues(struct nvme_ctrl *ctrl, bool new)
>   	if (new) {
>   		ret = nvme_alloc_io_tag_set(ctrl, &to_tcp_ctrl(ctrl)->tag_set,
>   				&nvme_tcp_mq_ops,
> -				BLK_MQ_F_SHOULD_MERGE | BLK_MQ_F_BLOCKING,
tcp should set NVME_F_BLOCKING in ctrl->ops->flags, I did not see that in this patch.
Did I miss something?


  reply	other threads:[~2022-12-06  8:44 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-30 17:42 use the core tagset alloc/free helpers in nvme-pci Christoph Hellwig
2022-11-30 17:42 ` [PATCH 1/5] nvme: pass nr_maps explicitly to nvme_alloc_io_tag_set Christoph Hellwig
2022-12-06 11:59   ` Sagi Grimberg
2022-11-30 17:42 ` [PATCH 2/5] nvme: consolidate setting the tagset flags Christoph Hellwig
2022-12-06  8:43   ` Chao Leng [this message]
2022-12-06  8:46     ` Christoph Hellwig
2022-12-06 11:59       ` Sagi Grimberg
2022-12-06 14:38         ` Christoph Hellwig
2022-11-30 17:42 ` [PATCH 3/5] nvme: only set reserved_tags in nvme_alloc_io_tag_set for fabrics controllers Christoph Hellwig
2022-12-06 12:00   ` Sagi Grimberg
2022-11-30 17:42 ` [PATCH 4/5] nvme: add the Apple shared tag workaround to nvme_alloc_io_tag_set Christoph Hellwig
2022-12-06 12:04   ` Sagi Grimberg
2022-11-30 17:42 ` [PATCH 5/5] nvme-pci: use the tagset alloc/free helpers Christoph Hellwig
2022-12-06  9:59   ` Keith Busch
2022-12-06 12:04   ` Sagi Grimberg
2022-12-06  8:18 ` use the core tagset alloc/free helpers in nvme-pci Christoph Hellwig
2022-12-07  3:22   ` Chaitanya Kulkarni

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=3b03aa7f-ea25-2973-3efc-900676f11220@huawei.com \
    --to=lengchao@huawei.com \
    --cc=hch@lst.de \
    --cc=james.smart@broadcom.com \
    --cc=kbusch@kernel.org \
    --cc=kch@nvidia.com \
    --cc=linux-nvme@lists.infradead.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox