nvme: Don't ring a doorbell for first of fused commands

This patch adds first_fused_submitted field in spdk_nvme_qpair
structure which is used for postponing ringing a doorbell for
fused commands.

Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: Ibfc43931891ebaadbafa4895c05af9f228440210

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/477024
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
This commit is contained in:
Maciej Szwed 2019-12-05 13:11:20 +01:00 committed by Tomasz Zawadzki
parent 1c5d980300
commit 334aeff9e1
2 changed files with 13 additions and 0 deletions

View File

@ -378,6 +378,8 @@ struct spdk_nvme_qpair {
*/
uint8_t no_deletion_notification_needed: 1;
uint8_t first_fused_submitted: 1;
enum spdk_nvme_transport_type trtype;
STAILQ_HEAD(, nvme_request) free_req;

View File

@ -1244,6 +1244,12 @@ 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) {
/* This is first cmd of two fused commands - don't ring doorbell */
qpair->first_fused_submitted = 0;
return;
}
if (spdk_unlikely(pqpair->flags.has_shadow_doorbell)) {
need_mmio = nvme_pcie_qpair_update_mmio_required(qpair,
pqpair->sq_tail,
@ -1289,6 +1295,11 @@ nvme_pcie_qpair_submit_tracker(struct spdk_nvme_qpair *qpair, struct nvme_tracke
req = tr->req;
assert(req != NULL);
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;
}
/* Copy the command from the tracker to the submission queue. */
nvme_pcie_copy_command(&pqpair->cmd[pqpair->sq_tail], &req->cmd);