nvmf: Simplify spdk_nvmf_qpair_disconnect

Asking which thread we're currently on is more expensive
than sending a message.

Change-Id: I9d9007c9f7f30e4cdd9a97de6bf7a10b0e2a0594
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/420933
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
This commit is contained in:
Ben Walker 2018-07-31 14:28:01 -07:00 committed by Jim Harris
parent 62209642ce
commit 6779479067

View File

@ -767,12 +767,8 @@ spdk_nvmf_qpair_disconnect(struct spdk_nvmf_qpair *qpair, nvmf_qpair_disconnect_
qpair_ctx->cb_fn = cb_fn;
qpair_ctx->thread = qpair->group->thread;
qpair_ctx->ctx = ctx;
if (qpair->group->thread == spdk_get_thread()) {
_spdk_nvmf_qpair_deactivate(qpair_ctx);
} else {
/* Send a message to the thread that owns this qpair */
spdk_thread_send_msg(qpair->group->thread, _spdk_nvmf_qpair_deactivate, qpair_ctx);
}
/* Send a message to the thread that owns this qpair */
spdk_thread_send_msg(qpair->group->thread, _spdk_nvmf_qpair_deactivate, qpair_ctx);
return 0;
}