All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chaitanya Kulkarni <chaitanyak@nvidia.com>
To: Sagi Grimberg <sagi@grimberg.me>
Cc: "linux-nvme@lists.infradead.org" <linux-nvme@lists.infradead.org>,
	"hch@lst.de" <hch@lst.de>,
	"kbusch@kernel.org" <kbusch@kernel.org>,
	Chaitanya Kulkarni <chaitanyak@nvidia.com>,
	"james.smart@broadcom.com" <james.smart@broadcom.com>
Subject: Re: [PATCH] nvme: set non-mdts limits at I/O queue creation
Date: Tue, 17 May 2022 22:41:54 +0000	[thread overview]
Message-ID: <955bc8aa-dc88-68a9-c656-51e52fe589f6@nvidia.com> (raw)
In-Reply-To: <dd46fded-d213-6956-8f0a-69a70e0107d5@grimberg.me>

On 5/17/22 02:56, Sagi Grimberg wrote:
> 
> 
> On 5/17/22 08:53, Chaitanya Kulkarni wrote:
>> In current implementation we set the non-mdts limits by calling
>> nvme_init_non_mdts_limits() from nvme_init_ctrl_finish().
>> This also tries to set the limits for the discovery controller which
>> has no I/O queues resulting in the warning message reported by the
>> nvme_log_error() when running blktest nvme/002: -
>>
>> [ 2005.155946] run blktests nvme/002 at 2022-04-09 16:57:47
>> [ 2005.192223] loop: module loaded
>> [ 2005.196429] nvmet: adding nsid 1 to subsystem blktests-subsystem-0
>> [ 2005.200334] nvmet: adding nsid 1 to subsystem blktests-subsystem-1
>>
>> <------------------------------SNIP---------------------------------->
>>
>> [ 2008.958108] nvmet: adding nsid 1 to subsystem blktests-subsystem-997
>> [ 2008.962082] nvmet: adding nsid 1 to subsystem blktests-subsystem-998
>> [ 2008.966102] nvmet: adding nsid 1 to subsystem blktests-subsystem-999
>> [ 2008.973132] nvmet: creating discovery controller 1 for subsystem 
>> nqn.2014-08.org.nvmexpress.discovery for NQN testhostnqn.
>> *[ 2008.973196] nvme1: Identify(0x6), Invalid Field in Command (sct 
>> 0x0 / sc 0x2) MORE DNR*
>> [ 2008.974595] nvme nvme1: new ctrl: 
>> "nqn.2014-08.org.nvmexpress.discovery"
>> [ 2009.103248] nvme nvme1: Removing ctrl: NQN 
>> "nqn.2014-08.org.nvmexpress.discovery"
>>
>> Export the nvme_init_non_mdts_limits() and move the same call from
>> nvme_ctrl_finish() to each transport right before each transport calls
>> the nvme_scan_work() from nvme_start_ctrl() path, then proceeds to the
>> ns allocation where these limits max_discard_{segments|sectors} and
>> max_write_zeroes_sectors are actually used in folllwing path :-
> 
> Why not just check the ctrl->queue_count and call it accordingly?

nvme_init_ctrl_finish() is called before the I/O queues are allocated
so queue_count value will be always equal to 1 when checked in the
nvme_init_ctrl_finish() before calling the
nvme_init_non_mdts_limits() for PCIe :-

nvme_reset_work()
...
  nvme_init_ctrl_finish()
   nvme_init_non_mdts_limits() <--- ctrl->queue_count = 1
  nvme_dev_add()
  nvme_setup_io_queues()
   nvme_create_io_queues()
    nvme_alloc_queue()
     dev->ctrl.queue_count++ <---
...

Also, this patch groups reading ctrl non-mdts limits right before I/O
queue allocation for each transport, since these limits are only
used for I/O queue allocation.

-ck



  reply	other threads:[~2022-05-17 22:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-17  5:53 [PATCH] nvme: set non-mdts limits at I/O queue creation Chaitanya Kulkarni
2022-05-17  9:56 ` Sagi Grimberg
2022-05-17 22:41   ` Chaitanya Kulkarni [this message]
2022-05-17 22:44     ` Keith Busch
2022-05-17 22:49       ` Chaitanya Kulkarni
2022-05-17 22:58         ` Keith Busch
2022-05-17 23:02           ` 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=955bc8aa-dc88-68a9-c656-51e52fe589f6@nvidia.com \
    --to=chaitanyak@nvidia.com \
    --cc=hch@lst.de \
    --cc=james.smart@broadcom.com \
    --cc=kbusch@kernel.org \
    --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 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.