Re: [PATCH v11 00/13] hw/block/nvme: Support Namespace Types and Zoned Namespace Command Set

2021-01-07 Thread Klaus Jensen
On Dec  9 10:57, Klaus Jensen wrote:
> Hi Dmitry,
> 
> By and large, this looks OK to me. There are still some issues here and
> there, and some comments of mine that you did not address, but I will
> follow up with patches to fix that. Let's get this merged.
> 
> It looks like the nvme-next you rebased on is slightly old and missing
> two commits:
> 
>   "hw/block/nvme: remove superfluous NvmeCtrl parameter" and
>   "hw/block/nvme: pull aio error handling"
> 
> It caused a couple of conflicts, but nothing that I couldn't fix up.
> 
> Since I didn't manage to convince anyone about the zsze and zcap
> parameters being in terms of LBAs, I'll revert that to be
> 'zoned.zone_size' and 'zoned.zone_capacity'.
> 
> Finally, would you accept that we skip "hw/block/nvme: Add injection of
> Offline/Read-Only zones" for now? I'd like to discuss it a bit since I
> think the random injects feels a bit ad-hoc. Back when I did OCSSD
> emulation with Hans, we did something like this for setting up state
> through a descriptor text file - I think we should explore something
> like that before we lock down the two parameters. I'll amend the final
> documentation commit to not include those parameters.
> 
> Sounds good?
> 
> Otherwise, I think this is mergeable to nvme-next. So, for the series
> (excluding "hw/block/nvme: Add injection of Offline/Read-Only zones"):
> 
> Reviewed-by: Klaus Jensen 
> 

I've applied this series to my local nvme-next. Our repo host is
unavailable this morning (infradead.org), but I will push as soon as
possible.


Thanks!
Klaus


signature.asc
Description: PGP signature


Re: [PATCH v11 00/13] hw/block/nvme: Support Namespace Types and Zoned Namespace Command Set

2020-12-15 Thread Keith Busch
Hi Dmitry,

Looks good to me, thanks for sticking with it.

Reviewed-by: Keith Busch 



Re: [PATCH v11 00/13] hw/block/nvme: Support Namespace Types and Zoned Namespace Command Set

2020-12-10 Thread Klaus Jensen
On Dec 10 19:25, Dmitry Fomichev wrote:
> > -Original Message-
> > From: Klaus Jensen 
> > Sent: Wednesday, December 9, 2020 4:58 AM
> > To: Dmitry Fomichev 
> > Cc: Keith Busch ; Klaus Jensen
> > ; Kevin Wolf ; Philippe
> > Mathieu-Daudé ; Max Reitz ;
> > Maxim Levitsky ; Fam Zheng ;
> > Niklas Cassel ; Damien Le Moal
> > ; qemu-bl...@nongnu.org; qemu-
> > de...@nongnu.org; Alistair Francis ; Matias
> > Bjorling 
> > Subject: Re: [PATCH v11 00/13] hw/block/nvme: Support Namespace Types
> > and Zoned Namespace Command Set
> > 
> > Hi Dmitry,
> > 
> > By and large, this looks OK to me. There are still some issues here and
> > there, and some comments of mine that you did not address, but I will
> > follow up with patches to fix that. Let's get this merged.
> > 
> > It looks like the nvme-next you rebased on is slightly old and missing
> > two commits:
> > 
> >   "hw/block/nvme: remove superfluous NvmeCtrl parameter" and
> >   "hw/block/nvme: pull aio error handling"
> > 
> > It caused a couple of conflicts, but nothing that I couldn't fix up.
> > 
> > Since I didn't manage to convince anyone about the zsze and zcap
> > parameters being in terms of LBAs, I'll revert that to be
> > 'zoned.zone_size' and 'zoned.zone_capacity'.
> > 
> > Finally, would you accept that we skip "hw/block/nvme: Add injection of
> > Offline/Read-Only zones" for now? I'd like to discuss it a bit since I
> > think the random injects feels a bit ad-hoc. Back when I did OCSSD
> > emulation with Hans, we did something like this for setting up state
> > through a descriptor text file - I think we should explore something
> > like that before we lock down the two parameters. I'll amend the final
> > documentation commit to not include those parameters.
> > 
> > Sounds good?
> 
> Klaus,
> 
> Sounds great! Sure, we can leave out the injection patch. It  was made
> to increase our internal test coverage, but it is not ideal. Since the zones
> are injected randomly, there is no consistency between test runs and
> it is impossible to reliably create many specific test cases (e.g. the first 
> or
> the last zone is offline).

Yes, exactly.

> The descriptor input file seems like a much more
> flexible and capable approach. If you have something in works, I'll be
> happy to discuss or review.
> 

Sure, I'll rip some stuff from OCSSD and cook up a patch.

> Thank you for your very thorough reviews!
> 

Thanks for contributing this.

Keith, you wanna take a look an give this an Ack or so?


signature.asc
Description: PGP signature


RE: [PATCH v11 00/13] hw/block/nvme: Support Namespace Types and Zoned Namespace Command Set

2020-12-10 Thread Dmitry Fomichev
> -Original Message-
> From: Klaus Jensen 
> Sent: Wednesday, December 9, 2020 4:58 AM
> To: Dmitry Fomichev 
> Cc: Keith Busch ; Klaus Jensen
> ; Kevin Wolf ; Philippe
> Mathieu-Daudé ; Max Reitz ;
> Maxim Levitsky ; Fam Zheng ;
> Niklas Cassel ; Damien Le Moal
> ; qemu-bl...@nongnu.org; qemu-
> de...@nongnu.org; Alistair Francis ; Matias
> Bjorling 
> Subject: Re: [PATCH v11 00/13] hw/block/nvme: Support Namespace Types
> and Zoned Namespace Command Set
> 
> Hi Dmitry,
> 
> By and large, this looks OK to me. There are still some issues here and
> there, and some comments of mine that you did not address, but I will
> follow up with patches to fix that. Let's get this merged.
> 
> It looks like the nvme-next you rebased on is slightly old and missing
> two commits:
> 
>   "hw/block/nvme: remove superfluous NvmeCtrl parameter" and
>   "hw/block/nvme: pull aio error handling"
> 
> It caused a couple of conflicts, but nothing that I couldn't fix up.
> 
> Since I didn't manage to convince anyone about the zsze and zcap
> parameters being in terms of LBAs, I'll revert that to be
> 'zoned.zone_size' and 'zoned.zone_capacity'.
> 
> Finally, would you accept that we skip "hw/block/nvme: Add injection of
> Offline/Read-Only zones" for now? I'd like to discuss it a bit since I
> think the random injects feels a bit ad-hoc. Back when I did OCSSD
> emulation with Hans, we did something like this for setting up state
> through a descriptor text file - I think we should explore something
> like that before we lock down the two parameters. I'll amend the final
> documentation commit to not include those parameters.
> 
> Sounds good?

Klaus,

Sounds great! Sure, we can leave out the injection patch. It  was made
to increase our internal test coverage, but it is not ideal. Since the zones
are injected randomly, there is no consistency between test runs and
it is impossible to reliably create many specific test cases (e.g. the first or
the last zone is offline). The descriptor input file seems like a much more
flexible and capable approach. If you have something in works, I'll be
happy to discuss or review.

Thank you for your very thorough reviews!

Cheers,
Dmitry

> 
> Otherwise, I think this is mergeable to nvme-next. So, for the series
> (excluding "hw/block/nvme: Add injection of Offline/Read-Only zones"):
> 
> Reviewed-by: Klaus Jensen 
> 
> On Dec  9 05:03, Dmitry Fomichev wrote:
> > v10 -> v11:
> >
> >  - Address review comments by Klaus.
> >
> >  - Add a patch to separate the handling of controller reset
> >and subsystem shutdown. Place the patch at the beginning
> >of the series so it can be picked up separately.
> >
> >  - Rebase on the current nvme-next branch.
> >
> > v9 -> v10:
> >
> >  - Correctly check for MDTS in Zone Management Receive handler.
> >
> >  - Change Klaus' "Reviewed-by" email in UUID patch.
> >
> > v8 -> v9:
> >
> >  - Move the modifications to "include/block/nvme.h" made to
> >introduce ZNS-related definitions to a separate patch.
> >
> >  - Add a new struct, NvmeZonedResult, along the same lines as the
> >existing NvmeAerResult, to carry Zone Append LBA returned to
> >the host. Now, there is no need to modify NvmeCqe struct except
> >renaming DW1 field from "rsvd" to "dw1".
> >
> >  - Add check for MDTS in Zone Management Receive handler.
> >
> >  - Remove checks for ns->attached since the value of this flag
> >is always true for now.
> >
> >  - Rebase to the current quemu-nvme/nvme-next branch.
> >
> > v7 -> v8:
> >
> >  - Move refactoring commits to the front of the series.
> >
> >  - Remove "attached" and "fill_pattern" device properties.
> >
> >  - Only close open zones upon subsystem shutdown, not when CC.EN flag
> >is set to 0. Avoid looping through all zones by iterating through
> >lists of open and closed zones.
> >
> >  - Improve bulk processing of zones aka zoned operations with "all"
> >flag set. Avoid looping through the entire zone array for all zone
> >operations except Offline Zone.
> >
> >  - Prefix ZNS-related property names with "zoned.". The "zoned" Boolean
> >property is retained to turn on zoned command set as it is much more
> >intuitive and user-friendly compared to setting a magic number value
> >to csi property.
> >
> >  - Address review comments.
> >
> >  - Remove unused trace events.
&g

Re: [PATCH v11 00/13] hw/block/nvme: Support Namespace Types and Zoned Namespace Command Set

2020-12-09 Thread Klaus Jensen
Hi Dmitry,

By and large, this looks OK to me. There are still some issues here and
there, and some comments of mine that you did not address, but I will
follow up with patches to fix that. Let's get this merged.

It looks like the nvme-next you rebased on is slightly old and missing
two commits:

  "hw/block/nvme: remove superfluous NvmeCtrl parameter" and
  "hw/block/nvme: pull aio error handling"

It caused a couple of conflicts, but nothing that I couldn't fix up.

Since I didn't manage to convince anyone about the zsze and zcap
parameters being in terms of LBAs, I'll revert that to be
'zoned.zone_size' and 'zoned.zone_capacity'.

Finally, would you accept that we skip "hw/block/nvme: Add injection of
Offline/Read-Only zones" for now? I'd like to discuss it a bit since I
think the random injects feels a bit ad-hoc. Back when I did OCSSD
emulation with Hans, we did something like this for setting up state
through a descriptor text file - I think we should explore something
like that before we lock down the two parameters. I'll amend the final
documentation commit to not include those parameters.

Sounds good?

Otherwise, I think this is mergeable to nvme-next. So, for the series
(excluding "hw/block/nvme: Add injection of Offline/Read-Only zones"):

Reviewed-by: Klaus Jensen 

On Dec  9 05:03, Dmitry Fomichev wrote:
> v10 -> v11:
> 
>  - Address review comments by Klaus.
> 
>  - Add a patch to separate the handling of controller reset
>and subsystem shutdown. Place the patch at the beginning
>of the series so it can be picked up separately.
> 
>  - Rebase on the current nvme-next branch.
> 
> v9 -> v10:
> 
>  - Correctly check for MDTS in Zone Management Receive handler.
> 
>  - Change Klaus' "Reviewed-by" email in UUID patch.
> 
> v8 -> v9:
> 
>  - Move the modifications to "include/block/nvme.h" made to
>introduce ZNS-related definitions to a separate patch.
> 
>  - Add a new struct, NvmeZonedResult, along the same lines as the
>existing NvmeAerResult, to carry Zone Append LBA returned to
>the host. Now, there is no need to modify NvmeCqe struct except
>renaming DW1 field from "rsvd" to "dw1".
> 
>  - Add check for MDTS in Zone Management Receive handler.
> 
>  - Remove checks for ns->attached since the value of this flag
>is always true for now.
> 
>  - Rebase to the current quemu-nvme/nvme-next branch.
> 
> v7 -> v8:
> 
>  - Move refactoring commits to the front of the series.
> 
>  - Remove "attached" and "fill_pattern" device properties.
> 
>  - Only close open zones upon subsystem shutdown, not when CC.EN flag
>is set to 0. Avoid looping through all zones by iterating through
>lists of open and closed zones.
> 
>  - Improve bulk processing of zones aka zoned operations with "all"
>flag set. Avoid looping through the entire zone array for all zone
>operations except Offline Zone.
> 
>  - Prefix ZNS-related property names with "zoned.". The "zoned" Boolean
>property is retained to turn on zoned command set as it is much more
>intuitive and user-friendly compared to setting a magic number value
>to csi property.
> 
>  - Address review comments.
> 
>  - Remove unused trace events.
> 
> v6 -> v7:
> 
>  - Introduce ns->iocs initialization function earlier in the series,
>in CSE Log patch.
> 
>  - Set NVM iocs for zoned namespaces when CC.CSS is set to
>NVME_CC_CSS_NVM.
> 
>  - Clean up code in CSE log handler.
>  
> v5 -> v6:
> 
>  - Remove zoned state persistence code. Replace position-independent
>zone lists with QTAILQs.
> 
>  - Close all open zones upon clearing of the controller. This is
>a similar procedure to the one previously performed upon powering
>up with zone persistence. 
> 
>  - Squash NS Types and ZNS triplets of commits to keep definitions
>and trace event definitions together with the implementation code.
> 
>  - Move namespace UUID generation to a separate patch. Add the new
>"uuid" property as suggested by Klaus.
> 
>  - Rework Commands and Effects patch to make sure that the log is
>always in sync with the actual set of commands supported.
> 
>  - Add two refactoring commits at the end of the series to
>optimize read and write i/o path.
> 
> - Incorporate feedback from Keith, Klaus and Niklas:
> 
>   * fix rebase errors in nvme_identify_ns_descr_list()
>   * remove unnecessary code from nvme_write_bar()
>   * move csi to NvmeNamespace and use it from the beginning in NSTypes
> patch
>   * change zone read processing to cover all corner cases with RAZB=1
>   * sync w_ptr and d.wp in case of a i/o error at the preceding zone
>   * reword the commit message in active/inactive patch with the new
> text from Niklas
>   * correct dlfeat reporting depending on the fill pattern set
>   * add more checks for "attached" n/s parameter to prevent i/o and
> get/set features on inactive namespaces
>   * Use DEFINE_PROP_SIZE and DEFINE_PROP_SIZE32 for zone size/capacity
> and ZASL