nvmf: only process fabric commands when transport is fabric type

Fixes issue #2218.

Change-Id: I9298e4a8d16e7ddda7366aebc63b46c36ab54234
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10061
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Changpeng Liu 2021-10-29 22:08:12 +08:00
parent 46b355c0ef
commit 8f11535d70

View File

@ -4132,6 +4132,7 @@ void
spdk_nvmf_request_exec(struct spdk_nvmf_request *req)
{
struct spdk_nvmf_qpair *qpair = req->qpair;
struct spdk_nvmf_transport *transport = qpair->transport;
enum spdk_nvmf_request_exec_status status;
if (!spdk_nvmf_using_zcopy(req->zcopy_phase)) {
@ -4147,7 +4148,8 @@ spdk_nvmf_request_exec(struct spdk_nvmf_request *req)
/* Place the request on the outstanding list so we can keep track of it */
nvmf_add_to_outstanding_queue(req);
if (spdk_unlikely(req->cmd->nvmf_cmd.opcode == SPDK_NVME_OPC_FABRIC)) {
if (spdk_unlikely((req->cmd->nvmf_cmd.opcode == SPDK_NVME_OPC_FABRIC) &&
spdk_nvme_trtype_is_fabrics(transport->ops->type))) {
status = nvmf_ctrlr_process_fabrics_cmd(req);
} else if (spdk_unlikely(nvmf_qpair_is_admin_queue(qpair))) {
status = nvmf_ctrlr_process_admin_cmd(req);