Commit 7a06e801 authored by Daniel Verkamp's avatar Daniel Verkamp Committed by Jim Harris
Browse files

nvmf: report unsupported Get/Set feature IDs



Also return Invalid Field rather than Invalid Opcode to be more
accurate.  The spec doesn't seem to define any more specific error code
for this case.

Change-Id: I992c6cca3020ff80b8495c71170222bc75316800
Signed-off-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
parent 3c114224
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -293,8 +293,8 @@ nvmf_virtual_ctrlr_get_features(struct spdk_nvmf_request *req)
		response->cdw0 = session->async_event_config.raw;
		return SPDK_NVMF_REQUEST_EXEC_STATUS_COMPLETE;
	default:
		SPDK_ERRLOG("get features command with invalid code\n");
		response->status.sc = SPDK_NVME_SC_INVALID_OPCODE;
		SPDK_ERRLOG("Get Features command with unsupported feature ID 0x%02x\n", feature);
		response->status.sc = SPDK_NVME_SC_INVALID_FIELD;
		return SPDK_NVMF_REQUEST_EXEC_STATUS_COMPLETE;
	}
}
@@ -338,8 +338,8 @@ nvmf_virtual_ctrlr_set_features(struct spdk_nvmf_request *req)
		session->async_event_config.raw = cmd->cdw11;
		return SPDK_NVMF_REQUEST_EXEC_STATUS_COMPLETE;
	default:
		SPDK_ERRLOG("set features command with invalid code\n");
		response->status.sc = SPDK_NVME_SC_INVALID_OPCODE;
		SPDK_ERRLOG("Set Features command with unsupported feature ID 0x%02x\n", feature);
		response->status.sc = SPDK_NVME_SC_INVALID_FIELD;
		return SPDK_NVMF_REQUEST_EXEC_STATUS_COMPLETE;
	}
}