Commit 86c4d33f authored by Changpeng Liu's avatar Changpeng Liu Committed by Tomasz Zawadzki
Browse files

nvme: rename is_shutdown flag to is_destructed



The shutdown flag is only used when resubmitting the AER, and it will not
be updated when hot remove happened, so rename it to is_destructed.

Change-Id: Iafc27bd6cb23a851ed6c96470a2a45546a399c88
Signed-off-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1254


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
parent 4b23e3f2
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -766,7 +766,6 @@ nvme_ctrlr_shutdown(struct spdk_nvme_ctrlr *ctrlr)
		if (csts.bits.shst == SPDK_NVME_SHST_COMPLETE) {
			SPDK_DEBUGLOG(SPDK_LOG_NVME, "shutdown complete in %u milliseconds\n",
				      ms_waited);
			ctrlr->is_shutdown = true;
			return;
		}

@@ -1890,8 +1889,8 @@ nvme_ctrlr_async_event_cb(void *arg, const struct spdk_nvme_cpl *cpl)
		active_proc->aer_cb_fn(active_proc->aer_cb_arg, cpl);
	}

	/* If the ctrlr is already shutdown, we should not send aer again */
	if (ctrlr->is_shutdown) {
	/* If the ctrlr was removed or in the destruct state, we should not send aer again */
	if (ctrlr->is_removed || ctrlr->is_destructed) {
		return;
	}

@@ -2564,7 +2563,7 @@ nvme_ctrlr_construct(struct spdk_nvme_ctrlr *ctrlr)
	ctrlr->free_io_qids = NULL;
	ctrlr->is_resetting = false;
	ctrlr->is_failed = false;
	ctrlr->is_shutdown = false;
	ctrlr->is_destructed = false;

	TAILQ_INIT(&ctrlr->active_io_qpairs);
	STAILQ_INIT(&ctrlr->queued_aborts);
@@ -2617,6 +2616,8 @@ nvme_ctrlr_destruct(struct spdk_nvme_ctrlr *ctrlr)

	SPDK_DEBUGLOG(SPDK_LOG_NVME, "Prepare to destruct SSD: %s\n", ctrlr->trid.traddr);

	ctrlr->is_destructed = true;

	spdk_nvme_qpair_process_completions(ctrlr->adminq, 0);
	nvme_transport_admin_qpair_abort_aers(ctrlr->adminq);

+1 −1
Original line number Diff line number Diff line
@@ -638,7 +638,7 @@ struct spdk_nvme_ctrlr {

	bool				is_failed;

	bool				is_shutdown;
	bool				is_destructed;

	bool				timeout_enabled;