nvme: Abort outstanding commands when qpair is deleted

These commands should be treated as aborted by spec,
so correctly deliver abort notifications when a
qpair is deleted.

Change-Id: I8af47a3f42f5695ef8e1a70813662e69102720b2
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/364681
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
Ben Walker 2017-06-08 11:35:12 -07:00
parent 6eab3a0db1
commit 89ad3f3d6b
2 changed files with 9 additions and 3 deletions

View File

@ -640,9 +640,9 @@ spdk_bdev_channel_destroy(void *io_device, void *ctx_buf)
_spdk_bdev_abort_io(&mgmt_channel->need_buf_small, ch);
_spdk_bdev_abort_io(&mgmt_channel->need_buf_large, ch);
assert(ch->io_outstanding == 0);
spdk_put_io_channel(ch->channel);
spdk_put_io_channel(ch->mgmt_channel);
assert(ch->io_outstanding == 0);
}
struct spdk_io_channel *

View File

@ -1461,8 +1461,7 @@ nvme_pcie_ctrlr_delete_io_qpair(struct spdk_nvme_ctrlr *ctrlr, struct spdk_nvme_
goto free;
}
/* Delete the I/O submission queue and then the completion queue */
/* Delete the I/O submission queue */
status.done = false;
rc = nvme_pcie_ctrlr_cmd_delete_io_sq(ctrlr, qpair, nvme_completion_poll_cb, &status);
if (rc != 0) {
@ -1475,6 +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);
/* Abort the rest of the I/O */
nvme_pcie_qpair_abort_trackers(qpair, 1);
/* Delete the completion queue */
status.done = false;
rc = nvme_pcie_ctrlr_cmd_delete_io_cq(ctrlr, qpair, nvme_completion_poll_cb, &status);
if (rc != 0) {