test/aer: Complete requests before detaching.

The failed stack:
The calling processes:
	spdk_nvme_detach_async->nvme_ctrlr_detach_async->
	nvme_ctrlr_get_ref_count->nvme_ctrlr_proc_put_ref->
	nvme_ctrlr_remove_inactive_proc->nvme_ctrlr_get_current_process->
	nvme_ctrlr_remove_process

The proc->active_reqs list processing steps:
	spdk_nvme_ctrlr_process_admin_completions->
	spdk_nvme_qpair_process_completions->
	nvme_transport_qpair_process_completions->
	nvme_pcie_qpair_process_completions->
		*nvme_pcie_qpair_complete_tracker
		*nvme_pcie_qpair_insert_pending_admin_request
	and
		*nvme_pcie_qpair_complete_pending_admin_request
Issue assert:
	assert(STAILQ_EMPTY(&proc->active_reqs));
The assert means there are outstanding active requests in
proc->active_reqs list.

According the test app's coding style, it needs to foreach the dev and
complete the outstanding commands before spdk_nvme_detach_async
especially  it launched spdk_nvme_ctrlr_register_aer_callback .

Bring the aer tests back, to check it.

Fixes issue #2674.

Signed-off-by: yidong0635 <dongx.yi@intel.com>
Change-Id: Ic0d3946f8c8743155cf3067aea1c9b4676748d2f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14433
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
This commit is contained in:
yidong0635 2022-09-09 07:37:54 +08:00 committed by Tomasz Zawadzki
parent 4f8bf4c380
commit 1ad140676e
2 changed files with 6 additions and 3 deletions

View File

@ -702,6 +702,10 @@ main(int argc, char **argv)
spdk_nvme_ctrlr_register_aer_callback(dev->ctrlr, NULL, NULL);
}
foreach_dev(dev) {
spdk_nvme_ctrlr_process_admin_completions(dev->ctrlr);
}
foreach_dev(dev) {
spdk_nvme_detach_async(dev->ctrlr, &detach_ctx);
}

View File

@ -133,11 +133,10 @@ run_test "nvme_reserve" $testdir/reserve/reserve
run_test "nvme_err_injection" $testdir/err_injection/err_injection
run_test "nvme_overhead" $testdir/overhead/overhead -s 4096 -t 1 -H -i 0
run_test "nvme_arbitration" $SPDK_EXAMPLE_DIR/arbitration -t 3 -i 0
# Disabling AEN tests for now due to issue #2674
#run_test "nvme_single_aen" $testdir/aer/aer -T -i 0 -L log
run_test "nvme_single_aen" $testdir/aer/aer -T -i 0 -L log
if [ $(uname) != "FreeBSD" ]; then
#run_test "nvme_multi_aen" $testdir/aer/aer -m -T -i 0 -L log
run_test "nvme_multi_aen" $testdir/aer/aer -m -T -i 0 -L log
run_test "nvme_startup" $testdir/startup/startup -t 1000000
run_test "nvme_multi_secondary" nvme_multi_secondary
trap - SIGINT SIGTERM EXIT