Patchwork [2/5] block/nvme: fix doorbell stride

login
register
mail settings
Submitter Maxim Levitsky
Date April 15, 2019, 1:57 p.m.
Message ID <20190415135746.7571-3-mlevitsk@redhat.com>
Download mbox | patch
Permalink /patch/773157/
State New
Headers show

Comments

Maxim Levitsky - April 15, 2019, 1:57 p.m.
Fix the math involving non standard doorbell stride

Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
---
 block/nvme.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch

diff --git a/block/nvme.c b/block/nvme.c
index 2d208000df..208242cf1f 100644
--- a/block/nvme.c
+++ b/block/nvme.c
@@ -216,7 +216,7 @@  static NVMeQueuePair *nvme_create_queue_pair(BlockDriverState *bs,
         error_propagate(errp, local_err);
         goto fail;
     }
-    q->cq.doorbell = &s->regs->doorbells[idx * 2 * s->doorbell_scale + 1];
+    q->cq.doorbell = &s->regs->doorbells[(idx * 2 + 1) * s->doorbell_scale];
 
     return q;
 fail: