examples/nvme/perf: Optional VMD enumeration

New flag -V was added for VMD enabling.

Change-Id: Ie0feae1bdfce39ad246f57411d00587c6417d21d
Signed-off-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/450926
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
Wojciech Malikowski 2019-04-11 10:24:55 -04:00 committed by Darek Stojaczyk
parent 46523f33e0
commit 9d92b9d420
2 changed files with 14 additions and 2 deletions

View File

@ -38,6 +38,7 @@
#include "spdk/env.h"
#include "spdk/fd.h"
#include "spdk/nvme.h"
#include "spdk/vmd.h"
#include "spdk/queue.h"
#include "spdk/string.h"
#include "spdk/nvme_intel.h"
@ -186,6 +187,8 @@ static int g_outstanding_commands;
static bool g_latency_ssd_tracking_enable = false;
static int g_latency_sw_tracking_level = 0;
static bool g_vmd = false;
static struct ctrlr_entry *g_controllers = NULL;
static int g_controllers_found = 0;
static struct ns_entry *g_namespaces = NULL;
@ -1113,6 +1116,7 @@ static void usage(char *program_name)
printf("\t[-m max completions per poll]\n");
printf("\t\t(default: 0 - unlimited)\n");
printf("\t[-i shared memory group ID]\n");
printf("\t[-V enable VMD enumeration]\n");
#ifdef DEBUG
printf("\t[-G enable debug logging]\n");
#else
@ -1530,7 +1534,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:")) != -1) {
while ((op = getopt(argc, argv, "c:e:i:lm:n:o:q:r:k:s:t:w:DGHILM:U:V")) != -1) {
switch (op) {
case 'i':
case 'm':
@ -1625,6 +1629,9 @@ parse_args(int argc, char **argv)
case 'L':
g_latency_sw_tracking_level++;
break;
case 'V':
g_vmd = true;
break;
default:
usage(argv[0]);
return 1;
@ -1844,6 +1851,11 @@ register_controllers(void)
printf("Initializing NVMe Controllers\n");
if (g_vmd && spdk_vmd_init()) {
fprintf(stderr, "Failed to initialize VMD."
" Some NVMe devices can be unavailable.\n");
}
TAILQ_FOREACH(trid_entry, &g_trid_list, tailq) {
if (spdk_nvme_probe(&trid_entry->trid, trid_entry, probe_cb, attach_cb, NULL) != 0) {
fprintf(stderr, "spdk_nvme_probe() failed for transport address '%s'\n",

View File

@ -39,7 +39,7 @@ include $(SPDK_ROOT_DIR)/mk/spdk.modules.mk
C_SRCS = $(APP:%=%.c)
SPDK_LIB_LIST = $(SOCK_MODULES_LIST)
SPDK_LIB_LIST += nvme thread util log sock
SPDK_LIB_LIST += nvme thread util log sock vmd
ifeq ($(CONFIG_RDMA),y)
SYS_LIBS += -libverbs -lrdmacm