nvme: enable CMB for submission queue by default

Also provide an option in perf tool let users to
disable it.

Change-Id: If4952513d77cecaa4f9403fbea811d86916ee87c
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/363311
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
Changpeng Liu 2017-06-03 09:49:47 +08:00 committed by Ben Walker
parent ce8de311a4
commit b6a9493bb1
3 changed files with 12 additions and 3 deletions

View File

@ -199,6 +199,7 @@ static int g_time_in_sec;
static uint32_t g_max_completions;
static int g_dpdk_mem;
static int g_shm_id = -1;
static uint32_t g_disable_sq_cmb;
static const char *g_core_mask;
@ -774,6 +775,7 @@ static void usage(char *program_name)
printf("\t[-t time in seconds]\n");
printf("\t[-c core mask for I/O submission/completion.]\n");
printf("\t\t(default: 1)]\n");
printf("\t[-D disable submission queue in controller memory buffer, default: enabled]\n");
printf("\t[-r Transport ID for local PCIe NVMe or NVMeoF]\n");
printf("\t Format: 'key:value [key:value] ...'\n");
printf("\t Keys:\n");
@ -1053,7 +1055,7 @@ parse_args(int argc, char **argv)
g_core_mask = NULL;
g_max_completions = 0;
while ((op = getopt(argc, argv, "c:d:i:lm:q:r:s:t:w:LM:")) != -1) {
while ((op = getopt(argc, argv, "c:d:i:lm:q:r:s:t:w:DLM:")) != -1) {
switch (op) {
case 'c':
g_core_mask = optarg;
@ -1095,6 +1097,9 @@ parse_args(int argc, char **argv)
g_rw_percentage = atoi(optarg);
mix_specified = true;
break;
case 'D':
g_disable_sq_cmb = 1;
break;
default:
usage(argv[0]);
return 1;
@ -1246,6 +1251,10 @@ probe_cb(void *cb_ctx, const struct spdk_nvme_transport_id *trid,
return false;
}
if (g_disable_sq_cmb) {
opts->use_cmb_sqs = false;
}
pci_id = spdk_pci_device_get_id(pci_dev);
printf("Attaching to NVMe Controller at %s [%04x:%04x]\n",

View File

@ -79,7 +79,7 @@ void
spdk_nvme_ctrlr_opts_set_defaults(struct spdk_nvme_ctrlr_opts *opts)
{
opts->num_io_queues = DEFAULT_MAX_IO_QUEUES;
opts->use_cmb_sqs = false;
opts->use_cmb_sqs = true;
opts->arb_mechanism = SPDK_NVME_CC_AMS_RR;
opts->keep_alive_timeout_ms = 10 * 1000;
opts->io_queue_size = DEFAULT_IO_QUEUE_SIZE;

View File

@ -1316,7 +1316,7 @@ test_ctrlr_opts_set_defaults(void)
spdk_nvme_ctrlr_opts_set_defaults(&opts);
CU_ASSERT_EQUAL(opts.num_io_queues, DEFAULT_MAX_IO_QUEUES);
CU_ASSERT_FALSE(opts.use_cmb_sqs);
CU_ASSERT_TRUE(opts.use_cmb_sqs);
CU_ASSERT_EQUAL(opts.arb_mechanism, SPDK_NVME_CC_AMS_RR);
CU_ASSERT_EQUAL(opts.keep_alive_timeout_ms, 10 * 1000);
CU_ASSERT_EQUAL(opts.io_queue_size, DEFAULT_IO_QUEUE_SIZE);