From 4f8ab58ac145839de8a039b8e1592d410ea4b7b8 Mon Sep 17 00:00:00 2001 From: Daniel Verkamp Date: Mon, 30 Jan 2017 12:40:52 -0700 Subject: [PATCH] nvmf_tgt: add cross-socket warning to subsystem RPC This is the same check as the subsystem configuration file parsing uses. Change-Id: Id301a929e06f51b060256a3038e0c24120ccd308 Signed-off-by: Daniel Verkamp --- app/nvmf_tgt/conf.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/app/nvmf_tgt/conf.c b/app/nvmf_tgt/conf.c index 5a2367293..7cf01583f 100644 --- a/app/nvmf_tgt/conf.c +++ b/app/nvmf_tgt/conf.c @@ -627,6 +627,21 @@ spdk_nvmf_parse_subsystem_for_rpc(const char *name, /* Parse Listen sections */ for (i = 0; i < num_listen_addresses; i++) { + int nic_numa_node = spdk_get_ifaddr_numa_node(addresses[i].traddr); + unsigned subsys_numa_node = rte_lcore_to_socket_id(app_subsys->lcore); + + if (nic_numa_node >= 0) { + if (subsys_numa_node != (unsigned)nic_numa_node) { + SPDK_WARNLOG("Subsystem %s is configured to run on a CPU core %d belonging " + "to a different NUMA node than the associated NIC. " + "This may result in reduced performance.\n", + name, lcore); + SPDK_WARNLOG("The NIC is on socket %d\n", nic_numa_node); + SPDK_WARNLOG("The Subsystem is on socket %u\n", + subsys_numa_node); + } + } + spdk_nvmf_subsystem_add_listener(subsystem, addresses[i].transport, addresses[i].traddr, addresses[i].trsvcid); }