From: Hemant Agrawal Date: Mon, 24 Jul 2017 09:20:27 +0000 (+0530) Subject: eal: disable NUMA related warnings on non-NUMA systems X-Git-Tag: spdx-start~2340 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=eedbb9a10318b50ceae6eb80676abdff2b1b1f4b;p=dpdk.git eal: disable NUMA related warnings on non-NUMA systems Disable multiple NUMA warnings on non-NUMA systems. "EAL: eal_parse_sysfs_value(): cannot open sysfs value /sys/bus/pci/devices/0000:00:00.0/numa_node EAL: numa_node is invalid or not present. Set it 0 as default EAL: cannot open /proc/self/numa_maps, consider that all memory is in socket_id 0" Signed-off-by: Hemant Agrawal Tested-by: Jerin Jacob --- diff --git a/lib/librte_eal/linuxapp/eal/eal_memory.c b/lib/librte_eal/linuxapp/eal/eal_memory.c index daead31c27..52791282f3 100644 --- a/lib/librte_eal/linuxapp/eal/eal_memory.c +++ b/lib/librte_eal/linuxapp/eal/eal_memory.c @@ -610,8 +610,8 @@ find_numasocket(struct hugepage_file *hugepg_tbl, struct hugepage_info *hpi) f = fopen("/proc/self/numa_maps", "r"); if (f == NULL) { - RTE_LOG(NOTICE, EAL, "cannot open /proc/self/numa_maps," - " consider that all memory is in socket_id 0\n"); + RTE_LOG(NOTICE, EAL, "NUMA support not available" + " consider that all memory is in socket_id 0\n"); return 0; } diff --git a/lib/librte_eal/linuxapp/eal/eal_pci.c b/lib/librte_eal/linuxapp/eal/eal_pci.c index 2041d5f347..8951ce7420 100644 --- a/lib/librte_eal/linuxapp/eal/eal_pci.c +++ b/lib/librte_eal/linuxapp/eal/eal_pci.c @@ -314,10 +314,14 @@ pci_scan_one(const char *dirname, const struct rte_pci_addr *addr) snprintf(filename, sizeof(filename), "%s/numa_node", dirname); - if (eal_parse_sysfs_value(filename, &tmp) == 0) - dev->device.numa_node = tmp; - else - dev->device.numa_node = -1; + if (access(filename, F_OK) != -1) { + if (eal_parse_sysfs_value(filename, &tmp) == 0) + dev->device.numa_node = tmp; + else + dev->device.numa_node = -1; + } else { + dev->device.numa_node = 0; + } pci_name_set(dev);