From a4f96d93a8a40af62816f6af629d63eaa88dba09 Mon Sep 17 00:00:00 2001 From: Shuhei Matsumoto Date: Mon, 17 May 2021 13:43:20 +0900 Subject: [PATCH] nvme: Initialize ANA state to optimized if ANA reporting is not supported Initialize ANA state of each namespace to optimized regardless of whether ANA is supported or not. This will simplify the code to get the optimal I/O path because we do not have to care if the namespace supports ANA. Signed-off-by: Shuhei Matsumoto Change-Id: I24dfe08674af398671de6528b884e9d82409eeae Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7890 Reviewed-by: Aleksey Marchuk Reviewed-by: Ben Walker Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins --- lib/nvme/nvme_ctrlr.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/nvme/nvme_ctrlr.c b/lib/nvme/nvme_ctrlr.c index 68ea3a0720..dea7daa0a2 100644 --- a/lib/nvme/nvme_ctrlr.c +++ b/lib/nvme/nvme_ctrlr.c @@ -800,6 +800,12 @@ nvme_ctrlr_set_supported_log_pages(struct spdk_nvme_ctrlr *ctrlr) nvme_ctrlr_parse_ana_log_page(ctrlr, nvme_ctrlr_update_ns_ana_states, ctrlr); } + } else { + uint32_t i; + + for (i = 0; i < ctrlr->num_ns; i++) { + ctrlr->ns[i].ana_state = SPDK_NVME_ANA_OPTIMIZED_STATE; + } } out: