Commit 5c45cee2 authored by Konrad Sztyber's avatar Konrad Sztyber Committed by Jim Harris
Browse files

nvmf/auth: add nvmf_auth_qpair_cleanup()



This function is supposed to release resources after authentication
transaction is completed.  For now, this only involves unregistering
timeout poller, but more things will be added in the next patch.

Signed-off-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I2e168cbb869c98d239e3265a3f1b31d890061083
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/22758


Reviewed-by: default avatarJim Harris <jim.harris@samsung.com>
Reviewed-by: default avatarSeung yeon Shin <syeon.shin@samsung.com>
Community-CI: Mellanox Build Bot
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarBen Walker <ben@nvidia.com>
parent 519ecd61
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -151,6 +151,12 @@ nvmf_auth_rearm_poller(struct spdk_nvmf_qpair *qpair)
	return 0;
}

static void
nvmf_auth_qpair_cleanup(struct spdk_nvmf_qpair_auth *auth)
{
	spdk_poller_unregister(&auth->poller);
}

static int
nvmf_auth_check_command(struct spdk_nvmf_request *req, uint8_t secp,
			uint8_t spsp0, uint8_t spsp1, uint32_t len)
@@ -562,7 +568,7 @@ nvmf_auth_recv_success1(struct spdk_nvmf_request *req)
	nvmf_auth_recv_complete(req, sizeof(*success));
	nvmf_qpair_set_state(qpair, SPDK_NVMF_QPAIR_ENABLED);
	nvmf_auth_set_state(qpair, NVMF_QPAIR_AUTH_COMPLETED);
	spdk_poller_unregister(&auth->poller);
	nvmf_auth_qpair_cleanup(auth);

	return 0;
}
@@ -668,7 +674,7 @@ nvmf_qpair_auth_destroy(struct spdk_nvmf_qpair *qpair)
	struct spdk_nvmf_qpair_auth *auth = qpair->auth;

	if (auth != NULL) {
		spdk_poller_unregister(&auth->poller);
		nvmf_auth_qpair_cleanup(auth);
		free(qpair->auth);
		qpair->auth = NULL;
	}