nvme: destroy I/O queues before shutdown

The NVMe specification recommends destroying all I/O submission and
completion queues before setting CC.SHN.

Change-Id: Iad71dd3fe03d897858034f3ca6ee02e0c55cc2b0
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
Daniel Verkamp 2016-04-08 15:22:46 -07:00
parent 2f7d4bee02
commit 1f19be6515

View File

@ -993,6 +993,12 @@ nvme_ctrlr_destruct(struct spdk_nvme_ctrlr *ctrlr)
{
uint32_t i;
while (!TAILQ_EMPTY(&ctrlr->active_io_qpairs)) {
struct spdk_nvme_qpair *qpair = TAILQ_FIRST(&ctrlr->active_io_qpairs);
spdk_nvme_ctrlr_free_io_qpair(qpair);
}
nvme_ctrlr_shutdown(ctrlr);
nvme_ctrlr_destruct_namespaces(ctrlr);