From 87b7f286958cf32053bfe4cb39f215c6660951a0 Mon Sep 17 00:00:00 2001 From: Changpeng Liu Date: Thu, 1 Aug 2019 22:10:05 -0400 Subject: [PATCH] examples/nvme/perf: enable no_shn_notification option Users can use '-N' option to disable shutdown notification for faster shutdown process. Change-Id: I227dc4da3aa2f89d23f9b235e979cb6d3e25d635 Signed-off-by: Changpeng Liu Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/463950 Tested-by: SPDK CI Jenkins Reviewed-by: Jim Harris Reviewed-by: Ben Walker --- examples/nvme/perf/perf.c | 10 +++++++++- test/nvme/nvme.sh | 4 +++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/examples/nvme/perf/perf.c b/examples/nvme/perf/perf.c index 329b586ba..66f3825c4 100644 --- a/examples/nvme/perf/perf.c +++ b/examples/nvme/perf/perf.c @@ -185,6 +185,7 @@ static bool g_no_pci; static bool g_warn; static bool g_header_digest; static bool g_data_digest; +static bool g_no_shn_notification = false; static uint32_t g_keep_alive_timeout_in_ms = 0; static const char *g_core_mask; @@ -869,6 +870,7 @@ static void usage(char *program_name) printf("\t[-D disable submission queue in controller memory buffer, default: enabled]\n"); printf("\t[-H enable header digest for TCP transport, default: disabled]\n"); printf("\t[-I enable data digest for TCP transport, default: disabled]\n"); + printf("\t[-N no shutdown notification process for controllers, default: disabled]\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"); @@ -1308,7 +1310,7 @@ parse_args(int argc, char **argv) g_core_mask = NULL; g_max_completions = 0; - while ((op = getopt(argc, argv, "c:e:i:lm:n:o:q:r:k:s:t:w:DGHILM:U:V")) != -1) { + while ((op = getopt(argc, argv, "c:e:i:lm:n:o:q:r:k:s:t:w:DGHILM:NU:V")) != -1) { switch (op) { case 'i': case 'm': @@ -1403,6 +1405,9 @@ parse_args(int argc, char **argv) case 'L': g_latency_sw_tracking_level++; break; + case 'N': + g_no_shn_notification = true; + break; case 'V': g_vmd = true; break; @@ -1564,6 +1569,9 @@ probe_cb(void *cb_ctx, const struct spdk_nvme_transport_id *trid, if (g_disable_sq_cmb) { opts->use_cmb_sqs = false; } + if (g_no_shn_notification) { + opts->no_shn_notification = true; + } printf("Attaching to NVMe Controller at %s\n", trid->traddr); diff --git a/test/nvme/nvme.sh b/test/nvme/nvme.sh index f85782f48..e5a9bb617 100755 --- a/test/nvme/nvme.sh +++ b/test/nvme/nvme.sh @@ -104,7 +104,9 @@ done timing_exit identify timing_enter perf -$rootdir/examples/nvme/perf/perf -q 128 -w read -o 12288 -t 1 -LL -i 0 +#enable no shutdown notification option +$rootdir/examples/nvme/perf/perf -q 128 -w read -o 12288 -t 1 -LL -i 0 -N +$rootdir/examples/nvme/perf/perf -q 128 -w write -o 12288 -t 1 -LL -i 0 timing_exit perf timing_enter reserve