From: jianchao.w.wang@oracle.com (jianchao.wang)
Subject: [Suspected-Phishing]Re: [PATCH V3 1/2] nvme: split resetting state into reset_prepate and resetting
Date: Tue, 16 Jan 2018 15:52:16 +0800 [thread overview]
Message-ID: <26bce6af-b1d4-ea20-775e-193a0a6f9dd4@oracle.com> (raw)
In-Reply-To: <2d198b6a-47f4-8d2b-024d-76161f4b0f90@oracle.com>
On 01/16/2018 01:57 PM, jianchao.wang wrote:
> Hi Max
>
> Thanks for your kindly comment.
>
> On 01/15/2018 09:36 PM, Max Gurtovoy wrote:
>>>>> ????? case NVME_CTRL_RECONNECTING:
>>>>> ????????? switch (old_state) {
>>>>> ????????? case NVME_CTRL_LIVE:
>>>>> ????????? case NVME_CTRL_RESETTING:
>>>>> +??????? case NVME_CTRL_RESET_PREPARE:
>>
>> I forget to add that we shouldn't move from RESET_PREPARE to RECONNECTING (with my suggestion to rdma.c).
>> Also need to consider adding another check in nvmf_check_init_req (/drivers/nvme/host/fabrics.h) for the new state.
>
> After Sagi's nvme-rdma: fix concurrent reset and reconnect, the rdma ctrl state is changed to RECONNECTING state
> after some clearing and shutdown work, then some initializing procedure, no matter reset work path or error recovery path.
> The fc reset work also does the same thing.
> So if we define the range that RESET_PREPARE includes scheduling gap and disable and clear work, RESETTING includes initializing
> procedure, RECONNECTING is very similar with RESETTING.
>
> Maybe we could do like this;
> In nvme fc/rdma
> - set state to RESET_PREPARE, queue reset_work/err_work
> - clear/shutdown works, set state to RECONNECTING
> - initialization, set state to LIVE
>
> In nvme pci
> - set state to RESET_PREPARE, queue reset_work
> - clear/shutdown works, set state to RESETTING
> - initialization, set state to LIVE
Hi Christoph, Keith, Sagi
Can you please comment on this ?
Thanks in advance.
Jianchao
\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0From jianchao.w.wang at oracle.com Tue Jan 16 20:54:35 2018
From: jianchao.w.wang@oracle.com (Jianchao Wang)
Date: Wed, 17 Jan 2018 12:54:35 +0800
Subject: [PATCH V4 0/2] nvme-pci: fix the timeout case when reset is ongoing
Message-ID: <1516164877-2170-1-git-send-email-jianchao.w.wang@oracle.com>
Hello
NVME_CTRL_RESETTING used to indicate the range of nvme initializing
strictly in fd634f41(nvme: merge probe_work and reset_work), but it
is not now. The NVME_CTRL_RESETTING is set before queue the
reset_work, there could be a big gap before the reset work handles
the outstanding requests. So when the NVME_CTRL_RESETTING is set,
nvme_timeout will not only meet the admin requests from the
initializing procedure, but also the IO and admin requests from
previous work before nvme_dev_disable is invoked.
To fix this, based on Christoph's suggestion, splits the
NVME_CTRL_RESETTING into NVME_CTRL_RESET_PREPARE
and NVME_CTRL_RESETTING. At the same time, after Sagi introduced
d5bf4b7 (nvme-rdma: fix concurrent reset and reconnect), both
nvme-rdma/fc use NVME_CTRL_RECONNECTING to mark the setup and
reconnect procedure. The RESETTING state has been narrowed.
So we use this new state NVME_CTRL_RESET_PREPARE to mark the
reset_work or error recovery work, scheduling gap and disable
procedure. After that:
- For nvme-pci, nvmet-loop, set state to RESETTING, start
initialization.
- For nvme-rdma, nvme-fc, set state to RECONNECTING, start
initialization or reconnect.
Finally, we could use NVME_CTRL_RESET_PREPARE to distinguish the
different requests and handle them separately. More details, please
refer to the comment of the 2nd patch.
V4:
- rebase patches on Jens' for-next
- let RESETTING equal to RECONNECTING in terms of work procedure
- change the 1st patch's name and comment
- other misc changes
V3:
- fix wrong reference in loop.c
- other misc changes
V2:
- split NVME_CTRL_RESETTING into NVME_CTRL_RESET_PREPARE and
NVME_CTRL_RESETTING. Introduce new patch based on this.
- distinguish the requests based on the new state in nvme_timeout
- change comments of patch
Jianchao Wang (2)
0001-nvme-add-NVME_CTRL_RESET_PREPARE-state.patch
0002-nvme-pci-fix-the-timeout-case-when-reset-is-ongoing.patch
drivers/nvme/host/core.c | 18 +++++++++++++---
drivers/nvme/host/fc.c | 4 ++--
drivers/nvme/host/nvme.h | 8 +++++++
drivers/nvme/host/pci.c | 54 +++++++++++++++++++++++++++++++++++-----------
drivers/nvme/host/rdma.c | 2 +-
drivers/nvme/target/loop.c | 5 +++++
6 files changed, 72 insertions(+), 19 deletions(-)
Thanks
Jianchao
next prev parent reply other threads:[~2018-01-16 7:52 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-11 5:07 [PATCH V3 0/2] nvme-pci: fix the timeout case when reset is ongoing Jianchao Wang
2018-01-11 5:07 ` [PATCH V3 1/2] nvme: split resetting state into reset_prepate and resetting Jianchao Wang
2018-01-14 9:48 ` Sagi Grimberg
2018-01-15 2:02 ` jianchao.wang
2018-01-15 2:11 ` Keith Busch
2018-01-15 2:31 ` jianchao.wang
2018-01-15 13:28 ` Max Gurtovoy
2018-01-15 13:36 ` [Suspected-Phishing]Re: " Max Gurtovoy
2018-01-16 5:57 ` jianchao.wang
2018-01-16 7:52 ` jianchao.wang [this message]
2018-01-17 10:37 ` Sagi Grimberg
2018-01-17 10:50 ` Max Gurtovoy
2018-01-17 12:02 ` Sagi Grimberg
2018-01-17 21:08 ` James Smart
2018-01-18 3:24 ` jianchao.wang
2018-01-15 14:07 ` jianchao.wang
2018-01-11 5:07 ` [PATCH V3 2/2] nvme-pci: fix the timeout case when reset is ongoing Jianchao Wang
2018-01-14 9:49 ` Sagi Grimberg
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=26bce6af-b1d4-ea20-775e-193a0a6f9dd4@oracle.com \
--to=jianchao.w.wang@oracle.com \
/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