From 814cd258820dbdb14d549e79ee6f68d3b3bc4b37 Mon Sep 17 00:00:00 2001 From: Changpeng Liu Date: Wed, 14 Jul 2021 16:58:49 +0800 Subject: [PATCH] nvmf: optimize log level for unsupported feature IDs and invalid property offset Since we are using NVMf fabric library to emulate a PCIe based SSD via vfio-user target, so there maybe some commands that are related with PCIe SSD only, such as set/get features with interrupt coalescing and Interrupt Mask Set/Interrupt Mask Clear registers. Even the NVMf library doesn't support that, it is not a fatal error to Host NVMe driver, so here we use the info log instead of error log for this case so that to avoid noise logs. Fix #2036. Change-Id: I8283bcde5779080835d6ab827dbd852b3816176f Signed-off-by: Changpeng Liu Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8766 Tested-by: SPDK CI Jenkins Reviewed-by: Reviewed-by: Ziye Yang Reviewed-by: Aleksey Marchuk Reviewed-by: Ben Walker Reviewed-by: Jim Harris Community-CI: Broadcom CI Community-CI: Mellanox Build Bot --- lib/nvmf/ctrlr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/nvmf/ctrlr.c b/lib/nvmf/ctrlr.c index 3abce3450..c26dbfb91 100644 --- a/lib/nvmf/ctrlr.c +++ b/lib/nvmf/ctrlr.c @@ -1287,7 +1287,7 @@ nvmf_property_set(struct spdk_nvmf_request *req) prop = find_prop(cmd->ofst, size); if (prop == NULL || prop->set_cb == NULL) { - SPDK_ERRLOG("Invalid offset 0x%x\n", cmd->ofst); + SPDK_INFOLOG(nvmf, "Invalid offset 0x%x\n", cmd->ofst); response->status.sct = SPDK_NVME_SCT_COMMAND_SPECIFIC; response->status.sc = SPDK_NVMF_FABRIC_SC_INVALID_PARAM; return SPDK_NVMF_REQUEST_EXEC_STATUS_COMPLETE; @@ -2918,7 +2918,7 @@ nvmf_ctrlr_set_features(struct spdk_nvmf_request *req) case SPDK_NVME_FEAT_HOST_BEHAVIOR_SUPPORT: return nvmf_ctrlr_set_features_host_behavior_support(req); default: - SPDK_ERRLOG("Set Features command with unsupported feature ID 0x%02x\n", feature); + SPDK_INFOLOG(nvmf, "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; }