qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] nvme: Fix get/set number of queues feature


From: Keith Busch
Subject: Re: [Qemu-devel] [PATCH] nvme: Fix get/set number of queues feature
Date: Fri, 5 Dec 2014 15:45:20 +0000 (UTC)
User-agent: Alpine 2.00 (LNX 1167 2008-08-23)

On Fri, 5 Dec 2014, address@hidden wrote:
From: Alex Friedman <address@hidden>

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 <address@hidden>

Good catch, thanks for the fix!

Acked-by: Keith Busch <address@hidden>

---
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 via email to

[Prev in Thread] Current Thread [Next in Thread]