nvmf: Simplify qpair states
When we thought we could do error recovery we differentiated between inactive and erro states. However, that's not possible so collapse them back into one. Change-Id: I57622c400378f2d4c518efbc12fb52e665a9ba4c Signed-off-by: Ben Walker <benjamin.walker@intel.com> Reviewed-on: https://review.gerrithub.io/430627 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-by: Seth Howell <seth.howell5141@gmail.com>
This commit is contained in:
parent
50a438d3bc
commit
91b9b4b2a1
@ -700,7 +700,7 @@ spdk_nvmf_poll_group_add(struct spdk_nvmf_poll_group *group,
|
|||||||
if (rc == 0) {
|
if (rc == 0) {
|
||||||
spdk_nvmf_qpair_set_state(qpair, SPDK_NVMF_QPAIR_ACTIVE);
|
spdk_nvmf_qpair_set_state(qpair, SPDK_NVMF_QPAIR_ACTIVE);
|
||||||
} else {
|
} else {
|
||||||
spdk_nvmf_qpair_set_state(qpair, SPDK_NVMF_QPAIR_INACTIVE);
|
spdk_nvmf_qpair_set_state(qpair, SPDK_NVMF_QPAIR_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
@ -743,7 +743,7 @@ _spdk_nvmf_qpair_destroy(void *ctx, int status)
|
|||||||
struct spdk_nvmf_ctrlr *ctrlr = qpair->ctrlr;
|
struct spdk_nvmf_ctrlr *ctrlr = qpair->ctrlr;
|
||||||
|
|
||||||
assert(qpair->state == SPDK_NVMF_QPAIR_DEACTIVATING);
|
assert(qpair->state == SPDK_NVMF_QPAIR_DEACTIVATING);
|
||||||
spdk_nvmf_qpair_set_state(qpair, SPDK_NVMF_QPAIR_INACTIVE);
|
spdk_nvmf_qpair_set_state(qpair, SPDK_NVMF_QPAIR_ERROR);
|
||||||
qpair_ctx->qid = qpair->qid;
|
qpair_ctx->qid = qpair->qid;
|
||||||
|
|
||||||
TAILQ_REMOVE(&qpair->group->qpairs, qpair, link);
|
TAILQ_REMOVE(&qpair->group->qpairs, qpair, link);
|
||||||
@ -781,8 +781,7 @@ spdk_nvmf_qpair_disconnect(struct spdk_nvmf_qpair *qpair, nvmf_qpair_disconnect_
|
|||||||
/* The queue pair must be disconnected from the thread that owns it */
|
/* The queue pair must be disconnected from the thread that owns it */
|
||||||
assert(qpair->group->thread == spdk_get_thread());
|
assert(qpair->group->thread == spdk_get_thread());
|
||||||
|
|
||||||
if (qpair->state == SPDK_NVMF_QPAIR_DEACTIVATING ||
|
if (qpair->state != SPDK_NVMF_QPAIR_ACTIVE) {
|
||||||
qpair->state == SPDK_NVMF_QPAIR_INACTIVE) {
|
|
||||||
/* This can occur if the connection is killed by the target,
|
/* This can occur if the connection is killed by the target,
|
||||||
* which results in a notification that the connection
|
* which results in a notification that the connection
|
||||||
* died. Send a message to defer the processing of this
|
* died. Send a message to defer the processing of this
|
||||||
|
@ -59,7 +59,6 @@ enum spdk_nvmf_subsystem_state {
|
|||||||
|
|
||||||
enum spdk_nvmf_qpair_state {
|
enum spdk_nvmf_qpair_state {
|
||||||
SPDK_NVMF_QPAIR_UNINITIALIZED = 0,
|
SPDK_NVMF_QPAIR_UNINITIALIZED = 0,
|
||||||
SPDK_NVMF_QPAIR_INACTIVE,
|
|
||||||
SPDK_NVMF_QPAIR_ACTIVATING,
|
SPDK_NVMF_QPAIR_ACTIVATING,
|
||||||
SPDK_NVMF_QPAIR_ACTIVE,
|
SPDK_NVMF_QPAIR_ACTIVE,
|
||||||
SPDK_NVMF_QPAIR_DEACTIVATING,
|
SPDK_NVMF_QPAIR_DEACTIVATING,
|
||||||
|
Loading…
Reference in New Issue
Block a user