Received: by 10.223.148.5 with SMTP id 5csp7031664wrq; Wed, 17 Jan 2018 23:31:21 -0800 (PST) X-Google-Smtp-Source: ACJfBouoq+Fj1anl1kxGykxuGi0CxnPJfmp5auXjodgdxyDs03XC7Gj9fHshhiTBAh7ElC5R4EfN X-Received: by 10.99.97.209 with SMTP id v200mr27566045pgb.126.1516260681437; Wed, 17 Jan 2018 23:31:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516260681; cv=none; d=google.com; s=arc-20160816; b=jQtA3V8k1QKmT3hv8/a6Q0fC9+hzkSYG4h/U3yxVq6FDsNS9zMKofA+AhYXkd265dj UHhjn4YQ80+Aq1Ouw1zXfYSGwUZoivhTG3VdSoWWm4wLRhtYLTkUKjFp2QuI4K3+Pf3z JR93AvCcV/Iadl9NA8m7bGfODa411XxPosmBrXo8cyTFDoDT73eHla5ocqc1vDDYSIxC yqbzkl9atSUAB7Rcz1YxV3eSm0Emyv6bCwuMVld5bZHTIGIA0ZX4a2PePwF66/zCGStW WIKJz01l/T8XZtpMFmclQSyMlB89KZKtpUQsT/1OEPcCIv+v6ySv4BXElXOyhgONRS1c 4gPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=6oyxgO59qvZMcl+dJW+I9Tyc01X1UPwwPCrSELbYnO0=; b=ntz2c49cTOCMWnSbmNvE/QShYLQO9lj6EQMX4RYVkuq9OO8FFiH7x3Y4koJDz5UL9G boThyQX9xzb99ENexZP2wcR9N+KsIouIE29IQJAiBIiM4TgrXjY0MRL+vcq8BCf8L+bm Ise/gDFcYkF87cnunXumuz2VCwH2qa6jZQ5HbjZP67bjJTcdVJa5Gf2zY7r/Aqd+LTRQ 7prUUH2TrQrTG82RcuH+aOqV5P0dBkPvxsOeUjQx139OMh+8wgoscRVzgW1f6mdlFmMC HT4shQ64hWoY9dVSpsuL+GF+FbQQbHkVF3QS4poCeito/mDF+OnFTeTZRYYR4LlvYWyX PEpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=VmE6M/Bv; 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=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k22si6485513pli.384.2018.01.17.23.31.07; Wed, 17 Jan 2018 23:31:21 -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=@oracle.com header.s=corp-2017-10-26 header.b=VmE6M/Bv; 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=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754724AbeARHaV (ORCPT + 99 others); Thu, 18 Jan 2018 02:30:21 -0500 Received: from aserp2120.oracle.com ([141.146.126.78]:48598 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750931AbeARHaT (ORCPT ); Thu, 18 Jan 2018 02:30:19 -0500 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w0I7QN0S041552; Thu, 18 Jan 2018 07:29:33 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=corp-2017-10-26; bh=6oyxgO59qvZMcl+dJW+I9Tyc01X1UPwwPCrSELbYnO0=; b=VmE6M/BvNYFFOJOG0+RgpF7cwl0TnlMDWYGXGalhaeY/Ur35Z8HO2oim0DdpS1eUkjoy ITuhVeKeHDHLJEze3caYnlomJ3A2DJ0fJZ7t/vBokEvVfeNhuCzI9OO97FVrXg2Mek9E tsJDrcSJZ+AwRP5v+FfT/ixX3MDg69cX+uOZlXcDkad154mF1rf5yp3UbtqdHlw7kG61 suJHoP6SluE6vKRCa8k+FQJ5utQYndVARWnKv/+XZHiiwQQpXTHzDA9jC11HalNu3VAk mJRIog969Fs+Tf4bmw6KIDBG2wOY9cda4T5+IONGpOyqD9SBT9jCoIciVdYFwO0vHNTW sg== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp2120.oracle.com with ESMTP id 2fjq1a02gg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 Jan 2018 07:29:30 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w0I7OOG6029801 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 18 Jan 2018 07:24:25 GMT Received: from abhmp0008.oracle.com (abhmp0008.oracle.com [141.146.116.14]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w0I7OOgX015559; Thu, 18 Jan 2018 07:24:24 GMT Received: from [10.182.69.179] (/10.182.69.179) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 17 Jan 2018 23:24:24 -0800 Subject: Re: [PATCH V4 1/2] nvme: add NVME_CTRL_RESET_PREPARE state To: James Smart , Max Gurtovoy , keith.busch@intel.com, axboe@fb.com, hch@lst.de, sagi@grimberg.me Cc: linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org References: <1516164877-2170-1-git-send-email-jianchao.w.wang@oracle.com> <1516164877-2170-2-git-send-email-jianchao.w.wang@oracle.com> <11106a93-2e78-c853-e6eb-35c652dab3a9@mellanox.com> <50ca626e-7933-5a60-33f9-52e2ac8d0f25@broadcom.com> <9a42cfac-642a-6838-625a-eeb51bec5c78@oracle.com> From: "jianchao.wang" Message-ID: <69861c8b-a5f9-be3a-57d0-bda61eabe18b@oracle.com> Date: Thu, 18 Jan 2018 15:24:19 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8777 signatures=668653 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1801180107 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi James Thanks for you detailed, kindly response and directive. That's really appreciated. On 01/18/2018 02:24 PM, James Smart wrote: >> So in the patch, RESETTING in nvme-fc/rdma is changed to RESET_PREPARE. Then we get: >> nvme-fc/rdma RESET_PREPARE -> RECONNECTING -> LIVE >> nvme-pci     RESET_PREPARE -> RESETTING    -> LIVE > > Right - so another way to look at this is you renamed RESETTING to RESET_PREPARE and added a new RESETTING state in the nvme-pci when in reinits.  Why not simply have the nvme-pci transport transition to RECONNECTING like the other transports. No new states, semantics are all the same. > > Here's what the responsibility of the states are: > RESETTING: > -quiescing the blk-mq queues os errors don't bubble back to callees and new io is suspended > -terminating the link-side association: resets the controller via register access/SET_PROPERTY, deletes connections/queues, cleans out active io and lets them queue for resending, etc. > -end result is nvme block device is present, but idle, and no active controller on the link side  (link being a transport specific link such as pci, or ethernet/ib for rdma or fc link). > > RECONNECTING: > - "establish an association at the transport" on PCI this is immediate - you can either talk to the pci function or you can't. With rdma/fc we send transport traffic to create an admin q connection. > - if association succeeded: the controller is init'd via register accesses/fabric GET/SET_PROPERTIES and admin-queue command, io connections/queues created, blk-mq queues unquiesced, and finally transition to NVME_CTRL_LIVE. > - if association failed: check controller timeout., if not exceeded, schedule timer and retry later.  With pci, this could cover the temporary loss of the pci function access (a hot plug event) while keeping the nvme blk device live in the system. > > It matches what you are describing but using what we already have in place - with the only difference being the addition of your "boundary" by adding the RECONNECTING state to nvme-pci. Yes, absolutely. Thanks for your detailed summary here. Introducing RECONNECTING into nvme-pci is indeed a clearer way to fix the issue. > > >> >>>> I don't believe RESETTING and RECONNECTING are that similar - unless - you are looking at that "reinit" part that we left grandfathered into PCI. >> Yes. I have got the point. Thanks for your directive. >> >> Both nvme-pc and nvme-fc/rdma have "shutdown" part to tear down queues/connects, quiesce queues, cancel outstanding requests... >> We could call this part as "shutdowning" as well as the scheduling gap. >> Because the difference of initializing between the nvme-pci and nvme-fc/rdma,  we could call "reiniting" for nvme-pci and >> call "reconnecting" for nvme-fc/rdma > > I don't think we need different states for the two. The actions taken are really very similar. How they do the actions varies slightly, but not what they are trying to do.   Thus, I'd prefer we keep the existing RECONNECTING state and use it in nvme-pci as well. I'm open to renaming it if there's something about the name that is not agreeable. Yes. And I will use RECONNECTING in next version to fix this issue. If better name, could introduce in other patchset. :) Many thanks again. Jianchao