From patchwork Thu Jan 5 12:01:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: nickcooper-zhangtonghao X-Patchwork-Id: 18909 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 7AF7FF60E; Thu, 5 Jan 2017 13:02:06 +0100 (CET) Received: from smtpbgau1.qq.com (smtpbgau1.qq.com [54.206.16.166]) by dpdk.org (Postfix) with ESMTP id C78B45A44 for ; Thu, 5 Jan 2017 13:02:04 +0100 (CET) X-QQ-mid: bizesmtp5t1483617718thmc8o99c Received: from local.opencloud.tech.localdomai (unknown [106.120.127.11]) by esmtp4.qq.com (ESMTP) with id ; Thu, 05 Jan 2017 20:01:53 +0800 (CST) X-QQ-SSF: 0110000000200070F650000A0000000 X-QQ-FEAT: lprB706UUf9ybkFgg3MqLCEfMwbRs6NtE9tCiTZrijAl5Qun4mmzMKY2NkBBB x6unByVk43E9q2BTpnu79/j0EiHDFgowervnXL87l6i2giNilqXJs57110SrgyQeHCESF+o g6/HkLYJb9pjuZQyEsm/zpre2mI/2J6m5bSIieQv+VU83bokTmnibiX67N3T04n8iyymAoz V1cJa21NVDggUw0Jx6H2t1xYLSEfsL91zm+5NcqBdscU/tZJy5QWkaBY8VMtxZ+zLHDrduX 6ocg== X-QQ-GoodBg: 0 From: nickcooper-zhangtonghao To: dev@dpdk.org Cc: nickcooper-zhangtonghao Date: Thu, 5 Jan 2017 04:01:45 -0800 Message-Id: <1483617709-7088-1-git-send-email-nic@opencloud.tech> X-Mailer: git-send-email 1.8.3.1 X-QQ-SENDSIZE: 520 X-QQ-Bgrelay: 1 Subject: [dpdk-dev] [PATCH v2 1/5] eal: Set numa node value for system which not support NUMA. X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list 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..5dfdbe9 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 */