[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 64/64] block/nvme: Pair doorbell registers
From: |
Kevin Wolf |
Subject: |
[PULL 64/64] block/nvme: Pair doorbell registers |
Date: |
Mon, 7 Sep 2020 13:09:36 +0200 |
From: Philippe Mathieu-Daudé <philmd@redhat.com>
For each queue doorbell registers are paired as:
- Submission Queue Tail Doorbell
- Completion Queue Head Doorbell
Reflect that in the NVMeRegs structure, and adapt
nvme_create_queue_pair() accordingly.
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20200904124130.583838-4-philmd@redhat.com>
Reviewed-by: Klaus Jensen <k.jensen@samsung.com>
Reviewed-by: Fam Zheng <fam@euphon.net>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
block/nvme.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/block/nvme.c b/block/nvme.c
index a216cc407f..f4f27b6da7 100644
--- a/block/nvme.c
+++ b/block/nvme.c
@@ -84,7 +84,10 @@ typedef struct {
/* Memory mapped registers */
typedef volatile struct {
NvmeBar ctrl;
- uint32_t doorbells[];
+ struct {
+ uint32_t sq_tail;
+ uint32_t cq_head;
+ } doorbells[];
} NVMeRegs;
#define INDEX_ADMIN 0
@@ -244,14 +247,14 @@ static NVMeQueuePair
*nvme_create_queue_pair(BDRVNVMeState *s,
error_propagate(errp, local_err);
goto fail;
}
- q->sq.doorbell = &s->regs->doorbells[idx * 2 * s->doorbell_scale];
+ q->sq.doorbell = &s->regs->doorbells[idx * s->doorbell_scale].sq_tail;
nvme_init_queue(s, &q->cq, size, NVME_CQ_ENTRY_BYTES, &local_err);
if (local_err) {
error_propagate(errp, local_err);
goto fail;
}
- q->cq.doorbell = &s->regs->doorbells[(idx * 2 + 1) * s->doorbell_scale];
+ q->cq.doorbell = &s->regs->doorbells[idx * s->doorbell_scale].cq_head;
return q;
fail:
--
2.25.4
- [PULL 55/64] iotests: Let complete_and_wait() work with commit, (continued)
- [PULL 55/64] iotests: Let complete_and_wait() work with commit, Kevin Wolf, 2020/09/07
- [PULL 56/64] iotests: Add filter commit test cases, Kevin Wolf, 2020/09/07
- [PULL 52/64] block: Inline bdrv_co_block_status_from_*(), Kevin Wolf, 2020/09/07
- [PULL 58/64] iotests: Add test for commit in sub directory, Kevin Wolf, 2020/09/07
- [PULL 59/64] iotests: Test committing to overridden backing, Kevin Wolf, 2020/09/07
- [PULL 60/64] iotests: Allow running from different directory, Kevin Wolf, 2020/09/07
- [PULL 61/64] file-win32: Fix "locking" option, Kevin Wolf, 2020/09/07
- [PULL 63/64] block/nvme: Use generic NvmeBar structure, Kevin Wolf, 2020/09/07
- [PULL 57/64] iotests: Add filter mirror test cases, Kevin Wolf, 2020/09/07
- [PULL 62/64] block/nvme: Group controller registers in NVMeRegs structure, Kevin Wolf, 2020/09/07
- [PULL 64/64] block/nvme: Pair doorbell registers,
Kevin Wolf <=
- [PULL 37/64] block/snapshot: Fix fallback, Kevin Wolf, 2020/09/07
- [PULL 44/64] block-copy: Use CAF to find sync=top base, Kevin Wolf, 2020/09/07
- Re: [PULL 00/64] Block layer patches, Peter Maydell, 2020/09/07