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: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.gerrithub.io/c/440242
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
Ziye Yang 2019-01-14 21:47:51 +08:00 committed by Jim Harris
parent 554aaffe3b
commit a13a359ebe

View File

@ -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);
}
}