qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Keith Busch <keith.busch@intel.com>
To: Alex Friedman <alex@e8storage.com>
Cc: keith.busch@intel.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] nvme: Fix get/set number of queues feature
Date: Fri, 5 Dec 2014 15:45:20 +0000 (UTC)	[thread overview]
Message-ID: <alpine.LNX.2.00.1412051541480.4225@localhost.lm.intel.com> (raw)
In-Reply-To: <1417783224-8825-1-git-send-email-alex@e8storage.com>

On Fri, 5 Dec 2014, alex@e8storage.com wrote:
> From: Alex Friedman <alex@e8storage.com>
>
> According to the specification, the low 16 bits should contain the number of
> I/O submission queues, and the high 16 bits should contain the number of
> I/O completion queues.
>
> Signed-off-by: Alex Friedman <alex@e8storage.com>

Good catch, thanks for the fix!

Acked-by: Keith Busch <keith.busch@intel.com>

> ---
> hw/block/nvme.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/hw/block/nvme.c b/hw/block/nvme.c
> index b6263dc..405cf4f 100644
> --- a/hw/block/nvme.c
> +++ b/hw/block/nvme.c
> @@ -476,7 +476,8 @@ static uint16_t nvme_get_feature(NvmeCtrl *n, NvmeCmd *cmd, NvmeRequest *req)
>
>     switch (dw10) {
>     case NVME_NUMBER_OF_QUEUES:
> -        req->cqe.result = cpu_to_le32(n->num_queues);
> +        req->cqe.result =
> +            cpu_to_le32((n->num_queues - 1) | ((n->num_queues - 1) << 16));
>         break;
>     default:
>         return NVME_INVALID_FIELD | NVME_DNR;
> @@ -490,7 +491,8 @@ static uint16_t nvme_set_feature(NvmeCtrl *n, NvmeCmd *cmd, NvmeRequest *req)
>
>     switch (dw10) {
>     case NVME_NUMBER_OF_QUEUES:
> -        req->cqe.result = cpu_to_le32(n->num_queues);
> +        req->cqe.result =
> +            cpu_to_le32((n->num_queues - 1) | ((n->num_queues - 1) << 16));
>         break;
>     default:
>         return NVME_INVALID_FIELD | NVME_DNR;
> -- 
> 1.9.3

  reply	other threads:[~2014-12-05 15:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-05 12:40 [Qemu-devel] [PATCH] nvme: Fix get/set number of queues feature alex
2014-12-05 15:45 ` Keith Busch [this message]
2014-12-29 17:15   ` Alex Friedman
2015-01-07 15:36 ` Stefan Hajnoczi
2015-01-08 16:00   ` Keith Busch

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=alpine.LNX.2.00.1412051541480.4225@localhost.lm.intel.com \
    --to=keith.busch@intel.com \
    --cc=alex@e8storage.com \
    --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).