[PATCH V6 0/5] nvme-core: timeout related fixes and cleanup
Chaitanya Kulkarni
chaitanya.kulkarni at wdc.com
Wed Nov 4 15:37:31 EST 2020
Hi,
This patch series uses NVME_IO_TIMEOUT for the sync request submission
and user request submission when the timeout is not specified by the
caller and request queue data is set to NULL which is true for admin
queue.
Also in this version, I've added timeout values setting for the NVMeOF
passthru controller given that passthru VUCs (both admin and I/O VUCs)
can differ in execution time than general-purpose admin and I/O command
set following is the detailed scenario :-
Consider NVMeOF target is setup in the passthru mode and both target
and host modules are loaded with the default timeout values present
in the nvme-core.
1. User issues nvme cmd from the host to the target of nvme-cli where
timeout is taken from the controller log page e.g. :-
# nvme io-passthru --timeout=XXX ...
OR
# nvme admin-passthru --timeout=XXX ...
The timeout value in the above example is greater than the default
timeout value present in host-core for both on host machine and the
target machine.
2. The host-core on the host side will set the timeout for the host
request and issues NVMe cmd over transport.
3. In the absence of [1] target will set the timeout value which is
default timeout and that is smaller than the timeout set on the host
side.
4. Due to lack of timeout value not passed over the transport leading
to smaller timeout value for the request on the target than the host
side, target side command will timeout.
This breaks the scenario where the same command with timeout value
from nvme-cli is able to execute with success when issued to NVMe
PCIe ctrl but will fail when it is executed on the NVMeOF Passthru
ctrl.
The last patch centralizes the setting of the request end_io_data
parameter into nvme_alloc_request() similar to what we have done for
setting up the request timeout value in this version.
Regards,
Chaitanya
[1] nvmet: add passthru admin timeout value attr
nvmet: add passthru io timeout value attr
* Changes from V5:-
1. Rebase on the latest nvme-5.10.
2. Centralize setting up the request->timeout value into
nvme_alloc_request().
3. Centralize setting up the request->end_io_data value into
nvme_alloc_request().
4. Update the NVMeOF passthru nvmet_passthru_execute_cmd() such that
it relfect nvme_alloc_request() changes from the first patch when
handling io and admin timeouts.
5. Move nvme_req_set_default_timeout() to host/core.c since there is
only one caller now.
* Changes from V4:-
1. Rebase and retest on nvme-5.10.
* Changes from V3:-
1. Rebase and retest on nvme-5.10.
2. Update the cover-letter with detailed scenario why NVMeOF target
passthru is needed.
3. Wrap the line under 80 char for the last patch.
4. Change the nvme_default_timeout() -> nvme_set_req_default_timeout()
such that it will not take timeout argument.
* Changes from V2:-
1. Introduce nvme_defalt_timeout() helper and use it in host/core.c.
2. Use nvme_default_timeout() in the lightnvme.c
* Changes from V1:-
1. Instead of using qid to decide IO or ADMIN timeout use request
queue's queuedata whch we only set for non admin queue
__nvme_submit_sync_cmd().
2. Add second patch to set IO timeout for nvme_submit_user_cmd().
3. Set the NVMeOF passthru ctrl timeout values with default values from
nvme-core module.
4. Add admin and I/O timeout configfs attributes for NVMeOF passthru
controller.
Chaitanya Kulkarni (5):
nvme: centralize setting req timeout
nvmet: add passthru admin timeout value attr
nvmet: add passthru io timeout value attr
nvme: use consistent macro name for timeout
nvme: centralize setting req end_io_data
drivers/nvme/host/core.c | 35 ++++++++++++-------
drivers/nvme/host/fc.c | 2 +-
drivers/nvme/host/lightnvm.c | 9 +++--
drivers/nvme/host/nvme.h | 5 +--
drivers/nvme/host/pci.c | 15 ++++----
drivers/nvme/host/rdma.c | 2 +-
drivers/nvme/host/tcp.c | 2 +-
drivers/nvme/target/configfs.c | 64 ++++++++++++++++++++++++++++++++++
drivers/nvme/target/loop.c | 2 +-
drivers/nvme/target/nvmet.h | 2 ++
drivers/nvme/target/passthru.c | 12 ++++++-
11 files changed, 117 insertions(+), 33 deletions(-)
--
2.22.1
More information about the Linux-nvme
mailing list