diff --git a/lib/nvme/nvme_internal.h b/lib/nvme/nvme_internal.h index fbf9b8614..9da6bde37 100644 --- a/lib/nvme/nvme_internal.h +++ b/lib/nvme/nvme_internal.h @@ -446,7 +446,7 @@ struct spdk_nvme_qpair { */ uint8_t no_deletion_notification_needed: 1; - uint8_t first_fused_submitted: 1; + uint8_t last_fuse: 2; uint8_t transport_failure_reason: 2; uint8_t last_transport_failure_reason: 2; diff --git a/lib/nvme/nvme_pcie_common.c b/lib/nvme/nvme_pcie_common.c index a74388afd..8009e6e12 100644 --- a/lib/nvme/nvme_pcie_common.c +++ b/lib/nvme/nvme_pcie_common.c @@ -651,9 +651,12 @@ nvme_pcie_qpair_submit_tracker(struct spdk_nvme_qpair *qpair, struct nvme_tracke spdk_trace_record(TRACE_NVME_PCIE_SUBMIT, qpair->id, 0, (uintptr_t)req, req->cmd.cid, req->cmd.opc, req->cmd.cdw10, req->cmd.cdw11, req->cmd.cdw12); - if (req->cmd.fuse == SPDK_NVME_IO_FLAGS_FUSE_FIRST) { - /* This is first cmd of two fused commands - don't ring doorbell */ - qpair->first_fused_submitted = 1; + if (req->cmd.fuse) { + /* + * Keep track of the fuse operation sequence so that we ring the doorbell only + * after the second fuse is submitted. + */ + qpair->last_fuse = req->cmd.fuse; } /* Don't use wide instructions to copy NVMe command, this is limited by QEMU diff --git a/lib/nvme/nvme_pcie_internal.h b/lib/nvme/nvme_pcie_internal.h index c7aaeaf67..0849aaae9 100644 --- a/lib/nvme/nvme_pcie_internal.h +++ b/lib/nvme/nvme_pcie_internal.h @@ -277,9 +277,8 @@ nvme_pcie_qpair_ring_sq_doorbell(struct spdk_nvme_qpair *qpair) struct nvme_pcie_ctrlr *pctrlr = nvme_pcie_ctrlr(qpair->ctrlr); bool need_mmio = true; - if (qpair->first_fused_submitted) { + if (qpair->last_fuse == SPDK_NVME_IO_FLAGS_FUSE_FIRST) { /* This is first cmd of two fused commands - don't ring doorbell */ - qpair->first_fused_submitted = 0; return; }