Commit e7026f19 authored by Alex Friedman's avatar Alex Friedman Committed by Stefan Hajnoczi
Browse files

nvme: Fix get/set number of queues feature



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: default avatarAlex Friedman <alex@e8storage.com>
Acked-by: default avatarKeith Busch <keith.busch@intel.com>
Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
parent 9a502563
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -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;