nvme/perf: fix print message while not finding devices

Change-Id: Ie7282eb2e9f403ae51c449389216bcaf45808277
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/386190
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
Ziye Yang 2017-11-08 13:25:02 +08:00 committed by Daniel Verkamp
parent bc6540ad05
commit 8d716531a6

View File

@ -166,6 +166,7 @@ static int g_dpdk_mem;
static int g_shm_id = -1; static int g_shm_id = -1;
static uint32_t g_disable_sq_cmb; static uint32_t g_disable_sq_cmb;
static bool g_no_pci; static bool g_no_pci;
static bool g_warn;
static const char *g_core_mask; static const char *g_core_mask;
@ -195,6 +196,7 @@ register_ns(struct spdk_nvme_ctrlr *ctrlr, struct spdk_nvme_ns *ns)
printf("Controller %-20.20s (%-20.20s): Skipping inactive NS %u\n", printf("Controller %-20.20s (%-20.20s): Skipping inactive NS %u\n",
cdata->mn, cdata->sn, cdata->mn, cdata->sn,
spdk_nvme_ns_get_id(ns)); spdk_nvme_ns_get_id(ns));
g_warn = true;
return; return;
} }
@ -204,6 +206,7 @@ register_ns(struct spdk_nvme_ctrlr *ctrlr, struct spdk_nvme_ns *ns)
"ns size %" PRIu64 " / block size %u for I/O size %u\n", "ns size %" PRIu64 " / block size %u for I/O size %u\n",
cdata->mn, cdata->sn, spdk_nvme_ns_get_id(ns), cdata->mn, cdata->sn, spdk_nvme_ns_get_id(ns),
spdk_nvme_ns_get_size(ns), spdk_nvme_ns_get_sector_size(ns), g_io_size_bytes); spdk_nvme_ns_get_size(ns), spdk_nvme_ns_get_sector_size(ns), g_io_size_bytes);
g_warn = true;
return; return;
} }
@ -218,6 +221,7 @@ register_ns(struct spdk_nvme_ctrlr *ctrlr, struct spdk_nvme_ns *ns)
printf("WARNING: controller IO queue size %u less than required\n", printf("WARNING: controller IO queue size %u less than required\n",
opts.io_queue_size); opts.io_queue_size);
printf("You can try with smaller IO size or queue depth\n"); printf("You can try with smaller IO size or queue depth\n");
g_warn = true;
return; return;
} }
@ -1387,8 +1391,12 @@ int main(int argc, char **argv)
goto cleanup; goto cleanup;
} }
if (g_warn) {
printf("WARNING: Some requested NVMe devices were skipped\n");
}
if (g_num_namespaces == 0) { if (g_num_namespaces == 0) {
fprintf(stderr, "No NVMe controllers or AIO devices found.\n"); fprintf(stderr, "No valid NVMe controllers or AIO devices found\n");
return 0; return 0;
} }