From 145485769e51775c1a02dec046b8e7f46618b409 Mon Sep 17 00:00:00 2001 From: Seth Howell Date: Tue, 5 Feb 2019 12:54:16 -0700 Subject: [PATCH] nvmf: remove qpair state activating. This intermediate state is unused and meaningless. the qpair transitions into this state right before calling a synchronous operation and then transitions to active as soon as that operation completes successfully. If the operation did not complete successfully, we were leaving qpairs in this weird intermediate state when for all intents and purposes they had reverted to an uninitialized state. Keeping qpairs in the uninitialized state until they have been added to a poll group creates a meaningful distinction between states that can be actionable from the transport level. Change-Id: I6de9bc424b393b6fff221aa2f4212aaa91488629 Signed-off-by: Seth Howell Reviewed-on: https://review.gerrithub.io/c/443471 Tested-by: SPDK CI Jenkins Reviewed-by: Jim Harris Reviewed-by: Ben Walker --- lib/nvmf/nvmf.c | 1 - lib/nvmf/nvmf_internal.h | 1 - lib/nvmf/rdma.c | 7 +++---- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/nvmf/nvmf.c b/lib/nvmf/nvmf.c index e24e96b19..eacff013e 100644 --- a/lib/nvmf/nvmf.c +++ b/lib/nvmf/nvmf.c @@ -652,7 +652,6 @@ spdk_nvmf_poll_group_add(struct spdk_nvmf_poll_group *group, TAILQ_INIT(&qpair->outstanding); qpair->group = group; - spdk_nvmf_qpair_set_state(qpair, SPDK_NVMF_QPAIR_ACTIVATING); TAILQ_FOREACH(tgroup, &group->tgroups, link) { if (tgroup->transport == qpair->transport) { diff --git a/lib/nvmf/nvmf_internal.h b/lib/nvmf/nvmf_internal.h index e279d6d29..c9d18c553 100644 --- a/lib/nvmf/nvmf_internal.h +++ b/lib/nvmf/nvmf_internal.h @@ -66,7 +66,6 @@ enum spdk_nvmf_subsystem_state { enum spdk_nvmf_qpair_state { SPDK_NVMF_QPAIR_UNINITIALIZED = 0, - SPDK_NVMF_QPAIR_ACTIVATING, SPDK_NVMF_QPAIR_ACTIVE, SPDK_NVMF_QPAIR_DEACTIVATING, SPDK_NVMF_QPAIR_ERROR, diff --git a/lib/nvmf/rdma.c b/lib/nvmf/rdma.c index 461d39b43..646afd82d 100644 --- a/lib/nvmf/rdma.c +++ b/lib/nvmf/rdma.c @@ -2698,10 +2698,9 @@ spdk_nvmf_rdma_close_qpair(struct spdk_nvmf_qpair *qpair) rqpair->disconnect_flags |= RDMA_QP_DISCONNECTING; /* This happens only when the qpair is disconnected before - * it is added to the poll group. SInce there is no poll group, - * we will never reap the I/O for this connection. This also - * means that we have not accepted the connection request yet, - * so we need to reject it. + * it is added to the poll group. Since there is no poll group, + * the RDMA qp has not been initialized yet and the RDMA CM + * event has not yet been acknowledged, so we need to reject it. */ if (rqpair->qpair.state == SPDK_NVMF_QPAIR_UNINITIALIZED) { spdk_nvmf_rdma_qpair_reject_connection(rqpair);