diff --git a/examples/nvme/perf/perf.c b/examples/nvme/perf/perf.c index e28778911..26e750749 100644 --- a/examples/nvme/perf/perf.c +++ b/examples/nvme/perf/perf.c @@ -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 specify DPDK IOVA mode: va|pa]\n"); + printf("\t[--io-queue-size 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;