nvme/perf: Add keep alive timeout option

Change-Id: I5f2db53cb3360428d9c9c10d7c9fe8566919ee69
Signed-off-by: JinYu <jin.yu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/441992
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
JinYu 2019-01-25 19:21:53 +08:00 committed by Jim Harris
parent 36e8c20fe9
commit c3da46d5f3

View File

@ -44,6 +44,7 @@
#include "spdk/histogram_data.h" #include "spdk/histogram_data.h"
#include "spdk/endian.h" #include "spdk/endian.h"
#include "spdk/dif.h" #include "spdk/dif.h"
#include "spdk/util.h"
#if HAVE_LIBAIO #if HAVE_LIBAIO
#include <libaio.h> #include <libaio.h>
@ -205,6 +206,7 @@ static bool g_no_pci;
static bool g_warn; static bool g_warn;
static bool g_header_digest; static bool g_header_digest;
static bool g_data_digest; static bool g_data_digest;
static uint32_t g_keep_alive_timeout_in_ms = 0;
static const char *g_core_mask; static const char *g_core_mask;
@ -1027,6 +1029,7 @@ static void usage(char *program_name)
printf("\t PRCHK Control of Protection Information Checking (PRCHK=GUARD|REFTAG|APPTAG)\n"); printf("\t PRCHK Control of Protection Information Checking (PRCHK=GUARD|REFTAG|APPTAG)\n");
printf("\t Example: -e 'PRACT=0,PRCHK=GUARD|REFTAG|APPTAG'\n"); printf("\t Example: -e 'PRACT=0,PRCHK=GUARD|REFTAG|APPTAG'\n");
printf("\t -e 'PRACT=1,PRCHK=GUARD'\n"); printf("\t -e 'PRACT=1,PRCHK=GUARD'\n");
printf("\t[-k keep alive timeout period in millisecond]\n");
printf("\t[-s DPDK huge memory size in MB.]\n"); printf("\t[-s DPDK huge memory size in MB.]\n");
printf("\t[-m max completions per poll]\n"); printf("\t[-m max completions per poll]\n");
printf("\t\t(default: 0 - unlimited)\n"); printf("\t\t(default: 0 - unlimited)\n");
@ -1431,12 +1434,13 @@ parse_args(int argc, char **argv)
g_core_mask = NULL; g_core_mask = NULL;
g_max_completions = 0; g_max_completions = 0;
while ((op = getopt(argc, argv, "c:e:i:lm:o:q:r:s:t:w:DHILM:")) != -1) { while ((op = getopt(argc, argv, "c:e:i:lm:o:q:r:k:s:t:w:DHILM:")) != -1) {
switch (op) { switch (op) {
case 'i': case 'i':
case 'm': case 'm':
case 'o': case 'o':
case 'q': case 'q':
case 'k':
case 's': case 's':
case 't': case 't':
case 'M': case 'M':
@ -1458,6 +1462,9 @@ parse_args(int argc, char **argv)
case 'q': case 'q':
g_queue_depth = val; g_queue_depth = val;
break; break;
case 'k':
g_keep_alive_timeout_in_ms = val;
break;
case 's': case 's':
g_dpdk_mem = val; g_dpdk_mem = val;
break; break;
@ -1670,6 +1677,8 @@ probe_cb(void *cb_ctx, const struct spdk_nvme_transport_id *trid,
/* Set the header and data_digest */ /* Set the header and data_digest */
opts->header_digest = g_header_digest; opts->header_digest = g_header_digest;
opts->data_digest = g_data_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);
return true; return true;
} }