nvme: fix the endless loop of aborting trackers
The completion cb of outstanding_tr may submit new requeset to the outstanding_tr list of the qpair, it's an endless loop. We only abort the remaining outstanding trackers. Fix #819 Change-Id: I342f52f4d1836f8ef620ef9e3add0b1986727282 Signed-off-by: JinYu <jin.yu@intel.com> Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457755 Tested-by: 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: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
This commit is contained in:
parent
68fbb33b81
commit
77290bfe6b
@ -967,7 +967,8 @@ nvme_pcie_qpair_reset(struct spdk_nvme_qpair *qpair)
|
||||
{
|
||||
struct nvme_pcie_qpair *pqpair = nvme_pcie_qpair(qpair);
|
||||
|
||||
pqpair->last_sq_tail = pqpair->sq_tail = pqpair->cq_head = 0;
|
||||
/* all head/tail vals are set to 0 */
|
||||
pqpair->last_sq_tail = pqpair->sq_tail = pqpair->sq_head = pqpair->cq_head = 0;
|
||||
|
||||
/*
|
||||
* First time through the completion queue, HW will set phase
|
||||
@ -1377,14 +1378,21 @@ static void
|
||||
nvme_pcie_qpair_abort_trackers(struct spdk_nvme_qpair *qpair, uint32_t dnr)
|
||||
{
|
||||
struct nvme_pcie_qpair *pqpair = nvme_pcie_qpair(qpair);
|
||||
struct nvme_tracker *tr, *temp;
|
||||
struct nvme_tracker *tr, *temp, *last;
|
||||
|
||||
last = TAILQ_LAST(&pqpair->outstanding_tr, nvme_outstanding_tr_head);
|
||||
|
||||
/* Abort previously submitted (outstanding) trs */
|
||||
TAILQ_FOREACH_SAFE(tr, &pqpair->outstanding_tr, tq_list, temp) {
|
||||
if (!qpair->ctrlr->opts.disable_error_logging) {
|
||||
SPDK_ERRLOG("aborting outstanding command\n");
|
||||
}
|
||||
nvme_pcie_qpair_manual_complete_tracker(qpair, tr, SPDK_NVME_SCT_GENERIC,
|
||||
SPDK_NVME_SC_ABORTED_BY_REQUEST, dnr, true);
|
||||
|
||||
if (tr == last) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user