mbox series

[v3,00/15] hw/block/nvme: Support Namespace Types and Zoned Namespace Command Set

Message ID 20200913221436.22844-1-dmitry.fomichev@wdc.com
Headers show
Series hw/block/nvme: Support Namespace Types and Zoned Namespace Command Set | expand

Message

Dmitry Fomichev Sept. 13, 2020, 10:14 p.m. UTC
v2 -> v3:

 - Moved nvme_fill_data() function to the NSTypes patch as it is
   now used there to output empty namespace identify structs.
 - Fixed typo in Maxim's email address.

v1 -> v2:

 - Rebased on top of qemu-nvme/next branch.
 - Incorporated feedback from Klaus and Alistair.
 - Dropped "Simulate Zone Active excursions" patch.
   Excursion behavior may depend on the internal controller
   architecture and therefore be vendor-specific.
 - Dropped support for Zone Attributes and zoned AENs for now.
   These features can be added in a future series.
 - NS Types support is extended to handle active/inactive namespaces.
 - Update the write pointer after backing storage I/O completion, not
   before. This makes the emulation to run correctly in case of
   backing device failures.
 - Avoid division in the I/O path if the device zone size is
   a power of two (the most common case). Zone index then can be
   calculated by using bit shift.
 - A few reported bugs have been fixed.
 - Indentation in function definitions has been changed to make it
   the same as the rest of the code.


Zoned Namespace (ZNS) Command Set is a newly introduced command set
published by the NVM Express, Inc. organization as TP 4053. The main
design goals of ZNS are to provide hardware designers the means to
reduce NVMe controller complexity and to allow achieving a better I/O
latency and throughput. SSDs that implement this interface are
commonly known as ZNS SSDs.

This command set is implementing a zoned storage model, similarly to
ZAC/ZBC. As such, there is already support in Linux, allowing one to
perform the majority of tasks needed for managing ZNS SSDs.

The Zoned Namespace Command Set relies on another TP, known as
Namespace Types (NVMe TP 4056), which introduces support for having
multiple command sets per namespace.

Both ZNS and Namespace Types specifications can be downloaded by
visiting the following link -

https://nvmexpress.org/wp-content/uploads/NVM-Express-1.4-Ratified-TPs.zip

This patch series adds Namespace Types support and zoned namespace
emulation capability to the existing NVMe PCI device.

The patchset is organized as follows -

The first several patches are preparatory and are added to allow for
an easier review of the subsequent commits. The group of patches that
follows adds NS Types support with only NVM Command Set being
available. Finally, the last group of commits makes definitions and
adds new code to support Zoned Namespace Command Set.

Based-on: Message-ID: <20200729220638.344477-17-its@irrelevant.dk>

Ajay Joshi (1):
  hw/block/nvme: Define 64 bit cqe.result

Dmitry Fomichev (11):
  hw/block/nvme: Report actual LBA data shift in LBAF
  hw/block/nvme: Add Commands Supported and Effects log
  hw/block/nvme: Define trace events related to NS Types
  hw/block/nvme: Make Zoned NS Command Set definitions
  hw/block/nvme: Define Zoned NS Command Set trace events
  hw/block/nvme: Support Zoned Namespace Command Set
  hw/block/nvme: Introduce max active and open zone limits
  hw/block/nvme: Support Zone Descriptor Extensions
  hw/block/nvme: Add injection of Offline/Read-Only zones
  hw/block/nvme: Use zone metadata file for persistence
  hw/block/nvme: Document zoned parameters in usage text

Niklas Cassel (3):
  hw/block/nvme: Introduce the Namespace Types definitions
  hw/block/nvme: Add support for Namespace Types
  hw/block/nvme: Add support for active/inactive namespaces

 block/nvme.c          |    2 +-
 block/trace-events    |    2 +-
 hw/block/nvme.c       | 1932 ++++++++++++++++++++++++++++++++++++++++-
 hw/block/nvme.h       |  190 ++++
 hw/block/trace-events |   38 +
 include/block/nvme.h  |  210 ++++-
 6 files changed, 2308 insertions(+), 66 deletions(-)

Comments

Klaus Jensen Sept. 15, 2020, 7:37 a.m. UTC | #1
On Sep 14 07:14, Dmitry Fomichev wrote:
> From: Ajay Joshi <ajay.joshi@wdc.com>

> 

> A new write command, Zone Append, is added as a part of Zoned

> Namespace Command Set. Upon successful completion of this command,

> the controller returns the start LBA of the performed write operation

> in cqe.result field. Therefore, the maximum size of this variable

> needs to be changed from 32 to 64 bit, consuming the reserved 32 bit

> field that follows the result in CQE struct. Since the existing

> commands are expected to return a 32 bit LE value, two separate

> variables, result32 and result64, are now kept in a union.

> 

> Signed-off-by: Ajay Joshi <ajay.joshi@wdc.com>

> Signed-off-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>

> Reviewed-by: Klaus Jensen <k.jensen@samsung.com>


I know that I R-b'ed this, but can this be moved to the namespace types
patch, since that is the TP that changes this.

Also, I don't think we should touch the tracing in the block driver
since it is not aware of namespace types.
Dmitry Fomichev Sept. 15, 2020, 6:56 p.m. UTC | #2
> -----Original Message-----

> From: Klaus Jensen <its@irrelevant.dk>

> Sent: Tuesday, September 15, 2020 3:37 AM

> To: Dmitry Fomichev <Dmitry.Fomichev@wdc.com>

> Cc: Keith Busch <kbusch@kernel.org>; Klaus Jensen

> <k.jensen@samsung.com>; Kevin Wolf <kwolf@redhat.com>; Philippe

> Mathieu-Daudé <philmd@redhat.com>; Maxim Levitsky

> <mlevitsk@redhat.com>; Fam Zheng <fam@euphon.net>; Niklas Cassel

> <Niklas.Cassel@wdc.com>; Damien Le Moal <Damien.LeMoal@wdc.com>;

> qemu-block@nongnu.org; qemu-devel@nongnu.org; Alistair Francis

> <Alistair.Francis@wdc.com>; Matias Bjorling <Matias.Bjorling@wdc.com>

> Subject: Re: [PATCH v3 01/15] hw/block/nvme: Define 64 bit cqe.result

> 

> On Sep 14 07:14, Dmitry Fomichev wrote:

> > From: Ajay Joshi <ajay.joshi@wdc.com>

> >

> > A new write command, Zone Append, is added as a part of Zoned

> > Namespace Command Set. Upon successful completion of this command,

> > the controller returns the start LBA of the performed write operation

> > in cqe.result field. Therefore, the maximum size of this variable

> > needs to be changed from 32 to 64 bit, consuming the reserved 32 bit

> > field that follows the result in CQE struct. Since the existing

> > commands are expected to return a 32 bit LE value, two separate

> > variables, result32 and result64, are now kept in a union.

> >

> > Signed-off-by: Ajay Joshi <ajay.joshi@wdc.com>

> > Signed-off-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>

> > Reviewed-by: Klaus Jensen <k.jensen@samsung.com>

> 

> I know that I R-b'ed this, but can this be moved to the namespace types

> patch, since that is the TP that changes this.


You probably meant the ZNS patch since result64 is first used there to return
ZA starting data LBA. Sure, I can move this stuff to that patch.

> 

> Also, I don't think we should touch the tracing in the block driver

> since it is not aware of namespace types.


Ok
Klaus Jensen Sept. 15, 2020, 7:09 p.m. UTC | #3
On Sep 14 07:14, Dmitry Fomichev wrote:
> A ZNS drive that is emulated by this module is currently initialized
> with all zones Empty upon startup. However, actual ZNS SSDs save the
> state and condition of all zones in their internal NVRAM in the event
> of power loss. When such a drive is powered up again, it closes or
> finishes all zones that were open at the moment of shutdown. Besides
> that, the write pointer position as well as the state and condition
> of all zones is preserved across power-downs.
> 
> This commit adds the capability to have a persistent zone metadata
> to the device. The new optional module property, "zone_file",
> is introduced. If added to the command line, this property specifies
> the name of the file that stores the zone metadata. If "zone_file" is
> omitted, the device will be initialized with all zones empty, the same
> as before.
> 
> If zone metadata is configured to be persistent, then zone descriptor
> extensions also persist across controller shutdowns.
> 
> Signed-off-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>

This doesn't build on mingw.

> ---
>  hw/block/nvme.c | 370 +++++++++++++++++++++++++++++++++++++++++++++---
>  hw/block/nvme.h |  37 +++++
>  2 files changed, 386 insertions(+), 21 deletions(-)
> 
> diff --git a/hw/block/nvme.c b/hw/block/nvme.c
> index b49ae83dd5..41f4c0dacd 100644
> --- a/hw/block/nvme.c
> +++ b/hw/block/nvme.c
> @@ -3429,7 +3557,188 @@ static int nvme_init_zone_meta(NvmeCtrl *n, NvmeNamespace *ns,
>      return 0;
>  }
>  
> -static void nvme_zoned_init_ctrl(NvmeCtrl *n, Error **errp)
> +static int nvme_open_zone_file(NvmeCtrl *n, bool *init_meta)
> +{
> +    struct stat statbuf;
> +    size_t fsize;
> +    int ret;
> +
> +    ret = stat(n->params.zone_file, &statbuf);
> +    if (ret && errno == ENOENT) {
> +        *init_meta = true;
> +    } else if (!S_ISREG(statbuf.st_mode)) {
> +        fprintf(stderr, "%s is not a regular file\n", strerror(errno));
> +        return -1;
> +    }
> +
> +    n->zone_file_fd = open(n->params.zone_file,
> +                           O_RDWR | O_LARGEFILE | O_BINARY | O_CREAT, 644);

mode is wrong - I think you meant for it to be octal.
Klaus Jensen Sept. 15, 2020, 7:55 p.m. UTC | #4
On Sep 15 18:56, Dmitry Fomichev wrote:
> > -----Original Message-----
> > From: Klaus Jensen <its@irrelevant.dk>
> > Sent: Tuesday, September 15, 2020 3:37 AM
> > To: Dmitry Fomichev <Dmitry.Fomichev@wdc.com>
> > Cc: Keith Busch <kbusch@kernel.org>; Klaus Jensen
> > <k.jensen@samsung.com>; Kevin Wolf <kwolf@redhat.com>; Philippe
> > Mathieu-Daudé <philmd@redhat.com>; Maxim Levitsky
> > <mlevitsk@redhat.com>; Fam Zheng <fam@euphon.net>; Niklas Cassel
> > <Niklas.Cassel@wdc.com>; Damien Le Moal <Damien.LeMoal@wdc.com>;
> > qemu-block@nongnu.org; qemu-devel@nongnu.org; Alistair Francis
> > <Alistair.Francis@wdc.com>; Matias Bjorling <Matias.Bjorling@wdc.com>
> > Subject: Re: [PATCH v3 01/15] hw/block/nvme: Define 64 bit cqe.result
> > 
> > On Sep 14 07:14, Dmitry Fomichev wrote:
> > > From: Ajay Joshi <ajay.joshi@wdc.com>
> > >
> > > A new write command, Zone Append, is added as a part of Zoned
> > > Namespace Command Set. Upon successful completion of this command,
> > > the controller returns the start LBA of the performed write operation
> > > in cqe.result field. Therefore, the maximum size of this variable
> > > needs to be changed from 32 to 64 bit, consuming the reserved 32 bit
> > > field that follows the result in CQE struct. Since the existing
> > > commands are expected to return a 32 bit LE value, two separate
> > > variables, result32 and result64, are now kept in a union.
> > >
> > > Signed-off-by: Ajay Joshi <ajay.joshi@wdc.com>
> > > Signed-off-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>
> > > Reviewed-by: Klaus Jensen <k.jensen@samsung.com>
> > 
> > I know that I R-b'ed this, but can this be moved to the namespace types
> > patch, since that is the TP that changes this.
> 
> You probably meant the ZNS patch since result64 is first used there to return
> ZA starting data LBA. Sure, I can move this stuff to that patch.
> 

No, I actually did mean the NST patch since TP 4056 is the TP that
"unreserves" dw1 in the CQE.
Dmitry Fomichev Sept. 15, 2020, 8:44 p.m. UTC | #5
> -----Original Message-----

> From: Klaus Jensen <its@irrelevant.dk>

> Sent: Tuesday, September 15, 2020 3:56 PM

> To: Dmitry Fomichev <Dmitry.Fomichev@wdc.com>

> Cc: Fam Zheng <fam@euphon.net>; Kevin Wolf <kwolf@redhat.com>;

> Damien Le Moal <Damien.LeMoal@wdc.com>; qemu-block@nongnu.org;

> Niklas Cassel <Niklas.Cassel@wdc.com>; Klaus Jensen

> <k.jensen@samsung.com>; qemu-devel@nongnu.org; Alistair Francis

> <Alistair.Francis@wdc.com>; Keith Busch <kbusch@kernel.org>; Philippe

> Mathieu-Daudé <philmd@redhat.com>; Matias Bjorling

> <Matias.Bjorling@wdc.com>

> Subject: Re: [PATCH v3 01/15] hw/block/nvme: Define 64 bit cqe.result

> 

> On Sep 15 18:56, Dmitry Fomichev wrote:

> > > -----Original Message-----

> > > From: Klaus Jensen <its@irrelevant.dk>

> > > Sent: Tuesday, September 15, 2020 3:37 AM

> > > To: Dmitry Fomichev <Dmitry.Fomichev@wdc.com>

> > > Cc: Keith Busch <kbusch@kernel.org>; Klaus Jensen

> > > <k.jensen@samsung.com>; Kevin Wolf <kwolf@redhat.com>; Philippe

> > > Mathieu-Daudé <philmd@redhat.com>; Maxim Levitsky

> > > <mlevitsk@redhat.com>; Fam Zheng <fam@euphon.net>; Niklas Cassel

> > > <Niklas.Cassel@wdc.com>; Damien Le Moal

> <Damien.LeMoal@wdc.com>;

> > > qemu-block@nongnu.org; qemu-devel@nongnu.org; Alistair Francis

> > > <Alistair.Francis@wdc.com>; Matias Bjorling <Matias.Bjorling@wdc.com>

> > > Subject: Re: [PATCH v3 01/15] hw/block/nvme: Define 64 bit cqe.result

> > >

> > > On Sep 14 07:14, Dmitry Fomichev wrote:

> > > > From: Ajay Joshi <ajay.joshi@wdc.com>

> > > >

> > > > A new write command, Zone Append, is added as a part of Zoned

> > > > Namespace Command Set. Upon successful completion of this

> command,

> > > > the controller returns the start LBA of the performed write operation

> > > > in cqe.result field. Therefore, the maximum size of this variable

> > > > needs to be changed from 32 to 64 bit, consuming the reserved 32 bit

> > > > field that follows the result in CQE struct. Since the existing

> > > > commands are expected to return a 32 bit LE value, two separate

> > > > variables, result32 and result64, are now kept in a union.

> > > >

> > > > Signed-off-by: Ajay Joshi <ajay.joshi@wdc.com>

> > > > Signed-off-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>

> > > > Reviewed-by: Klaus Jensen <k.jensen@samsung.com>

> > >

> > > I know that I R-b'ed this, but can this be moved to the namespace types

> > > patch, since that is the TP that changes this.

> >

> > You probably meant the ZNS patch since result64 is first used there to

> return

> > ZA starting data LBA. Sure, I can move this stuff to that patch.

> >

> 

> No, I actually did mean the NST patch since TP 4056 is the TP that

> "unreserves" dw1 in the CQE.


It is not necessary to change it in NST patch since result64 field is not used
in that patch. But if you insist, I can move it to NST patch :)
Dmitry Fomichev Sept. 15, 2020, 8:44 p.m. UTC | #6
> -----Original Message-----

> From: Klaus Jensen <its@irrelevant.dk>

> Sent: Tuesday, September 15, 2020 3:10 PM

> To: Dmitry Fomichev <Dmitry.Fomichev@wdc.com>

> Cc: Keith Busch <kbusch@kernel.org>; Klaus Jensen

> <k.jensen@samsung.com>; Kevin Wolf <kwolf@redhat.com>; Philippe

> Mathieu-Daudé <philmd@redhat.com>; Maxim Levitsky

> <mlevitsk@redhat.com>; Fam Zheng <fam@euphon.net>; Niklas Cassel

> <Niklas.Cassel@wdc.com>; Damien Le Moal <Damien.LeMoal@wdc.com>;

> qemu-block@nongnu.org; qemu-devel@nongnu.org; Alistair Francis

> <Alistair.Francis@wdc.com>; Matias Bjorling <Matias.Bjorling@wdc.com>

> Subject: Re: [PATCH v3 14/15] hw/block/nvme: Use zone metadata file for

> persistence

> 

> On Sep 14 07:14, Dmitry Fomichev wrote:

> > A ZNS drive that is emulated by this module is currently initialized

> > with all zones Empty upon startup. However, actual ZNS SSDs save the

> > state and condition of all zones in their internal NVRAM in the event

> > of power loss. When such a drive is powered up again, it closes or

> > finishes all zones that were open at the moment of shutdown. Besides

> > that, the write pointer position as well as the state and condition

> > of all zones is preserved across power-downs.

> >

> > This commit adds the capability to have a persistent zone metadata

> > to the device. The new optional module property, "zone_file",

> > is introduced. If added to the command line, this property specifies

> > the name of the file that stores the zone metadata. If "zone_file" is

> > omitted, the device will be initialized with all zones empty, the same

> > as before.

> >

> > If zone metadata is configured to be persistent, then zone descriptor

> > extensions also persist across controller shutdowns.

> >

> > Signed-off-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>

> 

> This doesn't build on mingw.


Thanks for letting me know. I'll try to look into this. Do you cross-compile
with mingw64?

> 

> > ---

> >  hw/block/nvme.c | 370

> +++++++++++++++++++++++++++++++++++++++++++++---

> >  hw/block/nvme.h |  37 +++++

> >  2 files changed, 386 insertions(+), 21 deletions(-)

> >

> > diff --git a/hw/block/nvme.c b/hw/block/nvme.c

> > index b49ae83dd5..41f4c0dacd 100644

> > --- a/hw/block/nvme.c

> > +++ b/hw/block/nvme.c

> > @@ -3429,7 +3557,188 @@ static int nvme_init_zone_meta(NvmeCtrl *n,

> NvmeNamespace *ns,

> >      return 0;

> >  }

> >

> > -static void nvme_zoned_init_ctrl(NvmeCtrl *n, Error **errp)

> > +static int nvme_open_zone_file(NvmeCtrl *n, bool *init_meta)

> > +{

> > +    struct stat statbuf;

> > +    size_t fsize;

> > +    int ret;

> > +

> > +    ret = stat(n->params.zone_file, &statbuf);

> > +    if (ret && errno == ENOENT) {

> > +        *init_meta = true;

> > +    } else if (!S_ISREG(statbuf.st_mode)) {

> > +        fprintf(stderr, "%s is not a regular file\n", strerror(errno));

> > +        return -1;

> > +    }

> > +

> > +    n->zone_file_fd = open(n->params.zone_file,

> > +                           O_RDWR | O_LARGEFILE | O_BINARY | O_CREAT, 644);

> 

> mode is wrong - I think you meant for it to be octal.


Nice catch, needs to be 0644...
Klaus Jensen Sept. 15, 2020, 8:46 p.m. UTC | #7
On Sep 15 20:44, Dmitry Fomichev wrote:
> > -----Original Message-----
> > From: Klaus Jensen <its@irrelevant.dk>
> > Sent: Tuesday, September 15, 2020 3:10 PM
> > To: Dmitry Fomichev <Dmitry.Fomichev@wdc.com>
> > Cc: Keith Busch <kbusch@kernel.org>; Klaus Jensen
> > <k.jensen@samsung.com>; Kevin Wolf <kwolf@redhat.com>; Philippe
> > Mathieu-Daudé <philmd@redhat.com>; Maxim Levitsky
> > <mlevitsk@redhat.com>; Fam Zheng <fam@euphon.net>; Niklas Cassel
> > <Niklas.Cassel@wdc.com>; Damien Le Moal <Damien.LeMoal@wdc.com>;
> > qemu-block@nongnu.org; qemu-devel@nongnu.org; Alistair Francis
> > <Alistair.Francis@wdc.com>; Matias Bjorling <Matias.Bjorling@wdc.com>
> > Subject: Re: [PATCH v3 14/15] hw/block/nvme: Use zone metadata file for
> > persistence
> > 
> > On Sep 14 07:14, Dmitry Fomichev wrote:
> > > A ZNS drive that is emulated by this module is currently initialized
> > > with all zones Empty upon startup. However, actual ZNS SSDs save the
> > > state and condition of all zones in their internal NVRAM in the event
> > > of power loss. When such a drive is powered up again, it closes or
> > > finishes all zones that were open at the moment of shutdown. Besides
> > > that, the write pointer position as well as the state and condition
> > > of all zones is preserved across power-downs.
> > >
> > > This commit adds the capability to have a persistent zone metadata
> > > to the device. The new optional module property, "zone_file",
> > > is introduced. If added to the command line, this property specifies
> > > the name of the file that stores the zone metadata. If "zone_file" is
> > > omitted, the device will be initialized with all zones empty, the same
> > > as before.
> > >
> > > If zone metadata is configured to be persistent, then zone descriptor
> > > extensions also persist across controller shutdowns.
> > >
> > > Signed-off-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>
> > 
> > This doesn't build on mingw.
> 
> Thanks for letting me know. I'll try to look into this. Do you cross-compile
> with mingw64?

Yup,

make docker-test-mingw@fedora
Klaus Jensen Sept. 15, 2020, 8:48 p.m. UTC | #8
On Sep 15 20:44, Dmitry Fomichev wrote:
> > -----Original Message-----

> > From: Klaus Jensen <its@irrelevant.dk>

> > Sent: Tuesday, September 15, 2020 3:56 PM

> > To: Dmitry Fomichev <Dmitry.Fomichev@wdc.com>

> > Cc: Fam Zheng <fam@euphon.net>; Kevin Wolf <kwolf@redhat.com>;

> > Damien Le Moal <Damien.LeMoal@wdc.com>; qemu-block@nongnu.org;

> > Niklas Cassel <Niklas.Cassel@wdc.com>; Klaus Jensen

> > <k.jensen@samsung.com>; qemu-devel@nongnu.org; Alistair Francis

> > <Alistair.Francis@wdc.com>; Keith Busch <kbusch@kernel.org>; Philippe

> > Mathieu-Daudé <philmd@redhat.com>; Matias Bjorling

> > <Matias.Bjorling@wdc.com>

> > Subject: Re: [PATCH v3 01/15] hw/block/nvme: Define 64 bit cqe.result

> > 

> > On Sep 15 18:56, Dmitry Fomichev wrote:

> > > > -----Original Message-----

> > > > From: Klaus Jensen <its@irrelevant.dk>

> > > > Sent: Tuesday, September 15, 2020 3:37 AM

> > > > To: Dmitry Fomichev <Dmitry.Fomichev@wdc.com>

> > > > Cc: Keith Busch <kbusch@kernel.org>; Klaus Jensen

> > > > <k.jensen@samsung.com>; Kevin Wolf <kwolf@redhat.com>; Philippe

> > > > Mathieu-Daudé <philmd@redhat.com>; Maxim Levitsky

> > > > <mlevitsk@redhat.com>; Fam Zheng <fam@euphon.net>; Niklas Cassel

> > > > <Niklas.Cassel@wdc.com>; Damien Le Moal

> > <Damien.LeMoal@wdc.com>;

> > > > qemu-block@nongnu.org; qemu-devel@nongnu.org; Alistair Francis

> > > > <Alistair.Francis@wdc.com>; Matias Bjorling <Matias.Bjorling@wdc.com>

> > > > Subject: Re: [PATCH v3 01/15] hw/block/nvme: Define 64 bit cqe.result

> > > >

> > > > On Sep 14 07:14, Dmitry Fomichev wrote:

> > > > > From: Ajay Joshi <ajay.joshi@wdc.com>

> > > > >

> > > > > A new write command, Zone Append, is added as a part of Zoned

> > > > > Namespace Command Set. Upon successful completion of this

> > command,

> > > > > the controller returns the start LBA of the performed write operation

> > > > > in cqe.result field. Therefore, the maximum size of this variable

> > > > > needs to be changed from 32 to 64 bit, consuming the reserved 32 bit

> > > > > field that follows the result in CQE struct. Since the existing

> > > > > commands are expected to return a 32 bit LE value, two separate

> > > > > variables, result32 and result64, are now kept in a union.

> > > > >

> > > > > Signed-off-by: Ajay Joshi <ajay.joshi@wdc.com>

> > > > > Signed-off-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>

> > > > > Reviewed-by: Klaus Jensen <k.jensen@samsung.com>

> > > >

> > > > I know that I R-b'ed this, but can this be moved to the namespace types

> > > > patch, since that is the TP that changes this.

> > >

> > > You probably meant the ZNS patch since result64 is first used there to

> > return

> > > ZA starting data LBA. Sure, I can move this stuff to that patch.

> > >

> > 

> > No, I actually did mean the NST patch since TP 4056 is the TP that

> > "unreserves" dw1 in the CQE.

> 

> It is not necessary to change it in NST patch since result64 field is not used

> in that patch. But if you insist, I can move it to NST patch :)


You are right of course, but since it is a change to the "spec" related
data structures that go into include/block/nvme.h, I think it belongs in
"hw/block/nvme: Introduce the Namespace Types definitions".
Keith Busch Sept. 18, 2020, 9:10 p.m. UTC | #9
On Tue, Sep 15, 2020 at 10:48:49PM +0200, Klaus Jensen wrote:
> On Sep 15 20:44, Dmitry Fomichev wrote:

> > 

> > It is not necessary to change it in NST patch since result64 field is not used

> > in that patch. But if you insist, I can move it to NST patch :)

> 

> You are right of course, but since it is a change to the "spec" related

> data structures that go into include/block/nvme.h, I think it belongs in

> "hw/block/nvme: Introduce the Namespace Types definitions".


Just my $.02, unless you're making exernal APIs, I really find it easier
to review internal changes inline with the patches that use it.

Another example, there are patches in this series that introduce trace
points, but the patch that use them come later. I find that harder to
review since I need to look at two different patches to understand its
value.

I realize this particular patch is implementing a spec feature, but I'd
prefer to see how it's used over of making a round trip to the spec.
Dmitry Fomichev Sept. 21, 2020, 9:39 p.m. UTC | #10
> -----Original Message-----

> From: Keith Busch <kbusch@kernel.org>

> Sent: Friday, September 18, 2020 5:10 PM

> To: Klaus Jensen <its@irrelevant.dk>

> Cc: Dmitry Fomichev <Dmitry.Fomichev@wdc.com>; Fam Zheng

> <fam@euphon.net>; Kevin Wolf <kwolf@redhat.com>; Damien Le Moal

> <Damien.LeMoal@wdc.com>; qemu-block@nongnu.org; Niklas Cassel

> <Niklas.Cassel@wdc.com>; Klaus Jensen <k.jensen@samsung.com>; qemu-

> devel@nongnu.org; Alistair Francis <Alistair.Francis@wdc.com>; Philippe

> Mathieu-Daudé <philmd@redhat.com>; Matias Bjorling

> <Matias.Bjorling@wdc.com>

> Subject: Re: [PATCH v3 01/15] hw/block/nvme: Define 64 bit cqe.result

> 

> On Tue, Sep 15, 2020 at 10:48:49PM +0200, Klaus Jensen wrote:

> > On Sep 15 20:44, Dmitry Fomichev wrote:

> > >

> > > It is not necessary to change it in NST patch since result64 field is not used

> > > in that patch. But if you insist, I can move it to NST patch :)

> >

> > You are right of course, but since it is a change to the "spec" related

> > data structures that go into include/block/nvme.h, I think it belongs in

> > "hw/block/nvme: Introduce the Namespace Types definitions".

> 

> Just my $.02, unless you're making exernal APIs, I really find it easier

> to review internal changes inline with the patches that use it.

> 

> Another example, there are patches in this series that introduce trace

> points, but the patch that use them come later. I find that harder to

> review since I need to look at two different patches to understand its

> value.

> 


I decided to split the trace events to be separate because I felt that it
could make the reviewing process simpler. Since the majority of the patches
in this series are on the large side, I thought it would be easier to open
them in separate sessions rather than to review a large single diff.
Let me know if you'd like me to fold the tracing stuff together with
the code...

DF

> I realize this particular patch is implementing a spec feature, but I'd

> prefer to see how it's used over of making a round trip to the spec.