[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20220314091755epcms2p1c638716a47c2eae1a6069e2b73e5dc5d@epcms2p1>
Date: Mon, 14 Mar 2022 18:17:55 +0900
From: Sungup Moon <sungup.moon@...sung.com>
To: "hch@....de" <hch@....de>
CC: "kbusch@...nel.org" <kbusch@...nel.org>,
"axboe@...com" <axboe@...com>,
"sagi@...mberg.me" <sagi@...mberg.me>,
"linux-nvme@...ts.infradead.org" <linux-nvme@...ts.infradead.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE:(2) [PATCH] driver/nvme/host: Support duplicated nsid for the
private
Thank you for your reply,
>
> On Mon, Mar 14, 2022 at 04:05:05PM +0900, Sungup Moon wrote:
> > When the multi-controller, managed by a special admin command, has private
> > namespace with same nsid, current linux driver raise "Duplicate unshared
> > namespace" error. But, NVMe Specification defines the NSID usage like this:
> >
> > If Namespace Management, ANA Reporting, or NVM Sets are supported, the
> > NSIDs shall be unique within the NVM subsystem. If the Namespace
> > Management, ANA Reporting, and NVM Sets are not supported, then NSIDs:
> > a) for shared namespace shall be unique; and
> > b) for private namespace are not required to be unique.
> > (reference: 6.1.6 NSID and Namespace Usage; NVM Express 1.4c spec)
> >
> > So, if a multi-controller, which is not managed by Namespace Management
> > function, creates some private namespaces without ANA and NVM Sets, the
> > duplicated NSID should be allowed because that is not a NVMe specification
> > violation.
> >
> > But, current nvme driver checks only namespace is shared or not, so I
> > propose following patch:
> > 1. nvme_ctrl has unique_nsid field to identify that controller should
> > assign unique nsid.
> > 2. nvme_init_ns_head function creates new nvme_ns_head instance not only
> > head is null but controller's unique_nsid is false (no flagged
> > attribute) and namespace is not shared.
> > 3. for creating bdev device file, nvme_mpath_set_disk_name will return
> > false when unique_nsid is false and namespace is not shared.
> > 4. also, nvme_mpath_alloc_disk alto return 0 with same manner.
>
> From a very quick glance this looks good. But please make sure you don't
> spill over 80 charactes per line.
I checked changes using "scripts/checkpatch.pl --terse --file {changed file}",
but there is no warning on my changes. However I will recheck the spill-over
lines over 80 characters.
> Also I think instead of adding the
> unique_nsid field a little helper that checks the relevant flags might
> be a lіttle nicer. It is not checked in a fast path anywere and the
> checks are pretty trivial.
>
Thank you for your advise! I will remove flag and add checking function for
unique nsid.
Thank you,
Sungup Moon
Powered by blists - more mailing lists