All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 0/3] support command retry
@ 2021-02-10 19:52 Minwoo Im
  2021-02-10 19:52 ` [RFC PATCH 1/3] hw/block/nvme: set NVME_DNR in a single place Minwoo Im
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Minwoo Im @ 2021-02-10 19:52 UTC (permalink / raw)
  To: qemu-devel, qemu-block
  Cc: Kevin Wolf, Dr . David Alan Gilbert, Max Reitz, Klaus Jensen,
	Minwoo Im, Keith Busch

Hello,

This series is RFC about supporting command retry feature in NVMe device
model.  The background to propose this feature is that in kernel
development and testing, retry scheme has not been able to be covered in
QEMU NVMe model device.  If we are able to control the retry scheme
fromt he device side, it would be nice for kernel developers to test.

We have been putting NVME_DNR in the CQ entry status field for
all error cases.  This series added a control for the command retry
based on the 'cmd-retry-delay' parameter which is newly added.  If it's
given to positive value, Command Retry Delay Time1(CRDT1) in the
Identify Controller data structure will be set in 100msec units.
Accordingly, it will cause host to Set Feature with Host Behavior(0x16)
to enable the Advanced Command Retry Enable(ACRE) feature to support
command retry with defined delay.  If 'cmd-retry-delay' param is given
to 0, then command failures will be retried directly without delay.

This series just considered Command Interrupted status code first which
is mainly about the ACRE feature addition.  nvme_should_retry() helper
will decide command should be retried or not.

But, we don't have any use-cases specified for the Command Interrupted
status code in the device model.  So, I proposed [3/3] patch by adding
'nvme_inject_state' HMP command to make users to give pre-defined state
to the controller device by injecting it via QEMU monitor.

Usage:

  # Configure the nvme0 device to be retried every 1sec(1000msec)
  -device nvme,id=nvme0,cmd-retry-delay=1000,...

  (qemu) nvme_inject_state nvme0 cmd-interrupted
  -device nvme,id=nvme0: state cmd-interrupted injected
  (qemu)

  # Then from now on, controller will interrupt all the commands
  # to be processed with Command Interrupted status code.  Then host
  # will retry based on the delay.

Thanks,

Minwoo Im (3):
  hw/block/nvme: set NVME_DNR in a single place
  hw/block/nvme: support command retry delay
  hw/block/nvme: add nvme_inject_state HMP command

 hmp-commands.hx       |  13 ++
 hw/block/nvme.c       | 304 +++++++++++++++++++++++++++++-------------
 hw/block/nvme.h       |  10 ++
 include/block/nvme.h  |  13 +-
 include/monitor/hmp.h |   1 +
 5 files changed, 244 insertions(+), 97 deletions(-)

-- 
2.17.1



^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2021-02-11 10:04 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-10 19:52 [RFC PATCH 0/3] support command retry Minwoo Im
2021-02-10 19:52 ` [RFC PATCH 1/3] hw/block/nvme: set NVME_DNR in a single place Minwoo Im
2021-02-10 20:19   ` Klaus Jensen
2021-02-11  3:40     ` Minwoo Im
2021-02-10 19:52 ` [RFC PATCH 2/3] hw/block/nvme: support command retry delay Minwoo Im
2021-02-10 20:37   ` Klaus Jensen
2021-02-10 19:52 ` [RFC PATCH 3/3] hw/block/nvme: add nvme_inject_state HMP command Minwoo Im
2021-02-10 20:33   ` Klaus Jensen
2021-02-11  3:23     ` Minwoo Im
2021-02-11 10:02     ` Dr. David Alan Gilbert
2021-02-11  3:00   ` Keith Busch
2021-02-11  3:38     ` Minwoo Im
2021-02-11  4:24       ` Keith Busch
2021-02-11  4:40         ` Warner Losh
2021-02-11  6:06         ` Minwoo Im
2021-02-11  7:26         ` Klaus Jensen

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.