nvme: add nvme_pcie_qpair_ring_cq_doorbell
Similar to recently added nvme_pcie_qpair_ring_sq_doorbell. Prepares for using this code for coalescing cq doorbell writes in the future. Signed-off-by: Jim Harris <james.r.harris@intel.com> Change-Id: I565e103acf73b3d305e72a4440e1cc678c95faa0 Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/448871 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
parent
24e012c082
commit
205111718d
@ -1208,6 +1208,27 @@ nvme_pcie_qpair_ring_sq_doorbell(struct spdk_nvme_qpair *qpair)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline void
|
||||||
|
nvme_pcie_qpair_ring_cq_doorbell(struct spdk_nvme_qpair *qpair)
|
||||||
|
{
|
||||||
|
struct nvme_pcie_qpair *pqpair = nvme_pcie_qpair(qpair);
|
||||||
|
struct nvme_pcie_ctrlr *pctrlr = nvme_pcie_ctrlr(qpair->ctrlr);
|
||||||
|
bool need_mmio = true;
|
||||||
|
|
||||||
|
if (spdk_unlikely(pqpair->flags.has_shadow_doorbell)) {
|
||||||
|
need_mmio = nvme_pcie_qpair_update_mmio_required(qpair,
|
||||||
|
pqpair->cq_head,
|
||||||
|
pqpair->shadow_doorbell.cq_hdbl,
|
||||||
|
pqpair->shadow_doorbell.cq_eventidx);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (spdk_likely(need_mmio)) {
|
||||||
|
g_thread_mmio_ctrlr = pctrlr;
|
||||||
|
spdk_mmio_write_4(pqpair->cq_hdbl, pqpair->cq_head);
|
||||||
|
g_thread_mmio_ctrlr = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
nvme_pcie_qpair_submit_tracker(struct spdk_nvme_qpair *qpair, struct nvme_tracker *tr)
|
nvme_pcie_qpair_submit_tracker(struct spdk_nvme_qpair *qpair, struct nvme_tracker *tr)
|
||||||
{
|
{
|
||||||
@ -2079,7 +2100,6 @@ int32_t
|
|||||||
nvme_pcie_qpair_process_completions(struct spdk_nvme_qpair *qpair, uint32_t max_completions)
|
nvme_pcie_qpair_process_completions(struct spdk_nvme_qpair *qpair, uint32_t max_completions)
|
||||||
{
|
{
|
||||||
struct nvme_pcie_qpair *pqpair = nvme_pcie_qpair(qpair);
|
struct nvme_pcie_qpair *pqpair = nvme_pcie_qpair(qpair);
|
||||||
struct nvme_pcie_ctrlr *pctrlr = nvme_pcie_ctrlr(qpair->ctrlr);
|
|
||||||
struct nvme_tracker *tr;
|
struct nvme_tracker *tr;
|
||||||
struct spdk_nvme_cpl *cpl;
|
struct spdk_nvme_cpl *cpl;
|
||||||
uint32_t num_completions = 0;
|
uint32_t num_completions = 0;
|
||||||
@ -2145,20 +2165,7 @@ nvme_pcie_qpair_process_completions(struct spdk_nvme_qpair *qpair, uint32_t max_
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (num_completions > 0) {
|
if (num_completions > 0) {
|
||||||
bool need_mmio = true;
|
nvme_pcie_qpair_ring_cq_doorbell(qpair);
|
||||||
|
|
||||||
if (spdk_unlikely(pqpair->flags.has_shadow_doorbell)) {
|
|
||||||
need_mmio = nvme_pcie_qpair_update_mmio_required(qpair,
|
|
||||||
pqpair->cq_head,
|
|
||||||
pqpair->shadow_doorbell.cq_hdbl,
|
|
||||||
pqpair->shadow_doorbell.cq_eventidx);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (spdk_likely(need_mmio)) {
|
|
||||||
g_thread_mmio_ctrlr = pctrlr;
|
|
||||||
spdk_mmio_write_4(pqpair->cq_hdbl, pqpair->cq_head);
|
|
||||||
g_thread_mmio_ctrlr = NULL;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pqpair->flags.delay_pcie_doorbell) {
|
if (pqpair->flags.delay_pcie_doorbell) {
|
||||||
|
Loading…
Reference in New Issue
Block a user