From 81f8d2317df2ea614b213d4001d912c824f10a4d Mon Sep 17 00:00:00 2001 From: Cunming Liang Date: Fri, 31 Jul 2015 09:36:12 +0800 Subject: [PATCH] eal/linux: fix socket value for undetermined numa node The patch sets zero as the default value of pci device numa_node if the socket could not be determined. It provides the same default value as FreeBSD which has no NUMA support, and makes the return value of rte_eth_dev_socket_id() be consistent with the API description. Signed-off-by: Cunming Liang --- lib/librte_eal/linuxapp/eal/eal_pci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/librte_eal/linuxapp/eal/eal_pci.c b/lib/librte_eal/linuxapp/eal/eal_pci.c index 01e2855d3e..bc5b5bee22 100644 --- a/lib/librte_eal/linuxapp/eal/eal_pci.c +++ b/lib/librte_eal/linuxapp/eal/eal_pci.c @@ -325,8 +325,8 @@ pci_scan_one(const char *dirname, uint16_t domain, uint8_t bus, snprintf(filename, sizeof(filename), "%s/numa_node", dirname); if (access(filename, R_OK) != 0) { - /* if no NUMA support just set node to -1 */ - dev->numa_node = -1; + /* if no NUMA support, set default to 0 */ + dev->numa_node = 0; } else { if (eal_parse_sysfs_value(filename, &tmp) < 0) { free(dev); -- 2.20.1