nvmf/rdma: Pass a message to the owning thread on qpair disconnect

This was the only usage of spdk_nvmf_qpair_disconnect that
was not being called from the owning thread. Send a message
here so that spdk_nvmf_qpair_disconnect can be simplified
later.

Change-Id: Ic5fae4503a95f7183079a02544812a9fc5d4def5
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/424592
Reviewed-by: Seth Howell <seth.howell5141@gmail.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
This commit is contained in:
Ben Walker 2018-09-04 11:50:57 -07:00 committed by Jim Harris
parent 3f229f0e46
commit 8f5cd34671

View File

@ -961,6 +961,14 @@ nvmf_rdma_connect(struct spdk_nvmf_transport *transport, struct rdma_cm_event *e
return 0;
}
static void
_nvmf_rdma_disconnect(void *ctx)
{
struct spdk_nvmf_qpair *qpair = ctx;
spdk_nvmf_qpair_disconnect(qpair, NULL, NULL);
}
static int
nvmf_rdma_disconnect(struct rdma_cm_event *evt)
{
@ -982,7 +990,7 @@ nvmf_rdma_disconnect(struct rdma_cm_event *evt)
spdk_trace_record(TRACE_RDMA_QP_DISCONNECT, 0, 0, (uintptr_t)rqpair->cm_id, 0);
spdk_nvmf_rdma_update_ibv_state(rqpair);
spdk_nvmf_qpair_disconnect(qpair, NULL, NULL);
spdk_thread_send_msg(qpair->group->thread, _nvmf_rdma_disconnect, qpair);
return 0;
}