linux/drivers/nvme/host
Chaitanya Kulkarni 78288665b5 nvme: set non-mdts limits in nvme_scan_work
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"

Move the call of nvme_init_non_mdts_limits() to nvme_scan_work() after
we verify that I/O queues are created since that is a converging point
for each transport where these limits are actually used.

1. FC :
nvme_fc_create_association()
 ...
 nvme_fc_create_io_queues(ctrl);
 ...
 nvme_start_ctrl()
  nvme_scan_queue()
   nvme_scan_work()

2. PCIe:-
nvme_reset_work()
 ...
 nvme_setup_io_queues()
  nvme_create_io_queues()
   nvme_alloc_queue()
 ...
 nvme_start_ctrl()
  nvme_scan_queue()
   nvme_scan_work()

3. RDMA :-
nvme_rdma_setup_ctrl
 ...
  nvme_rdma_configure_io_queues
  ...
  nvme_start_ctrl()
   nvme_scan_queue()
    nvme_scan_work()

4. TCP :-
nvme_tcp_setup_ctrl
 ...
  nvme_tcp_configure_io_queues
  ...
  nvme_start_ctrl()
   nvme_scan_queue()
    nvme_scan_work()

* nvme_scan_work()
...
nvme_validate_or_alloc_ns()
  nvme_alloc_ns()
   nvme_update_ns_info()
    nvme_update_disk_info()
     nvme_config_discard() <---
     blk_queue_max_write_zeroes_sectors() <---

Signed-off-by: Chaitanya Kulkarni <kch@nvidia.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2022-05-19 21:30:22 +02:00
..
constants.c nvme: add support for TP4084 - Time-to-Ready Enhancements 2022-05-18 18:54:17 +02:00
core.c nvme: set non-mdts limits in nvme_scan_work 2022-05-19 21:30:22 +02:00
fabrics.c nvme-fabrics: remove unnecessary braces for case 2022-02-28 13:45:04 +02:00
fabrics.h nvme-fabrics: add a request timeout helper 2022-05-16 08:07:25 +02:00
fault_inject.c block: remove the ->rq_disk field in struct request 2021-11-29 06:41:29 -07:00
fc.c nvme: add a helper to initialize connect_q 2022-02-28 13:45:06 +02:00
fc.h nvme-fc: Update header and host for common definitions for LS handling 2020-05-09 16:18:33 -06:00
hwmon.c nvme-hwmon: Return error code when registration fails 2021-03-05 13:41:03 +01:00
ioctl.c nvme: remove nvme_alloc_request and nvme_alloc_request_qid 2022-03-16 09:47:05 +01:00
Kconfig nvme: add verbose error logging 2022-02-28 13:45:06 +02:00
Makefile nvme: add verbose error logging 2022-02-28 13:45:06 +02:00
multipath.c for-5.18/drivers-2022-04-01 2022-04-01 16:26:57 -07:00
nvme.h nvme: fix interpretation of DMRSL 2022-05-16 08:06:54 +02:00
pci.c nvme-pci: harden drive presence detect in nvme_dev_disable() 2022-05-16 08:07:19 +02:00
rdma.c nvme-fabrics: add a request timeout helper 2022-05-16 08:07:25 +02:00
tcp.c nvme-fabrics: add a request timeout helper 2022-05-16 08:07:25 +02:00
trace.c nvme: add set feature tracing support 2021-08-16 14:42:23 +02:00
trace.h block: remove the ->rq_disk field in struct request 2021-11-29 06:41:29 -07:00
zns.c nvme: report write pointer for a full zone as zone start + zone len 2021-12-06 08:52:08 +01:00