From: Cunming Liang Date: Fri, 31 Jul 2015 01:36:12 +0000 (+0800) Subject: eal/linux: fix socket value for undetermined numa node X-Git-Tag: spdx-start~8563 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=81f8d2317df2ea614b213d4001d912c824f10a4d;p=dpdk.git 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 --- 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);