DPDK patches and discussions
 help / color / mirror / Atom feed
From: Hemant Agrawal <hemant.agrawal@nxp.com>
To: <thomas@monjalon.net>
Cc: <dev@dpdk.org>
Subject: [dpdk-dev] [PATCH v3] eal: disable NUMA related warnings on non-NUMA systems
Date: Mon, 24 Jul 2017 14:50:27 +0530	[thread overview]
Message-ID: <1500888027-20539-1-git-send-email-hemant.agrawal@nxp.com> (raw)
In-Reply-To: <1500887698-20238-1-git-send-email-hemant.agrawal@nxp.com>

Disable multiple NUMA warnings on non-NUMA systems.

"EAL: eal_parse_sysfs_value(): cannot open sysfs value
	/sys/bus/pci/devices/0000:00:00.0/numa_node
EAL: numa_node is invalid or not present. Set it 0 as default
EAL: cannot open /proc/self/numa_maps, consider that all memory is
	in socket_id 0"

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
v3: fix checkpatch error
v2: convert check to run time for NUMA systems

 lib/librte_eal/linuxapp/eal/eal_memory.c |  4 ++--
 lib/librte_eal/linuxapp/eal/eal_pci.c    | 12 ++++++++----
 2 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/lib/librte_eal/linuxapp/eal/eal_memory.c b/lib/librte_eal/linuxapp/eal/eal_memory.c
index daead31..5279128 100644
--- a/lib/librte_eal/linuxapp/eal/eal_memory.c
+++ b/lib/librte_eal/linuxapp/eal/eal_memory.c
@@ -610,8 +610,8 @@ find_numasocket(struct hugepage_file *hugepg_tbl, struct hugepage_info *hpi)
 
 	f = fopen("/proc/self/numa_maps", "r");
 	if (f == NULL) {
-		RTE_LOG(NOTICE, EAL, "cannot open /proc/self/numa_maps,"
-				" consider that all memory is in socket_id 0\n");
+		RTE_LOG(NOTICE, EAL, "NUMA support not available"
+			" consider that all memory is in socket_id 0\n");
 		return 0;
 	}
 
diff --git a/lib/librte_eal/linuxapp/eal/eal_pci.c b/lib/librte_eal/linuxapp/eal/eal_pci.c
index 2041d5f..8951ce7 100644
--- a/lib/librte_eal/linuxapp/eal/eal_pci.c
+++ b/lib/librte_eal/linuxapp/eal/eal_pci.c
@@ -314,10 +314,14 @@ 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)
-		dev->device.numa_node = tmp;
-	else
-		dev->device.numa_node = -1;
+	if (access(filename, F_OK) != -1) {
+		if (eal_parse_sysfs_value(filename, &tmp) == 0)
+			dev->device.numa_node = tmp;
+		else
+			dev->device.numa_node = -1;
+	} else {
+		dev->device.numa_node = 0;
+	}
 
 	pci_name_set(dev);
 
-- 
2.7.4

  reply	other threads:[~2017-07-24  9:20 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-13 10:28 [dpdk-dev] [PATCH] " Hemant Agrawal
2017-07-21  6:01 ` Thomas Monjalon
2017-07-21 12:14   ` Hemant Agrawal
2017-07-24  9:14 ` [dpdk-dev] [PATCH v2] " Hemant Agrawal
2017-07-24  9:20   ` Hemant Agrawal [this message]
2017-07-24  9:45     ` [dpdk-dev] [PATCH v3] " Jerin Jacob
2017-07-30 21: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=1500888027-20539-1-git-send-email-hemant.agrawal@nxp.com \
    --to=hemant.agrawal@nxp.com \
    --cc=dev@dpdk.org \
    --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).