From b35dfa2bd2307bba92867f96b4bbfab4497d9b39 Mon Sep 17 00:00:00 2001 From: Seth Howell Date: Fri, 1 Nov 2019 14:54:29 -0700 Subject: [PATCH] nvme/perf: Make it possible to disable keep alive. There was an assignment in perf that prevented the user from actually disabling keep_alive. If the user specified 0, it would get overridden by the default opts value. So set the global in perf to a reasonable value, and always use that value when setting the keep alive timeout. Change-Id: I2eba14525613d679d7def29cc9ed312851cae156 Signed-off-by: Seth Howell Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/473059 Tested-by: SPDK CI Jenkins Reviewed-by: Shuhei Matsumoto Reviewed-by: Ben Walker Reviewed-by: Jim Harris --- examples/nvme/perf/perf.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/nvme/perf/perf.c b/examples/nvme/perf/perf.c index c05e870b9..2d4ee623e 100644 --- a/examples/nvme/perf/perf.c +++ b/examples/nvme/perf/perf.c @@ -220,7 +220,8 @@ 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; +/* Default to 10 seconds for the keep alive value. This value is arbitrary. */ +static uint32_t g_keep_alive_timeout_in_ms = 10000; static const char *g_core_mask; @@ -1871,8 +1872,7 @@ probe_cb(void *cb_ctx, const struct spdk_nvme_transport_id *trid, /* Set the header and data_digest */ opts->header_digest = g_header_digest; opts->data_digest = g_data_digest; - opts->keep_alive_timeout_ms = spdk_max(opts->keep_alive_timeout_ms, - g_keep_alive_timeout_in_ms); + opts->keep_alive_timeout_ms = g_keep_alive_timeout_in_ms; return true; }