Commit 49ea3cb0 authored by Jacek Kalwas's avatar Jacek Kalwas Committed by Tomasz Zawadzki
Browse files

nvme/auth: break state machine early on initial poll



Callers of nvme_fabric_qpair_authenticate_async might not expect
authentication to be already completed when the function returns
control.

Both TCP and RDMA transports set the AUTHENTICATING state afterwards
and invoke nvme_fabric_qpair_authenticate_poll once more to eventually
set the RUNNING/CONNECTED state, which looks suspicious in the logs.

Calling the authenticate poll after authentication is complete can be
error prone (currently it is not an issue because of the
fabric_poll_status check in the DONE state). Given that, this patch
should be considered an improvement rather than a bug fix.

Change-Id: Ib9e0bd9ca577504401ae41a8a4d4414cec747d30
Signed-off-by: default avatarJacek Kalwas <jacek.kalwas@nutanix.com>
Reviewed-on: https://review.spdk.io/c/spdk/spdk/+/26802


Reviewed-by: default avatarKonrad Sztyber <ksztyber@nvidia.com>
Tested-by: default avatarSPDK Automated Test System <spdkbot@gmail.com>
Reviewed-by: default avatarBen Walker <ben@nvidia.com>
Community-CI: Mellanox Build Bot
parent ce301940
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -1099,7 +1099,9 @@ nvme_fabric_qpair_authenticate_poll(struct spdk_nvme_qpair *qpair)
				break;
			}
			nvme_auth_set_state(qpair, NVME_QPAIR_AUTH_STATE_AWAIT_NEGOTIATE);
			break;
			/* Intentionally return here to prevent the state machine entering the DONE
			 * state on the initial kick from nvme_fabric_qpair_authenticate_async. */
			return -EAGAIN;
		case NVME_QPAIR_AUTH_STATE_AWAIT_NEGOTIATE:
			rc = nvme_wait_for_completion_poll(qpair, status);
			if (rc != 0) {