From 64fc291291c6a04d8fd67f88585c1c181ea56e3e Mon Sep 17 00:00:00 2001 From: John Kariuki Date: Wed, 23 Nov 2016 07:57:16 -0700 Subject: [PATCH] nvmf_tgt: add socket ID to NUMA warning message Added the socket ID to the NVMe over fabrics target warning messages. This will help during troubleshooting to check that the NVMe device, Subsystem and NIC are on the same NUMA node Change-Id: Id750a5a7694c898bb61ea26089ea3098611d530a Signed-off-by: John Kariuki --- app/nvmf_tgt/conf.c | 15 +++++++++++---- app/nvmf_tgt/nvmf_tgt.c | 6 ++++-- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/app/nvmf_tgt/conf.c b/app/nvmf_tgt/conf.c index b3ea4c987..2cab9d6fa 100644 --- a/app/nvmf_tgt/conf.c +++ b/app/nvmf_tgt/conf.c @@ -379,10 +379,14 @@ attach_cb(void *cb_ctx, const struct spdk_nvme_probe_info *probe_info, if (numa_node >= 0) { /* Running subsystem and NVMe device is on the same socket or not */ if (rte_lcore_to_socket_id(ctx->app_subsystem->lcore) != (unsigned)numa_node) { - SPDK_WARNLOG("Subsystem %s is configured to run on a CPU core belonging " + SPDK_WARNLOG("Subsystem %s is configured to run on a CPU core %u belonging " "to a different NUMA node than the associated NVMe device. " "This may result in reduced performance.\n", - spdk_nvmf_subsystem_get_nqn(ctx->app_subsystem->subsystem)); + spdk_nvmf_subsystem_get_nqn(ctx->app_subsystem->subsystem), + ctx->app_subsystem->lcore); + SPDK_WARNLOG("The NVMe device is on socket %u\n", numa_node); + SPDK_WARNLOG("The Subsystem is on socket %u\n", + rte_lcore_to_socket_id(ctx->app_subsystem->lcore)); } } @@ -501,10 +505,13 @@ spdk_nvmf_parse_subsystem(struct spdk_conf_section *sp) numa_node = spdk_get_ifaddr_numa_node(traddr); if (numa_node >= 0) { if (rte_lcore_to_socket_id(app_subsys->lcore) != (unsigned)numa_node) { - SPDK_WARNLOG("Subsystem %s is configured to run on a CPU core belonging " + SPDK_WARNLOG("Subsystem %s is configured to run on a CPU core %u belonging " "to a different NUMA node than the associated NIC. " "This may result in reduced performance.\n", - spdk_nvmf_subsystem_get_nqn(app_subsys->subsystem)); + spdk_nvmf_subsystem_get_nqn(app_subsys->subsystem), app_subsys->lcore); + SPDK_WARNLOG("The NIC is on socket %u\n", numa_node); + SPDK_WARNLOG("The Subsystem is on socket %u\n", + rte_lcore_to_socket_id(app_subsys->lcore)); } } spdk_nvmf_subsystem_add_listener(subsystem, transport_name, traddr, trsvcid); diff --git a/app/nvmf_tgt/nvmf_tgt.c b/app/nvmf_tgt/nvmf_tgt.c index 976bb380b..fd5fa15d4 100644 --- a/app/nvmf_tgt/nvmf_tgt.c +++ b/app/nvmf_tgt/nvmf_tgt.c @@ -244,7 +244,8 @@ nvmf_tgt_create_subsystem(const char *name, enum spdk_nvmf_subtype subtype, app_subsys->subsystem = subsystem; app_subsys->lcore = lcore; - SPDK_NOTICELOG("allocated subsystem %s on lcore %u\n", name, lcore); + SPDK_NOTICELOG("allocated subsystem %s on lcore %u on socket %u\n", name, lcore, + rte_lcore_to_socket_id(lcore)); TAILQ_INSERT_TAIL(&g_subsystems, app_subsys, tailq); @@ -341,7 +342,8 @@ spdk_nvmf_startup(spdk_event_t event) g_spdk_nvmf_tgt_conf.acceptor_lcore, NULL, g_spdk_nvmf_tgt_conf.acceptor_poll_rate); - SPDK_NOTICELOG("Acceptor running on core %u\n", g_spdk_nvmf_tgt_conf.acceptor_lcore); + SPDK_NOTICELOG("Acceptor running on core %u on socket %u\n", g_spdk_nvmf_tgt_conf.acceptor_lcore, + rte_lcore_to_socket_id(g_spdk_nvmf_tgt_conf.acceptor_lcore)); if (getenv("MEMZONE_DUMP") != NULL) { spdk_memzone_dump(stdout);