mbox series

[0/3] hw/block/nvme: mdts/zasl cleanup

Message ID 20210222202921.92774-1-its@irrelevant.dk
Headers show
Series hw/block/nvme: mdts/zasl cleanup | expand

Message

Klaus Jensen Feb. 22, 2021, 8:29 p.m. UTC
From: Klaus Jensen <k.jensen@samsung.com>

The gist of this series is about aligning the zoned.zasl parameter with
the mdts parameter. I complained about this back when I was reviewing
the zoned series but was shot down. I relented on the size/capacity
debate (and still fully support that), but I never really liked that
ZASL is different from MDTS. Changing the definition makes the
validation code much simpler and, well, it aligns perfectly with the
existing mdts parameter, which is the goal here.

While the current definition of zasl is in master, it has not yet been
released, so this is sort of our last chance to change this before v6.0.

I'll repeat the commit message of [3/3] here for context:

ZASL (Zone Append Size Limit) is defined exactly like MDTS (Maximum Data
Transfer Size), that is, it is a value in units of the minimum memory
page size (CAP.MPSMIN) and is reported as a power of two.

The 'mdts' nvme device parameter is specified as in the spec, but the
'zoned.append_size_limit' parameter is specified in bytes. This is
suboptimal for a number of reasons:

  1. It is just plain confusing wrt. the definition of mdts.
  2. There is a lot of complexity involved in validating the value; it
     must be a power of two, it should be larger than 4k, if it is zero
     we set it internally to mdts, but still report it as zero.
  3. While "hw/block/nvme: improve invalid zasl value reporting"
     slightly improved the handling of the parameter, the validation is
     still wrong; it does not depend on CC.MPS, it depends on
     CAP.MPSMIN. And we are not even checking that it is actually less
     than or equal to MDTS, which is kinda the *one* condition it must
     satisfy.

Fix this by defining zasl exactly like mdts and checking the one thing
that it must satisfy (that it is less than or equal to mdts). Also,
change the default value from 128KiB to 0 (aka, whatever mdts is).

Klaus Jensen (3):
  hw/block/nvme: document 'mdts' nvme device parameter
  hw/block/nvme: deduplicate bad mdts trace event
  hw/block/nvme: align zoned.zasl with mdts

 hw/block/nvme.h       |  4 +--
 hw/block/nvme.c       | 67 ++++++++++++++-----------------------------
 hw/block/trace-events |  4 +--
 3 files changed, 25 insertions(+), 50 deletions(-)

Comments

Keith Busch Feb. 22, 2021, 9 p.m. UTC | #1
These look good.

Reviewed-by: Keith Busch <kbusch@kernel.org>
Klaus Jensen Feb. 25, 2021, 10:43 a.m. UTC | #2
On Feb 23 06:00, Keith Busch wrote:
> These look good.
> 
> Reviewed-by: Keith Busch <kbusch@kernel.org>

Thanks, applied to nvme-next.