From 7a06e801436114e30f859312d4a7eaf02ee0af66 Mon Sep 17 00:00:00 2001 From: Daniel Verkamp Date: Tue, 22 Nov 2016 14:49:49 -0700 Subject: [PATCH] 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: Daniel Verkamp --- lib/nvmf/virtual.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/nvmf/virtual.c b/lib/nvmf/virtual.c index 45919a7da..aacccfff9 100644 --- a/lib/nvmf/virtual.c +++ b/lib/nvmf/virtual.c @@ -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; } }