qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Fomichev <Dmitry.Fomichev@wdc.com>
To: "its@irrelevant.dk" <its@irrelevant.dk>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Cc: "kwolf@redhat.com" <kwolf@redhat.com>,
	"qemu-block@nongnu.org" <qemu-block@nongnu.org>,
	"k.jensen@samsung.com" <k.jensen@samsung.com>,
	"anaidu.gollu@samsung.com" <anaidu.gollu@samsung.com>,
	"mreitz@redhat.com" <mreitz@redhat.com>,
	"kbusch@kernel.org" <kbusch@kernel.org>
Subject: Re: [PATCH v2] hw/block/nvme: add missing mor/mar constraint checks
Date: Mon, 8 Feb 2021 00:13:35 +0000	[thread overview]
Message-ID: <8f17c20687867bf2916ee44ef22211887ef349eb.camel@wdc.com> (raw)
In-Reply-To: <20210126121529.317189-1-its@irrelevant.dk>

On Tue, 2021-01-26 at 13:15 +0100, Klaus Jensen wrote:
> From: Klaus Jensen <k.jensen@samsung.com>
> 
> Firstly, if zoned.max_active is non-zero, zoned.max_open must be less
> than or equal to zoned.max_active.
> 
> Secondly, if only zones.max_active is set, we have to explicitly set
> zones.max_open or we end up with an invalid MAR/MOR configuration. This
> is an artifact of the parameters not being zeroes-based like in the
> spec.
> 
> Cc: Dmitry Fomichev <dmitry.fomichev@wdc.com>
> Reported-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
> Signed-off-by: Klaus Jensen <k.jensen@samsung.com>

Reviewed-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>

> ---
> 
> v2:
> 
>   * Jumped the gun on removing the check on zoned.max_open. It should
>     still be done since the device might only have a constraint on open
>     zones, not active.
>   * Instead, added an explicit set of zoned.max_open if only
>     zoned.max_active is specifed.
> 
>  hw/block/nvme-ns.c | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/hw/block/nvme-ns.c b/hw/block/nvme-ns.c
> index 62b25cf69bfa..df514287b58f 100644
> --- a/hw/block/nvme-ns.c
> +++ b/hw/block/nvme-ns.c
> @@ -153,6 +153,18 @@ static int nvme_ns_zoned_check_calc_geometry(NvmeNamespace *ns, Error **errp)
>          return -1;
>      }
>  
> 
> 
> 
> +    if (ns->params.max_active_zones) {
> +        if (ns->params.max_open_zones > ns->params.max_active_zones) {
> +            error_setg(errp, "max_open_zones (%u) exceeds max_active_zones (%u)",
> +                       ns->params.max_open_zones, ns->params.max_active_zones);
> +            return -1;
> +        }
> +
> +        if (!ns->params.max_open_zones) {
> +            ns->params.max_open_zones = ns->params.max_active_zones;
> +        }
> +    }
> +
>      if (ns->params.zd_extension_size) {
>          if (ns->params.zd_extension_size & 0x3f) {
>              error_setg(errp,


  reply	other threads:[~2021-02-08  0:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-26 12:15 [PATCH v2] hw/block/nvme: add missing mor/mar constraint checks Klaus Jensen
2021-02-08  0:13 ` Dmitry Fomichev [this message]
2021-02-08  8:03   ` 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=8f17c20687867bf2916ee44ef22211887ef349eb.camel@wdc.com \
    --to=dmitry.fomichev@wdc.com \
    --cc=anaidu.gollu@samsung.com \
    --cc=its@irrelevant.dk \
    --cc=k.jensen@samsung.com \
    --cc=kbusch@kernel.org \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --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 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).