From mboxrd@z Thu Jan 1 00:00:00 1970 From: nickcooper-zhangtonghao Subject: [PATCH 1/5] NUMA: Set numa node value for system which not support NUMA. Date: Thu, 5 Jan 2017 02:42:59 -0800 Message-ID: <1483612983-3545-1-git-send-email-nic@opencloud.tech> Cc: nickcooper-zhangtonghao To: dev@dpdk.org Return-path: Received: from smtpbgau1.qq.com (smtpbgau1.qq.com [54.206.16.166]) by dpdk.org (Postfix) with ESMTP id B6FE1D4E0 for ; Thu, 5 Jan 2017 11:43:15 +0100 (CET) List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- lib/librte_eal/linuxapp/eal/eal_pci.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/librte_eal/linuxapp/eal/eal_pci.c b/lib/librte_eal/linuxapp/eal/eal_pci.c index 4350134..3ffac23 100644 --- a/lib/librte_eal/linuxapp/eal/eal_pci.c +++ b/lib/librte_eal/linuxapp/eal/eal_pci.c @@ -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 */ -- 1.8.3.1