Spdk/test/app
Changpeng Liu bad2c8e86c nvme: detach the controller in STUB and flush the admin active requests at last
In the autotest, when calling kill_stub() function, there is error log
like this: "Device 0000:83:00.0 is still attached at shutdown!", so it's
better to detach the controller when exit the stub process.

But after call spdk_nvme_detach() in the stub process, there is another issue:
1. NVMe stub running as the primary process, and it will send 4 AERs.
2. Using NVMe reset tool as the secondary process.

When doing NVMe reset from the secondary process, it will abort all the
outstanding requests, so for the 4 AERs from the primary process, the 4
requests will be added to the active_proc->active_reqs list.

When calling spdk_nvme_detach() to detach a controller, there is a
assertion in the nvme_ctrlr_free_processes() at last to check the
active requests list of this active process data structure.

We can add a check before destructing the controller to poll the
completion queue, so that the active requests list can be flushed.

Change-Id: I0c473e935333a28d16f4c9fb443341fc47c5c24f
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/977
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>
2020-02-26 09:26:09 +00:00
..
bdev_svc global: rename copy to accel 2020-02-18 08:05:34 +00:00
fuzz doc: Fix Markdown MD032 linter warnings 2020-02-06 09:46:06 +00:00
histogram_perf build: move app rules to spdk.app.mk 2018-12-12 22:35:21 +00:00
jsoncat util: add a new file operation API 2019-05-15 18:54:27 +00:00
match test/match: do not ignore all input when passing \n 2020-02-04 20:08:02 +00:00
stub nvme: detach the controller in STUB and flush the admin active requests at last 2020-02-26 09:26:09 +00:00
Makefile test/nvmf: add application for target fuzz testing. 2019-07-08 09:18:19 +00:00