diff --git a/lib/nvmf/conn.c b/lib/nvmf/conn.c index 83990085e..ec9c76ba2 100644 --- a/lib/nvmf/conn.c +++ b/lib/nvmf/conn.c @@ -513,20 +513,6 @@ static int nvmf_recv(struct spdk_nvmf_conn *conn, struct ibv_wc *wc) SPDK_ERRLOG("Command execution failed\n"); goto recv_error; } - - if (ret == 1) { - /* - * Immediate completion. - * Re-post rx_desc and re-queue tx_desc here, - * there is not a delayed posting because of - * command processing. - */ - nvmf_deactive_tx_desc(tx_desc); - if (nvmf_post_rdma_recv(conn, rx_desc)) { - SPDK_ERRLOG("Unable to re-post aq rx descriptor\n"); - return -1; - } - } } drop_recv: diff --git a/lib/nvmf/request.c b/lib/nvmf/request.c index b4614295d..794cbbde4 100644 --- a/lib/nvmf/request.c +++ b/lib/nvmf/request.c @@ -150,13 +150,13 @@ nvmf_process_admin_cmd(struct nvmf_request *req) } nsdata = spdk_nvme_ns_get_data(ns); memcpy(req->data, (char *)nsdata, sizeof(struct spdk_nvme_ns_data)); - spdk_nvmf_request_complete(req); + rc = 1; } else if (cmd->cdw10 == 1) { /* identify controller */ SPDK_TRACELOG(SPDK_TRACE_NVMF, "Identify Controller\n"); /* pull from virtual controller context */ memcpy(req->data, (char *)&session->vcdata, sizeof(struct spdk_nvme_ctrlr_data)); - spdk_nvmf_request_complete(req); + rc = 1; } else { SPDK_TRACELOG(SPDK_TRACE_NVMF, "Identify Namespace List\n"); response->status.sc = SPDK_NVME_SC_INVALID_OPCODE; @@ -538,7 +538,8 @@ nvmf_process_fabrics_command(struct nvmf_request *req) default: SPDK_TRACELOG(SPDK_TRACE_DEBUG, "recv capsule header type invalid [%x]!\n", cap_hdr->fctype); - return 1; /* skip, do nothing */ + req->rsp->nvme_cpl.status.sc = SPDK_NVME_SC_INVALID_OPCODE; + return spdk_nvmf_request_complete(req); } }