Commit a13a359e authored by Ziye Yang's avatar Ziye Yang Committed by Jim Harris
Browse files

nvmf/tcp: fix the qpair disconnect handling.



Due to qpair timeout handling refactoring,
we removed the qpair destroying related code.

And this patch is submitted to address this issue. With
this patch, we can detect sock close of the fd from
the initiator, and correctly free the qpair related resource
(e.g., pid) managed by nvmf layer.

Otherwise, the initatior thinks the qpair related source is
freed, however it is not freed in the target side.

Change-Id: Ia2de07bd849fa5d3bc0e0e0d4941464dfd16d266
Signed-off-by: default avatarZiye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.gerrithub.io/c/440242


Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent 554aaffe
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -2642,8 +2642,10 @@ spdk_nvmf_tcp_sock_cb(void *arg, struct spdk_sock_group *group, struct spdk_sock
	spdk_nvmf_tcp_qpair_process_pending(ttransport, tqpair);
	rc = spdk_nvmf_tcp_sock_process(tqpair);
	if (rc < 0) {
		tqpair->state = NVME_TCP_QPAIR_STATE_EXITING;
		tqpair->state = NVME_TCP_QPAIR_STATE_EXITED;
		spdk_nvmf_tcp_qpair_flush_pdus(tqpair);
		SPDK_DEBUGLOG(SPDK_LOG_NVMF_TCP, "will disconect the tqpair=%p\n", tqpair);
		spdk_nvmf_qpair_disconnect(&tqpair->qpair, NULL, NULL);
	}
}