nvme: no need to send abort notification for died application

Change-Id: I7005159b2c4cc71c249cfdc4adbf8500f006fb1c
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/365646
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
GangCao 2017-06-15 02:02:54 -04:00 committed by Jim Harris
parent c5a93f3519
commit 619ab1a700
5 changed files with 17 additions and 5 deletions

View File

@ -986,6 +986,9 @@ nvme_ctrlr_cleanup_process(struct spdk_nvme_ctrlr_process *proc)
* qpairs to be deleted.
*/
qpair->in_completion_context = 0;
qpair->no_deletion_notification_needed = 1;
spdk_nvme_ctrlr_free_io_qpair(qpair);
}

View File

@ -262,6 +262,12 @@ struct spdk_nvme_qpair {
uint8_t in_completion_context : 1;
uint8_t delete_after_completion_context: 1;
/*
* Set when no deletion notification is needed. For example, the process
* which allocated this qpair exited unexpectedly.
*/
uint8_t no_deletion_notification_needed: 1;
struct spdk_nvme_ctrlr *ctrlr;
/* List entry for spdk_nvme_ctrlr::active_io_qpairs */

View File

@ -1474,11 +1474,13 @@ nvme_pcie_ctrlr_delete_io_qpair(struct spdk_nvme_ctrlr *ctrlr, struct spdk_nvme_
return -1;
}
/* Complete any I/O in the completion queue */
nvme_pcie_qpair_process_completions(qpair, 0);
if (qpair->no_deletion_notification_needed == 0) {
/* Complete any I/O in the completion queue */
nvme_pcie_qpair_process_completions(qpair, 0);
/* Abort the rest of the I/O */
nvme_pcie_qpair_abort_trackers(qpair, 1);
/* Abort the rest of the I/O */
nvme_pcie_qpair_abort_trackers(qpair, 1);
}
/* Delete the completion queue */
status.done = false;

View File

@ -392,6 +392,7 @@ nvme_qpair_init(struct spdk_nvme_qpair *qpair, uint16_t id,
qpair->in_completion_context = 0;
qpair->delete_after_completion_context = 0;
qpair->no_deletion_notification_needed = 0;
qpair->ctrlr = ctrlr;
qpair->trtype = ctrlr->trid.trtype;

View File

@ -88,7 +88,7 @@ if [ $(uname -s) = Linux ] && [ $SPDK_TEST_NVME_MULTIPROCESS -eq 1 ]; then
kill -9 $!
count=0
while [ $count -le 2 ]; do
$rootdir/examples/nvme/perf/perf -i 0 -q 1 -w read -s 4096 -t 1 -c 0xf0
$rootdir/examples/nvme/perf/perf -i 0 -q 1 -w read -s 4096 -t 1 -c 0xf
count=$(($count + 1))
done
count=0