Commit 8be572ef authored by Changpeng Liu's avatar Changpeng Liu Committed by Daniel Verkamp
Browse files

nvmf: process the submission error code for NVMe I/O commands



Change-Id: I4e91ebea1b96f09bafa1fb23f2d9c5d9f79125af
Signed-off-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
parent e42e4e80
Loading
Loading
Loading
Loading
+18 −13
Original line number Diff line number Diff line
@@ -109,7 +109,7 @@ nvmf_process_io_cmd(struct nvmf_session *session,
				      lba_address, lba_count);
			spdk_trace_record(TRACE_NVMF_LIB_READ_START, 0, 0,
					  (uint64_t)req_state->fabric_rx_ctx, 0);
			spdk_nvme_ns_cmd_read(ns, qpair,
			rc = spdk_nvme_ns_cmd_read(ns, qpair,
						   buf, lba_address, lba_count,
						   nvmf_complete_cmd,
						   (void *)req_state, io_flags);
@@ -118,7 +118,7 @@ nvmf_process_io_cmd(struct nvmf_session *session,
				      lba_address, lba_count);
			spdk_trace_record(TRACE_NVMF_LIB_WRITE_START, 0, 0,
					  (uint64_t)req_state->fabric_rx_ctx, 0);
			spdk_nvme_ns_cmd_write(ns, qpair,
			rc = spdk_nvme_ns_cmd_write(ns, qpair,
						    buf, lba_address, lba_count,
						    nvmf_complete_cmd,
						    (void *)req_state, io_flags);
@@ -127,13 +127,18 @@ nvmf_process_io_cmd(struct nvmf_session *session,
	default:
		SPDK_TRACELOG(SPDK_TRACE_NVMF, "RAW Passthrough: I/O Opcode %x\n", cmd->opc);
		cmd->nsid = nsid;
		spdk_nvme_ctrlr_cmd_io_raw(ctrlr, qpair,
		rc = spdk_nvme_ctrlr_cmd_io_raw(ctrlr, qpair,
						cmd,
						buf, len,
						nvmf_complete_cmd,
						(void *)req_state);
		break;
	}

	if (rc) {
		SPDK_ERRLOG("nvmf_process_io_cmd: Failed to submit Opcode %x\n", cmd->opc);
		response->status.sc = SPDK_NVME_SC_INTERNAL_DEVICE_ERROR;
	}
	return rc;
}