From: Klaus Jensen <its@irrelevant.dk>
To: qemu-devel@nongnu.org
Cc: qemu-block@nongnu.org, Keith Busch <kbusch@kernel.org>,
Klaus Jensen <its@irrelevant.dk>,
Klaus Jensen <k.jensen@samsung.com>
Subject: [PATCH 04/12] hw/nvme: fix numzrwa handling
Date: Thu, 23 Jun 2022 23:18:13 +0200 [thread overview]
Message-ID: <20220623211821.50534-5-its@irrelevant.dk> (raw)
In-Reply-To: <20220623211821.50534-1-its@irrelevant.dk>
From: Klaus Jensen <k.jensen@samsung.com>
Number of ZRWA Resources should be initialized to Max Active Resources,
and not the total number of zones.
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
---
hw/nvme/ctrl.c | 8 ++------
hw/nvme/ns.c | 4 ++--
2 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c
index af82daa304bf..a09700455c02 100644
--- a/hw/nvme/ctrl.c
+++ b/hw/nvme/ctrl.c
@@ -1765,9 +1765,7 @@ static uint16_t nvme_zrm_finish(NvmeNamespace *ns, NvmeZone *zone)
if (zone->d.za & NVME_ZA_ZRWA_VALID) {
zone->d.za &= ~NVME_ZA_ZRWA_VALID;
- if (ns->params.numzrwa) {
- ns->zns.numzrwa++;
- }
+ ns->zns.numzrwa++;
}
/* fallthrough */
@@ -1807,9 +1805,7 @@ static uint16_t nvme_zrm_reset(NvmeNamespace *ns, NvmeZone *zone)
nvme_aor_dec_active(ns);
if (zone->d.za & NVME_ZA_ZRWA_VALID) {
- if (ns->params.numzrwa) {
- ns->zns.numzrwa++;
- }
+ ns->zns.numzrwa++;
}
/* fallthrough */
diff --git a/hw/nvme/ns.c b/hw/nvme/ns.c
index 870c3ca1a2f0..b9b35b3c3bc9 100644
--- a/hw/nvme/ns.c
+++ b/hw/nvme/ns.c
@@ -286,7 +286,7 @@ static void nvme_ns_init_zoned(NvmeNamespace *ns)
if (ns->params.zrwas) {
ns->zns.numzrwa = ns->params.numzrwa ?
- ns->params.numzrwa : ns->num_zones;
+ ns->params.numzrwa : ns->params.max_active_zones;
ns->zns.zrwas = ns->params.zrwas >> ns->lbaf.ds;
ns->zns.zrwafg = ns->params.zrwafg >> ns->lbaf.ds;
@@ -294,7 +294,7 @@ static void nvme_ns_init_zoned(NvmeNamespace *ns)
id_ns_z->ozcs |= NVME_ID_NS_ZONED_OZCS_ZRWASUP;
id_ns_z->zrwacap = NVME_ID_NS_ZONED_ZRWACAP_EXPFLUSHSUP;
- id_ns_z->numzrwa = cpu_to_le32(ns->params.numzrwa);
+ id_ns_z->numzrwa = cpu_to_le32(ns->zns.numzrwa - 1);
id_ns_z->zrwas = cpu_to_le16(ns->zns.zrwas);
id_ns_z->zrwafg = cpu_to_le16(ns->zns.zrwafg);
}
--
2.36.1
next prev parent reply other threads:[~2022-06-23 21:27 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-23 21:18 [PATCH 00/12] hw/nvme: misc fixes and updates Klaus Jensen
2022-06-23 21:18 ` [PATCH 01/12] hw/nvme: fix incorrect use of errp/local_err Klaus Jensen
2022-06-23 21:18 ` [PATCH 02/12] hw/nvme: remove redundant passing of PCIDevice Klaus Jensen
2022-06-23 21:18 ` [PATCH 03/12] hw/nvme: cleanup error reporting in nvme_init_pci() Klaus Jensen
2022-06-23 21:18 ` Klaus Jensen [this message]
2022-06-23 21:18 ` [PATCH 05/12] hw/nvme: fix accidental reintroduction of redundant code Klaus Jensen
2022-06-23 21:18 ` [PATCH 06/12] hw/nvme: fix cancellation of format operations Klaus Jensen
2022-06-23 21:18 ` [PATCH 07/12] hw/nvme: fix flush cancel Klaus Jensen
2022-06-23 21:18 ` [PATCH 08/12] hw/nvme: rework flush bh scheduling Klaus Jensen
2022-06-23 21:18 ` [PATCH 09/12] hw/nvme: improve cancellation handling in zone reset Klaus Jensen
2022-06-23 21:18 ` [PATCH 10/12] hw/nvme: improve cancellation handling in dsm Klaus Jensen
2022-06-23 21:18 ` [PATCH 11/12] hw/nvme: simplify copy command error handling Klaus Jensen
2022-06-23 21:18 ` [PATCH 12/12] hw/nvme: align logic of format with flush Klaus Jensen
2022-07-14 5:37 ` [PATCH 00/12] hw/nvme: misc fixes and updates Klaus Jensen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220623211821.50534-5-its@irrelevant.dk \
--to=its@irrelevant.dk \
--cc=k.jensen@samsung.com \
--cc=kbusch@kernel.org \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.