From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id F0BE129C8 for ; Fri, 21 Jul 2017 11:11:21 +0200 (CEST) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga104.jf.intel.com with ESMTP; 21 Jul 2017 02:11:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,389,1496127600"; d="scan'208";a="289656257" Received: from silpixa00397517.ir.intel.com (HELO silpixa00397517.ger.corp.intel.com) ([10.237.222.54]) by fmsmga004.fm.intel.com with ESMTP; 21 Jul 2017 02:11:19 -0700 From: Sergio Gonzalez Monroy To: dev@dpdk.org Cc: thomas@monjalon.net, nic@opencloud.tech Date: Fri, 21 Jul 2017 10:11:19 +0100 Message-Id: <20170721091119.15701-1-sergio.gonzalez.monroy@intel.com> X-Mailer: git-send-email 2.9.4 Subject: [dpdk-dev] [PATCH] pci: limit default numa node to used devices 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: , X-List-Received-Date: Fri, 21 Jul 2017 09:11:22 -0000 Commit 8a04cb612589 ("pci: set default numa node for broken systems") added logic to default to NUMA node 0 when sysfs numa_node information was wrong or not available. Unfortunately there are many devices with wrong NUMA node information that DPDK does not care about but still show warnings for them. Instead, only check for invalid NUMA node information for devices managed by the DPDK. Signed-off-by: Sergio Gonzalez Monroy --- lib/librte_eal/common/eal_common_pci.c | 5 +++++ lib/librte_eal/linuxapp/eal/eal_pci.c | 11 +++-------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/librte_eal/common/eal_common_pci.c b/lib/librte_eal/common/eal_common_pci.c index eaa041e..52fd38c 100644 --- a/lib/librte_eal/common/eal_common_pci.c +++ b/lib/librte_eal/common/eal_common_pci.c @@ -226,6 +226,11 @@ rte_pci_probe_one_driver(struct rte_pci_driver *dr, return 1; } + if (dev->device.numa_node < 0) { + RTE_LOG(WARNING, EAL, " Invalid NUMA socket, default to 0\n"); + dev->device.numa_node = 0; + } + RTE_LOG(INFO, EAL, " probe driver: %x:%x %s\n", dev->id.vendor_id, dev->id.device_id, dr->driver.name); diff --git a/lib/librte_eal/linuxapp/eal/eal_pci.c b/lib/librte_eal/linuxapp/eal/eal_pci.c index 556ae2c..2041d5f 100644 --- a/lib/librte_eal/linuxapp/eal/eal_pci.c +++ b/lib/librte_eal/linuxapp/eal/eal_pci.c @@ -314,15 +314,10 @@ pci_scan_one(const char *dirname, const struct rte_pci_addr *addr) snprintf(filename, sizeof(filename), "%s/numa_node", dirname); - if (eal_parse_sysfs_value(filename, &tmp) == 0 && - tmp < RTE_MAX_NUMA_NODES) + if (eal_parse_sysfs_value(filename, &tmp) == 0) dev->device.numa_node = tmp; - else { - RTE_LOG(WARNING, EAL, - "numa_node is invalid or not present. " - "Set it 0 as default\n"); - dev->device.numa_node = 0; - } + else + dev->device.numa_node = -1; pci_name_set(dev); -- 2.9.4