diff --git a/module/bdev/nvme/bdev_nvme.c b/module/bdev/nvme/bdev_nvme.c index dab3a4732..f75a67263 100644 --- a/module/bdev/nvme/bdev_nvme.c +++ b/module/bdev/nvme/bdev_nvme.c @@ -51,6 +51,8 @@ #include "spdk/bdev_module.h" #include "spdk_internal/log.h" +#define SPDK_BDEV_NVME_DEFAULT_DELAY_CMD_SUBMIT true + static void bdev_nvme_get_spdk_running_config(FILE *fp); static int bdev_nvme_config_json(struct spdk_json_write_ctx *w); @@ -102,6 +104,7 @@ static struct spdk_bdev_nvme_opts g_opts = { .nvme_adminq_poll_period_us = 1000000ULL, .nvme_ioq_poll_period_us = 0, .io_queue_requests = 0, + .delay_cmd_submit = SPDK_BDEV_NVME_DEFAULT_DELAY_CMD_SUBMIT, }; #define NVME_HOTPLUG_POLL_PERIOD_MAX 10000000ULL @@ -326,7 +329,7 @@ _bdev_nvme_reset_create_qpair(struct spdk_io_channel_iter *i) struct spdk_nvme_io_qpair_opts opts; spdk_nvme_ctrlr_get_default_io_qpair_opts(nvme_bdev_ctrlr->ctrlr, &opts, sizeof(opts)); - opts.delay_cmd_submit = true; + opts.delay_cmd_submit = g_opts.delay_cmd_submit; nvme_ch->qpair = spdk_nvme_ctrlr_alloc_io_qpair(nvme_bdev_ctrlr->ctrlr, &opts, sizeof(opts)); if (!nvme_ch->qpair) { @@ -608,7 +611,7 @@ bdev_nvme_create_cb(void *io_device, void *ctx_buf) #endif spdk_nvme_ctrlr_get_default_io_qpair_opts(nvme_bdev_ctrlr->ctrlr, &opts, sizeof(opts)); - opts.delay_cmd_submit = true; + opts.delay_cmd_submit = g_opts.delay_cmd_submit; opts.io_queue_requests = spdk_max(g_opts.io_queue_requests, opts.io_queue_requests); g_opts.io_queue_requests = opts.io_queue_requests; diff --git a/module/bdev/nvme/bdev_nvme.h b/module/bdev/nvme/bdev_nvme.h index 75d5ed9e5..e8f69b0e5 100644 --- a/module/bdev/nvme/bdev_nvme.h +++ b/module/bdev/nvme/bdev_nvme.h @@ -1,8 +1,8 @@ /*- * BSD LICENSE * - * Copyright (c) Intel Corporation. - * All rights reserved. + * Copyright (c) Intel Corporation. All rights reserved. + * Copyright (c) 2019 Mellanox Technologies LTD. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -59,6 +59,7 @@ struct spdk_bdev_nvme_opts { uint64_t nvme_adminq_poll_period_us; uint64_t nvme_ioq_poll_period_us; uint32_t io_queue_requests; + bool delay_cmd_submit; }; struct spdk_nvme_qpair *spdk_bdev_nvme_get_io_qpair(struct spdk_io_channel *ctrlr_io_ch);