qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] hw/block/nvme: mdts/zasl cleanup
@ 2021-02-22 20:29 Klaus Jensen
  2021-02-22 20:29 ` [PATCH 1/3] hw/block/nvme: document 'mdts' nvme device parameter Klaus Jensen
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Klaus Jensen @ 2021-02-22 20:29 UTC (permalink / raw)
  To: qemu-devel
  Cc: Kevin Wolf, qemu-block, Klaus Jensen, Max Reitz, Klaus Jensen,
	Keith Busch

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(-)

-- 
2.30.1



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-02-25 10:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-02-22 20:29 [PATCH 0/3] hw/block/nvme: mdts/zasl cleanup Klaus Jensen
2021-02-22 20:29 ` [PATCH 1/3] hw/block/nvme: document 'mdts' nvme device parameter Klaus Jensen
2021-02-22 20:29 ` [PATCH 2/3] hw/block/nvme: deduplicate bad mdts trace event Klaus Jensen
2021-02-22 20:29 ` [PATCH 3/3] hw/block/nvme: align zoned.zasl with mdts Klaus Jensen
2021-02-22 21:00 ` [PATCH 0/3] hw/block/nvme: mdts/zasl cleanup Keith Busch
2021-02-25 10:43   ` Klaus Jensen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).