[dpdk-dev,1/5] NUMA: Set numa node value for system which not support NUMA.
Checks
Commit Message
The NUMA node information for PCI devices provided through
sysfs is invalid for AMD Opteron(TM) Processor 62xx and 63xx
on Red Hat Enterprise Linux 6, and VMs on some hypervisors.
Signed-off-by: nickcooper-zhangtonghao <nic@opencloud.tech>
---
lib/librte_eal/linuxapp/eal/eal_pci.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
@@ -317,7 +317,13 @@
free(dev);
return -1;
}
- dev->device.numa_node = tmp;
+ /* The NUMA node information for PCI devices provided through
+ * sysfs is invalid for AMD Opteron(TM) Processor 62xx and 63xx
+ * on Red Hat Enterprise Linux 6, and VMs on some hypervisors.
+ * In the upstream linux kernel, the numa_node is an integer,
+ * which data type is int, not unsigned long.
+ */
+ dev->device.numa_node = (int)tmp > 0 ? (int)tmp : 0;
}
/* parse resources */