From cdb3a594a88d1156b27ea91d5c961fb809e48a90 Mon Sep 17 00:00:00 2001 From: Daniel Verkamp Date: Tue, 5 Jun 2018 16:01:52 -0700 Subject: [PATCH] nvme: ignore requests submitted before timeout set If requests are in flight at the time a timeout callback is configured, we can't retroactively get the submission time of those requests; treat them as not having a timeout. Change-Id: Ic589e874a0f2c8c7f4ce352afa7c3aea33b01fae Signed-off-by: Daniel Verkamp Reviewed-on: https://review.gerrithub.io/413863 Tested-by: SPDK Automated Test System Reviewed-by: Jim Harris Reviewed-by: Ben Walker Reviewed-by: Changpeng Liu --- lib/nvme/nvme_pcie.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/nvme/nvme_pcie.c b/lib/nvme/nvme_pcie.c index d6c8cd17b..89ef13182 100644 --- a/lib/nvme/nvme_pcie.c +++ b/lib/nvme/nvme_pcie.c @@ -1171,6 +1171,8 @@ nvme_pcie_qpair_submit_tracker(struct spdk_nvme_qpair *qpair, struct nvme_tracke req->timed_out = false; if (spdk_unlikely(pctrlr->ctrlr.timeout_enabled)) { req->submit_tick = spdk_get_ticks(); + } else { + req->submit_tick = 0; } pqpair->tr[tr->cid].active = true; @@ -2001,7 +2003,7 @@ nvme_pcie_qpair_check_timeout(struct spdk_nvme_qpair *qpair) TAILQ_FOREACH_SAFE(tr, &pqpair->outstanding_tr, tq_list, tmp) { assert(tr->req != NULL); - if (tr->req->timed_out) { + if (tr->req->timed_out || tr->req->submit_tick == 0) { continue; }