From fe408c97914059d4e08639e7dad9f97f5f6bfeff Mon Sep 17 00:00:00 2001 From: GangCao Date: Sun, 5 Nov 2017 20:50:06 -0500 Subject: [PATCH] example/identify: list the number of I/O queues This kind of information can be useful on related model of Intel SSDs. Change-Id: Iea8a8f48999ba36e2f6cbf33a892147262891b44 Signed-off-by: GangCao Reviewed-on: https://review.gerrithub.io/385805 Tested-by: SPDK Automated Test System Reviewed-by: Daniel Verkamp Reviewed-by: Ben Walker Reviewed-by: Jim Harris --- examples/nvme/identify/identify.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/examples/nvme/identify/identify.c b/examples/nvme/identify/identify.c index a5d6d0fd5..5a4db63b2 100644 --- a/examples/nvme/identify/identify.c +++ b/examples/nvme/identify/identify.c @@ -172,6 +172,7 @@ get_features(struct spdk_nvme_ctrlr *ctrlr) SPDK_NVME_FEAT_POWER_MANAGEMENT, SPDK_NVME_FEAT_TEMPERATURE_THRESHOLD, SPDK_NVME_FEAT_ERROR_RECOVERY, + SPDK_NVME_FEAT_NUMBER_OF_QUEUES, }; /* Submit several GET FEATURES commands and wait for them to complete */ @@ -893,6 +894,16 @@ print_controller(struct spdk_nvme_ctrlr *ctrlr, const struct spdk_nvme_transport printf("\n"); } + if (features[SPDK_NVME_FEAT_NUMBER_OF_QUEUES].valid) { + uint32_t result = features[SPDK_NVME_FEAT_NUMBER_OF_QUEUES].result; + + printf("Number of Queues\n"); + printf("================\n"); + printf("Number of I/O Submission Queues: %u\n", (result & 0xFFFF) + 1); + printf("Number of I/O Completion Queues: %u\n", (result & 0xFFFF0000 >> 16) + 1); + printf("\n"); + } + if (cdata->hctma.bits.supported) { printf("Host Controlled Thermal Management\n"); printf("==================================\n");