mbox series

[v2,0/6] hw/nvme: enhanced protection information (64-bit guard)

Message ID 20220301104428.160017-1-its@irrelevant.dk (mailing list archive)
Headers show
Series hw/nvme: enhanced protection information (64-bit guard) | expand

Message

Klaus Jensen March 1, 2022, 10:44 a.m. UTC
From: Klaus Jensen <k.jensen@samsung.com>

This adds support for one possible new protection information format
introduced in TP4068 (and integrated in NVMe 2.0): the 64-bit CRC guard
and 48-bit reference tag. This version does not support storage tags.

Like the CRC16 support already present, this uses a software
implementation of CRC64 (so it is naturally pretty slow). But its good
enough for verification purposes.

This goes hand-in-hand with the support that Keith submitted for the
Linux kernel[1].

  [1]: https://lore.kernel.org/linux-nvme/20220201190128.3075065-1-kbusch@kernel.org/

Changes since v1
~~~~~~~~~~~~~~~~
- Check metadata size depending on pi guard type selected. (Keith)

Klaus Jensen (3):
  hw/nvme: move dif/pi prototypes into dif.h
  hw/nvme: move format parameter parsing
  hw/nvme: add pi tuple size helper

Naveen Nagar (3):
  hw/nvme: add host behavior support feature
  hw/nvme: add support for the lbafee hbs feature
  hw/nvme: 64-bit pi support

 hw/nvme/ctrl.c       | 235 +++++++++++++++++++++------
 hw/nvme/dif.c        | 378 +++++++++++++++++++++++++++++++++----------
 hw/nvme/dif.h        | 191 ++++++++++++++++++++++
 hw/nvme/ns.c         |  50 ++++--
 hw/nvme/nvme.h       |  58 +------
 hw/nvme/trace-events |  12 +-
 include/block/nvme.h |  81 ++++++++--
 7 files changed, 793 insertions(+), 212 deletions(-)
 create mode 100644 hw/nvme/dif.h

Comments

Keith Busch March 1, 2022, 2:54 p.m. UTC | #1
On Tue, Mar 01, 2022 at 11:44:22AM +0100, Klaus Jensen wrote:
> From: Klaus Jensen <k.jensen@samsung.com>
> 
> This adds support for one possible new protection information format
> introduced in TP4068 (and integrated in NVMe 2.0): the 64-bit CRC guard
> and 48-bit reference tag. This version does not support storage tags.
> 
> Like the CRC16 support already present, this uses a software
> implementation of CRC64 (so it is naturally pretty slow). But its good
> enough for verification purposes.
> 
> This goes hand-in-hand with the support that Keith submitted for the
> Linux kernel[1].
> 
>   [1]: https://lore.kernel.org/linux-nvme/20220201190128.3075065-1-kbusch@kernel.org/

Thanks Klaus, this looks good to me.

Reviewed-by: Keith Busch <kbusch@kernel.org>
Klaus Jensen March 3, 2022, 11:24 a.m. UTC | #2
On Mar  1 06:54, Keith Busch wrote:
> On Tue, Mar 01, 2022 at 11:44:22AM +0100, Klaus Jensen wrote:
> > From: Klaus Jensen <k.jensen@samsung.com>
> > 
> > This adds support for one possible new protection information format
> > introduced in TP4068 (and integrated in NVMe 2.0): the 64-bit CRC guard
> > and 48-bit reference tag. This version does not support storage tags.
> > 
> > Like the CRC16 support already present, this uses a software
> > implementation of CRC64 (so it is naturally pretty slow). But its good
> > enough for verification purposes.
> > 
> > This goes hand-in-hand with the support that Keith submitted for the
> > Linux kernel[1].
> > 
> >   [1]: https://lore.kernel.org/linux-nvme/20220201190128.3075065-1-kbusch@kernel.org/
> 
> Thanks Klaus, this looks good to me.
> 
> Reviewed-by: Keith Busch <kbusch@kernel.org>

Thanks,

Applied to nvme-next!