nvme/perf: Add option to set NVMe IO queue size

Some targets advertise large Maximum Queue Entries Supported (MQES)
value but fail to create long queues due to some other limitations,
e.g. lack of some resource. New '--io-queue-size' option allows to
workaround such issues. It may also be useful when researching queue
size impact on performance.

Signed-off-by: Evgeniy Kochetov <evgeniik@nvidia.com>
Change-Id: Ie13b966070fbe5d8bb75cee59ae171bd25eafa63
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9090
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Evgeniy Kochetov 2021-08-05 15:56:07 +03:00 committed by Jim Harris
parent e0ca35c4f6
commit b3ca1c70ee

View File

@ -272,6 +272,10 @@ static bool g_exit;
static uint32_t g_keep_alive_timeout_in_ms = 10000;
static uint32_t g_quiet_count = 1;
static double g_zipf_theta;
/* Set default io_queue_size to UINT16_MAX, NVMe driver will then reduce this
* to MQES to maximize the io_queue_size as much as possible.
*/
static uint32_t g_io_queue_size = UINT16_MAX;
/* When user specifies -Q, some error messages are rate limited. When rate
* limited, we only print the error message every g_quiet_count times the
@ -1793,6 +1797,7 @@ static void usage(char *program_name)
#endif
printf("\t[--transport-stats dump transport statistics]\n");
printf("\t[--iova-mode <mode> specify DPDK IOVA mode: va|pa]\n");
printf("\t[--io-queue-size <val> size of NVMe IO queue. Default: maximum allowed by controller]\n");
}
static void
@ -2286,6 +2291,8 @@ static const struct option g_perf_cmdline_opts[] = {
{"transport-stats", no_argument, NULL, PERF_TRANSPORT_STATISTICS},
#define PERF_IOVA_MODE 258
{"iova-mode", required_argument, NULL, PERF_IOVA_MODE},
#define PERF_IO_QUEUE_SIZE 259
{"io-queue-size", required_argument, NULL, PERF_IO_QUEUE_SIZE},
/* Should be the last element */
{0, 0, 0, 0}
};
@ -2314,6 +2321,7 @@ parse_args(int argc, char **argv, struct spdk_env_opts *env_opts)
case PERF_RW_MIXREAD:
case PERF_NUM_UNUSED_IO_QPAIRS:
case PERF_SKIP_ERRORS:
case PERF_IO_QUEUE_SIZE:
val = spdk_strtol(optarg, 10);
if (val < 0) {
fprintf(stderr, "Converting a string to integer failed\n");
@ -2370,6 +2378,9 @@ parse_args(int argc, char **argv, struct spdk_env_opts *env_opts)
}
g_io_align_specified = true;
break;
case PERF_IO_QUEUE_SIZE:
g_io_queue_size = val;
break;
}
break;
case PERF_ZIPF:
@ -2630,11 +2641,7 @@ probe_cb(void *cb_ctx, const struct spdk_nvme_transport_id *trid,
return false;
}
/* Set io_queue_size to UINT16_MAX, NVMe driver
* will then reduce this to MQES to maximize
* the io_queue_size as much as possible.
*/
opts->io_queue_size = UINT16_MAX;
opts->io_queue_size = g_io_queue_size;
/* Set the header and data_digest */
opts->header_digest = g_header_digest;