Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp961747ybe; Wed, 4 Sep 2019 10:17:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqxTxaU2ml+EcQmKDA68NFmtsAqa++d4bxhrkS8aDZaOnupwvvHF/EuvGWnMISZ604Sfkabx X-Received: by 2002:a62:db42:: with SMTP id f63mr19680099pfg.225.1567617456173; Wed, 04 Sep 2019 10:17:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567617456; cv=none; d=google.com; s=arc-20160816; b=iwz9mQOhMgC/TJp923O2IfnpDLjoEquOO9vybnNvUV9aLsKVIhhsuPuGhhOL02CSqL wcXrcp/dwDNq6osVE6Gy9ToZvdiJH+NnX58blyJ9/u79Nx0Q9jpQ8AuwienfzntXOudY 5q+QEhbqhH6beoJl4/ATg9WoRoNOQaa4WZWtUV2v5v8CZE7W+rVBJ0s6sZCpuXSIXCQP yMhdIiWzEOdYs+z9ZfG/Figi2rOtAccMBZnRyM5nSkOdsngqN6Z5Q2zuqiJYU9M88GqE f9rQ3JQp7DHFZ42Ldc1cxAMa2zB5fSzH+dT2qMrHNznjgSFQHg9h+B2Aj0OwFrDNa/XE aTfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=yjASM11vlbiTSKO+/ONQybZKB0LNJBvgvKjUY3PmlBo=; b=gd4Y4hgollhfYxpdx0AB/LOKRxd8qwGyQmMLFSv6qTiiZvW3HcyAj3JmAJXqnXvLam 32tXl+K3hPg1gJMLuwDEv43a3XZe5BwdL0DbP7vmTxq+k83TtuMqZE24pwdubSKDSSMg jkyA1tokDKx1Iqwy96p7PEkZr5AE7kkIIvzuCGaTXwDte4jPdXN8a94e/G5JtdQ/gAUE 5H6Jzd2XNUCwcMBU3B+L2RY/5csKyjUMnIuce6US/fBBrjSomog22m0ivRRngNSxsXjD 86ZFFyQ1xzoSGtL5ZIpMwUBQg/2UvLviiasqnMnRiQCZHnsQiOWSIzWlqXjdLz1fiw9C uAww== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y10si9134303plk.291.2019.09.04.10.17.20; Wed, 04 Sep 2019 10:17:36 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731743AbfIDRQR (ORCPT + 99 others); Wed, 4 Sep 2019 13:16:17 -0400 Received: from mga07.intel.com ([134.134.136.100]:25282 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731173AbfIDRQR (ORCPT ); Wed, 4 Sep 2019 13:16:17 -0400 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Sep 2019 10:16:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,467,1559545200"; d="scan'208";a="212470355" Received: from unknown (HELO localhost.localdomain) ([10.232.112.69]) by fmsmga002.fm.intel.com with ESMTP; 04 Sep 2019 10:16:16 -0700 Date: Wed, 4 Sep 2019 11:14:45 -0600 From: Keith Busch To: Logan Gunthorpe Cc: Christoph Hellwig , Jens Axboe , Hannes Reinecke , Sagi Grimberg , "Martin K . Petersen" , linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, Keith Busch Subject: Re: [PATCH] nvme-core: Fix subsystem instance mismatches Message-ID: <20190904171445.GG21302@localhost.localdomain> References: <20190831152910.GA29439@localhost.localdomain> <33af4d94-9f6d-9baa-01fa-0f75ccee263e@deltatee.com> <20190903164620.GA20847@localhost.localdomain> <20190904060558.GA10849@lst.de> <20190904144426.GB21302@localhost.localdomain> <20190904154215.GA20422@lst.de> <20190904155445.GD21302@localhost.localdomain> <20190904163557.GF21302@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 04, 2019 at 11:01:22AM -0600, Logan Gunthorpe wrote: > Oh, yes that's simpler than the struct/kref method and looks like it > will accomplish the same thing. I did some brief testing with it and it > seems to work for me (though I don't have any subsystems with multiple > controllers). If you want to make a patch out of it you can add my > > Reviewed-by: Logan Gunthorpe Thanks! I'll make it a proper patch and send shortly. For testing multi-controller subsystems, I haven't got proper hardware either, so I really like the nvme loop target. Here's a very simple json defining a two namespace subsystem backed by two real nvme devices: loop.json: --- { "ports": [ { "addr": { "adrfam": "", "traddr": "", "treq": "not specified", "trsvcid": "", "trtype": "loop" }, "portid": 1, "referrals": [], "subsystems": [ "testnqn" ] } ], "subsystems": [ { "attr": { "allow_any_host": "1" }, "namespaces": [ { "device": { "nguid": "ef90689c-6c46-d44c-89c1-4067801309a8", "path": "/dev/nvme0n1" }, "enable": 1, "nsid": 1 }, { "device": { "nguid": "ef90689c-6c46-d44c-89c1-4067801309a9", "path": "/dev/nvme1n1" }, "enable": 1, "nsid": 2 } ], "nqn": "testnqn" } ] } -- Configure the target: # nvmetcli restore loop.json Connect to it twice: # nvme connect -n testnqn -t loop # nvme connect -n testnqn -t loop List the result: # nvme list -v NVM Express Subsystems Subsystem Subsystem-NQN Controllers ---------------- ------------------------------------------------------------------------------------------------ ---------------- nvme-subsys0 nqn.2014.08.org.nvmexpress:8086108ePHLE7200015N6P4BGN-17335943:ICDPC5ED2ORA6.4T nvme0 nvme-subsys1 nqn.2014.08.org.nvmexpress:8086108ePHLE7200015N6P4BGN-27335943:ICDPC5ED2ORA6.4T nvme1 nvme-subsys2 testnqn nvme2, nvme3 NVM Express Controllers Device SN MN FR TxPort Address Subsystem Namespaces -------- -------------------- ---------------------------------------- -------- ------ -------------- ------------ ---------------- nvme0 PHLE7200015N6P4BGN-1 7335943:ICDPC5ED2ORA6.4T QDV1RD07 pcie 0000:88:00.0 nvme-subsys0 nvme0n1 nvme1 PHLE7200015N6P4BGN-2 7335943:ICDPC5ED2ORA6.4T QDV1RD03 pcie 0000:89:00.0 nvme-subsys1 nvme1n1 nvme2 9eb72cbeecc6fdb0 Linux 5.3.0-rc loop nvme-subsys2 nvme2n1, nvme2n2 nvme3 9eb72cbeecc6fdb0 Linux 5.3.0-rc loop nvme-subsys2 nvme2n1, nvme2n2 NVM Express Namespaces Device NSID Usage Format Controllers ------------ -------- -------------------------- ---------------- ---------------- nvme0n1 1 3.20 TB / 3.20 TB 512 B + 0 B nvme0 nvme1n1 1 3.20 TB / 3.20 TB 512 B + 0 B nvme1 nvme2n1 1 3.20 TB / 3.20 TB 512 B + 0 B nvme2, nvme3 nvme2n2 2 3.20 TB / 3.20 TB 512 B + 0 B nvme2, nvme3