QEMU-Devel Archive mirror
 help / color / mirror / Atom feed
From: Klaus Jensen <its@irrelevant.dk>
To: Vincent Fu <vincentfu@gmail.com>
Cc: qemu-devel@nongnu.org, k.jensen@samsung.com,
	Vincent Fu <vincent.fu@samsung.com>
Subject: Re: [PATCH] hw/nvme: fix number of PIDs for FDP RUH update
Date: Mon, 6 May 2024 09:12:55 +0200	[thread overview]
Message-ID: <ZjiC9zVPuRJ81nBE@cormorant.local> (raw)
In-Reply-To: <20240503175004.1573-1-vincent.fu@samsung.com>

[-- Attachment #1: Type: text/plain, Size: 1091 bytes --]

On May  3 13:50, Vincent Fu wrote:
> The number of PIDs is in the upper 16 bits of cdw10. So we need to
> right-shift by 16 bits instead of only a single bit.
> 
> Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
> ---
>  hw/nvme/ctrl.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c
> index 127c3d2383..e89f9f7808 100644
> --- a/hw/nvme/ctrl.c
> +++ b/hw/nvme/ctrl.c
> @@ -4352,7 +4352,7 @@ static uint16_t nvme_io_mgmt_send_ruh_update(NvmeCtrl *n, NvmeRequest *req)
>      NvmeNamespace *ns = req->ns;
>      uint32_t cdw10 = le32_to_cpu(cmd->cdw10);
>      uint16_t ret = NVME_SUCCESS;
> -    uint32_t npid = (cdw10 >> 1) + 1;
> +    uint32_t npid = (cdw10 >> 16) + 1;
>      unsigned int i = 0;
>      g_autofree uint16_t *pids = NULL;
>      uint32_t maxnpid;
> -- 
> 2.43.0
> 

Hi Vincent,

Thanks, LGTM! Applied to nvme-next!

Reviewed-by: Klaus Jensen <k.jensen@samsung.com>

I'll also add,

Cc: qemu-stable@nongnu.org
Fixes: 73064edfb864 ("hw/nvme: flexible data placement emulation")

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

      reply	other threads:[~2024-05-06  7:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-03 17:50 [PATCH] hw/nvme: fix number of PIDs for FDP RUH update Vincent Fu
2024-05-06  7:12 ` Klaus Jensen [this message]

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=ZjiC9zVPuRJ81nBE@cormorant.local \
    --to=its@irrelevant.dk \
    --cc=k.jensen@samsung.com \
    --cc=qemu-devel@nongnu.org \
    --cc=vincent.fu@samsung.com \
    --cc=vincentfu@gmail.com \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).