Commit 89ad3f3d authored by Ben Walker's avatar Ben Walker
Browse files

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: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/364681


Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
parent 6eab3a0d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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 *
+8 −2
Original line number Diff line number Diff line
@@ -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) {