Received: by 10.223.148.5 with SMTP id 5csp7693179wrq; Thu, 18 Jan 2018 08:26:08 -0800 (PST) X-Google-Smtp-Source: ACJfBouX8CkiGaGIvATjY1mCbWR3DGRS+nCzlekN1Lwq+BxJxxXwMC+SMNCWiICi290rytGjoNlP X-Received: by 2002:a17:902:9343:: with SMTP id g3-v6mr44810plp.319.1516292768681; Thu, 18 Jan 2018 08:26:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516292768; cv=none; d=google.com; s=arc-20160816; b=hY5FVIEpPhmbAjrNcQ2V/lLbk69nYLCAkhYC+oOg7dGmcHGuab5AbjpP9OSXpn8+Zh LbVNXLAyTu1Xbxp3LjWMrhHQu5z7uFOIXU5cKzWgO9KtdtZJWuV9NSWq0xatB014MkVx HTHnHve8PLKl8yTExPJZ+ZJW/NKZB7Zl7SiNqWnfg/+Y9aCmJzkRjbOhs1zfOV0fQzFJ KK6RD6zaGA8rI7XFg/816qd1hRKkh1cJnZdWaEijKC77Dh1tL+BHpCplDooiGOeA2Jpd oQ7SugAeBIceoLOG8qzTrWM2TJVEnEDppbMTUe73y3T1D2Z2YHTA3KisQimWXwQupIR9 juKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=GpPIALHPeIODhl0EObfJ8+eoEbnHX0JY//Wv96OkntQ=; b=cu4O3BkaZLfQLFXICL7CThcw+4xNCrkIsHZ7DstFNX/XwYio3LkxatbkQtMgvkas/Q MeUI5NA+By0+B+8AmnxzS0zgJfasQ1XHAQitCpchq5bSyVF1lOsR1KgR/x26GsthCi9W /KJTvMKimAw54zn3ybPEnFIOE//ck5c5+uUa8chPNmmCZSD7yf/RyBQaHBj+uJBU5Zo+ VzdppKPYRMAlIcOBf2W6JX6AF6N+kpNbHJbzf7SvazHOtcHXs5TzD8hagQ/1JZGsyKbq ZmS5SeYqsS5BdbYnUtde1j92nWzITByuhGhS+D4h1huYJi4W+zMvFBeFxaQqhfmWifT4 OQ9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=hPc3lyAZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f31-v6si11069plf.601.2018.01.18.08.25.54; Thu, 18 Jan 2018 08:26:08 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=hPc3lyAZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932486AbeARPfH (ORCPT + 99 others); Thu, 18 Jan 2018 10:35:07 -0500 Received: from mail-pg0-f67.google.com ([74.125.83.67]:38984 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932484AbeARPfF (ORCPT ); Thu, 18 Jan 2018 10:35:05 -0500 Received: by mail-pg0-f67.google.com with SMTP id w17so8691803pgv.6 for ; Thu, 18 Jan 2018 07:35:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=GpPIALHPeIODhl0EObfJ8+eoEbnHX0JY//Wv96OkntQ=; b=hPc3lyAZF9BkxYYA2Pl/tv8rHzqQKXq9STZirpVPQo/KeP3x73j2MFqifKpaIUC0iU jruJimpC+auP5Uun3DFQ4hiFrtRojl4zfBoZ2T5lZU1+xQgFj8HOyZ8aY8wU6afiFdPr 8PC4tsRNrrAQCAf7/5yIn57Uexgmd763DG2Ig= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=GpPIALHPeIODhl0EObfJ8+eoEbnHX0JY//Wv96OkntQ=; b=sCX6Oi9PenMPXDCUqpSiZjvprTfCIR4A7XI1xm8RYDaAeZUxn29zn3PUMdet1LD3RC PqSoDLJqnsfGYuQPwAaFyzUkScHYK1SVNAX2oQGLbcn8PpLtNob0vh57Bn5TIoZpNsSC LustcqLduaWZkmmnDQKpt2sboHprIbsjy1DDgfOLez5H05PI1BJ39zUFrWCWIk7HXMaq 1gOSnFaWs16iM1LvK6nsOdnTf5jg4LNEvYhqvSXaVgDReyVjobGPG6ArFRrYmGqBy4NJ aLqxAa3Ui4YVLjlIiYFn0Uu90eZM4cwr+UOUAu+xvw+UMso2V+3WL7qvkSl0Ju8MZHS9 YOkw== X-Gm-Message-State: AKwxytcQHg/Y8/3fNlv75PtKKOveNLVRIhzJiqB6g43kTJpAq1c5gUjd 05eEcMhkBcCsjKJRGx1zA3rxn5SNvuE= X-Received: by 10.99.115.16 with SMTP id o16mr22335512pgc.362.1516289704350; Thu, 18 Jan 2018 07:35:04 -0800 (PST) Received: from [10.69.49.71] ([192.19.223.250]) by smtp.gmail.com with ESMTPSA id a9sm12957169pfi.55.2018.01.18.07.35.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Jan 2018 07:35:03 -0800 (PST) Subject: Re: [PATCH V5 0/2] nvme-pci: fix the timeout case when reset is ongoing To: Jianchao Wang , keith.busch@intel.com, axboe@fb.com, hch@lst.de, sagi@grimberg.me, maxg@mellanox.com Cc: linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org References: <1516270202-8051-1-git-send-email-jianchao.w.wang@oracle.com> From: James Smart Message-ID: <273980d4-0b11-a3fc-ca83-00e8f957ba87@broadcom.com> Date: Thu, 18 Jan 2018 07:34:59 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <1516270202-8051-1-git-send-email-jianchao.w.wang@oracle.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Jianchao, This looks very coherent to me. Thank You. -- james On 1/18/2018 2:10 AM, Jianchao Wang wrote: > Hello > > Please consider the following scenario. > nvme_reset_ctrl > -> set state to RESETTING > -> queue reset_work > (scheduling) > nvme_reset_work > -> nvme_dev_disable > -> quiesce queues > -> nvme_cancel_request > on outstanding requests > -------------------------------_boundary_ > -> nvme initializing (issue request on adminq) > > Before the _boundary_, not only quiesce the queues, but only cancel > all the outstanding requests. > > A request could expire when the ctrl state is RESETTING. > - If the timeout occur before the _boundary_, the expired requests > are from the previous work. > - Otherwise, the expired requests are from the controller initializing > procedure, such as sending cq/sq create commands to adminq to setup > io queues. > In current implementation, nvme_timeout cannot identify the _boundary_ > so only handles second case above. > > In fact, after Sagi's commit (nvme-rdma: fix concurrent reset and > reconnect), both nvme-fc/rdma have following pattern: > RESETTING - quiesce blk-mq queues, teardown and delete queues/ > connections, clear out outstanding IO requests... > RECONNECTING - establish new queues/connections and some other > initializing things. > Introduce RECONNECTING to nvme-pci transport to do the same mark > Then we get a coherent state definition among nvme pci/rdma/fc > transports and nvme_timeout could identify the _boundary_. > > V5: > - discard RESET_PREPARE and introduce RESETTING into nvme-pci > - change the 1st patch's name and comment > - other misc changes > > 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 > > drivers/nvme/host/core.c | 2 +- > drivers/nvme/host/pci.c | 43 ++++++++++++++++++++++++++++++++----------- > 2 files changed, 33 insertions(+), 12 deletions(-) > > Thanks > Jianchao