From: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
To: dev@dpdk.org
Cc: thomas@monjalon.net, nic@opencloud.tech
Subject: [dpdk-dev] [PATCH] pci: limit default numa node to used devices
Date: Fri, 21 Jul 2017 10:11:19 +0100 [thread overview]
Message-ID: <20170721091119.15701-1-sergio.gonzalez.monroy@intel.com> (raw)
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 <sergio.gonzalez.monroy@intel.com>
---
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
next reply other threads:[~2017-07-21 9:11 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-21 9:11 Sergio Gonzalez Monroy [this message]
2017-07-21 14:53 ` Thomas Monjalon
2017-07-21 15:03 ` Sergio Gonzalez Monroy
2017-07-21 15:37 ` Thomas Monjalon
2017-07-21 15:47 ` Sergio Gonzalez Monroy
2017-07-21 16:26 ` Thomas Monjalon
2017-07-21 16:29 ` Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170721091119.15701-1-sergio.gonzalez.monroy@intel.com \
--to=sergio.gonzalez.monroy@intel.com \
--cc=dev@dpdk.org \
--cc=nic@opencloud.tech \
--cc=thomas@monjalon.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).