[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH for-6.0 v2 7/8] hw/block/nvme: fix handling of private namesp
Re: [PATCH for-6.0 v2 7/8] hw/block/nvme: fix handling of private namespaces
Tue, 6 Apr 2021 15:23:33 +0900
On 21-04-05 19:54:51, Klaus Jensen wrote:
> From: Klaus Jensen <email@example.com>
> Prior to this patch, if a private nvme-ns device (that is, a namespace
> that is not linked to a subsystem) is wired up to an nvme-subsys linked
> nvme controller device, the device fails to verify that the namespace id
> is unique within the subsystem. NVM Express v1.4b, Section 6.1.6 ("NSID
> and Namespace Usage") states that because the device supports Namespace
> Management, "NSIDs *shall* be unique within the NVM subsystem".
> Additionally, prior to this patch, private namespaces are not known to
> the subsystem and the namespace is considered exclusive to the
> controller with which it is initially wired up to. However, this is not
> the definition of a private namespace; per Section 1.6.33 ("private
> namespace"), a private namespace is just a namespace that does not
> support multipath I/O or namespace sharing, which means "that it is only
> able to be attached to one controller at a time".
> Fix this by always allocating namespaces in the subsystem (if one is
> linked to the controller), regardsless of the shared/private status of
> the namespace. Whether or not the namespace is shareable is controlled
> by a new `shared` nvme-ns parameter.
> Finally, this fix allows the nvme-ns `subsys` parameter to be removed,
> since the `shared` parameter now serves the purpose of attaching the
> namespace to all controllers in the subsystem upon device realization.
> It is invalid to have an nvme-ns namespace device with a linked
> subsystem without the parent nvme controller device also being linked to
> one and since the nvme-ns devices will unconditionally be "attached" (in
> QEMU terms that is) to an nvme controller device through an NvmeBus, the
> nvme-ns namespace device can always get a reference to the subsystem of
> the controller it is explicitly (using 'bus=' parametr) or implicitly
> attaching to.
> Fixes: e570768566b3 ("hw/block/nvme: support for shared namespace in
> Cc: Minwoo Im <firstname.lastname@example.org>
> Signed-off-by: Klaus Jensen <email@example.com>
> Reviewed-by: Gollu Appalanaidu <firstname.lastname@example.org>
Reviewed-by: Minwoo Im <email@example.com>
Thanks for the fix.
[PATCH for-6.0 v2 5/8] hw/block/nvme: fix warning about legacy namespace configuration, Klaus Jensen, 2021/04/05
[PATCH for-6.0 v2 6/8] hw/block/nvme: update dmsrl limit on namespace detachment, Klaus Jensen, 2021/04/05
[PATCH for-6.0 v2 8/8] hw/block/nvme: add missing copyright headers, Klaus Jensen, 2021/04/05
[PATCH for-6.0 v2 7/8] hw/block/nvme: fix handling of private namespaces, Klaus Jensen, 2021/04/05
- Re: [PATCH for-6.0 v2 4/8] hw/block/nvme: fix controller namespaces array indexing, (continued)
Re: [PATCH for-6.0 v2 0/8] hw/block/nvme: misc fixes, Keith Busch, 2021/04/05
- Re: [PATCH for-6.0 v2 7/8] hw/block/nvme: fix handling of private namespaces,
Minwoo Im <=