[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v5 05/14] hw/block/nvme: Add support for Namespace Types
From: |
Klaus Jensen |
Subject: |
Re: [PATCH v5 05/14] hw/block/nvme: Add support for Namespace Types |
Date: |
Wed, 30 Sep 2020 10:15:42 +0200 |
On Sep 28 11:35, Dmitry Fomichev wrote:
> From: Niklas Cassel <niklas.cassel@wdc.com>
>
> Namespace Types introduce a new command set, "I/O Command Sets",
> that allows the host to retrieve the command sets associated with
> a namespace. Introduce support for the command set and enable
> detection for the NVM Command Set.
>
> The new workflows for identify commands rely heavily on zero-filled
> identify structs. E.g., certain CNS commands are defined to return
> a zero-filled identify struct when an inactive namespace NSID
> is supplied.
>
> Add a helper function in order to avoid code duplication when
> reporting zero-filled identify structures.
>
> Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
> Signed-off-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>
> ---
> hw/block/nvme-ns.c | 3 +
> hw/block/nvme.c | 210 +++++++++++++++++++++++++++++++++++++--------
> 2 files changed, 175 insertions(+), 38 deletions(-)
>
> diff --git a/hw/block/nvme-ns.c b/hw/block/nvme-ns.c
> index bbd7879492..31b7f986c3 100644
> --- a/hw/block/nvme-ns.c
> +++ b/hw/block/nvme-ns.c
> @@ -40,6 +40,9 @@ static void nvme_ns_init(NvmeNamespace *ns)
>
> id_ns->nsze = cpu_to_le64(nvme_ns_nlbas(ns));
>
> + ns->params.csi = NVME_CSI_NVM;
> + qemu_uuid_generate(&ns->params.uuid); /* TODO make UUIDs persistent */
> +
It is straight-forward to put this into a 'uuid' nvme-ns parameter using
DEFINE_PROP_UUID. That will default to 'auto' which will generate an
UUID for each invocation, but if the user requires it to be
"persistent", it can be specified explicitly.
If you choose to do this, please extract to separate patch. Or I can
post it on top of nvme-next if you like.
signature.asc
Description: PGP signature
- [PATCH v5 00/14] hw/block/nvme: Support Namespace Types and Zoned Namespace Command Set, Dmitry Fomichev, 2020/09/27
- [PATCH v5 02/14] hw/block/nvme: Add Commands Supported and Effects log, Dmitry Fomichev, 2020/09/27
- [PATCH v5 04/14] hw/block/nvme: Define trace events related to NS Types, Dmitry Fomichev, 2020/09/27
- [PATCH v5 01/14] hw/block/nvme: Report actual LBA data shift in LBAF, Dmitry Fomichev, 2020/09/27
- [PATCH v5 03/14] hw/block/nvme: Introduce the Namespace Types definitions, Dmitry Fomichev, 2020/09/27
- [PATCH v5 05/14] hw/block/nvme: Add support for Namespace Types, Dmitry Fomichev, 2020/09/27
- [PATCH v5 06/14] hw/block/nvme: Add support for active/inactive namespaces, Dmitry Fomichev, 2020/09/27
- [PATCH v5 07/14] hw/block/nvme: Make Zoned NS Command Set definitions, Dmitry Fomichev, 2020/09/27
- [PATCH v5 08/14] hw/block/nvme: Define Zoned NS Command Set trace events, Dmitry Fomichev, 2020/09/27
- [PATCH v5 10/14] hw/block/nvme: Introduce max active and open zone limits, Dmitry Fomichev, 2020/09/27
- [PATCH v5 11/14] hw/block/nvme: Support Zone Descriptor Extensions, Dmitry Fomichev, 2020/09/27
- [PATCH v5 09/14] hw/block/nvme: Support Zoned Namespace Command Set, Dmitry Fomichev, 2020/09/27