From: Hemant Agrawal <hemant.agrawal@nxp.com>
To: <thomas@monjalon.net>
Cc: <dev@dpdk.org>
Subject: [dpdk-dev] [PATCH] eal: disable NUMA related warnings on non-NUMA systems
Date: Thu, 13 Jul 2017 15:58:19 +0530 [thread overview]
Message-ID: <1499941699-19478-1-git-send-email-hemant.agrawal@nxp.com> (raw)
Disabling 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>
---
lib/librte_eal/linuxapp/eal/eal_memory.c | 8 ++++----
lib/librte_eal/linuxapp/eal/eal_pci.c | 4 ++++
2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/lib/librte_eal/linuxapp/eal/eal_memory.c b/lib/librte_eal/linuxapp/eal/eal_memory.c
index 040f24a..44e7e4e 100644
--- a/lib/librte_eal/linuxapp/eal/eal_memory.c
+++ b/lib/librte_eal/linuxapp/eal/eal_memory.c
@@ -595,6 +595,7 @@ unmap_all_hugepages_orig(struct hugepage_file *hugepg_tbl, struct hugepage_info
return 0;
}
+#ifdef RTE_EAL_NUMA_AWARE_HUGEPAGES
/*
* Parse /proc/self/numa_maps to get the NUMA socket ID for each huge
* page.
@@ -662,11 +663,9 @@ find_numasocket(struct hugepage_file *hugepg_tbl, struct hugepage_info *hpi)
if (hugepg_tbl[i].orig_va == va) {
hugepg_tbl[i].socket_id = socket_id;
hp_count++;
-#ifdef RTE_EAL_NUMA_AWARE_HUGEPAGES
RTE_LOG(DEBUG, EAL,
"Hugepage %s is on socket %d\n",
hugepg_tbl[i].filepath, socket_id);
-#endif
}
}
}
@@ -681,6 +680,7 @@ find_numasocket(struct hugepage_file *hugepg_tbl, struct hugepage_info *hpi)
fclose(f);
return -1;
}
+#endif
static int
cmp_physaddr(const void *a, const void *b)
@@ -1160,13 +1160,13 @@ rte_eal_hugepage_init(void)
goto fail;
}
}
-
+#ifdef RTE_EAL_NUMA_AWARE_HUGEPAGES
if (find_numasocket(&tmp_hp[hp_offset], hpi) < 0){
RTE_LOG(DEBUG, EAL, "Failed to find NUMA socket for %u MB pages\n",
(unsigned)(hpi->hugepage_sz / 0x100000));
goto fail;
}
-
+#endif
qsort(&tmp_hp[hp_offset], hpi->num_pages[0],
sizeof(struct hugepage_file), cmp_physaddr);
diff --git a/lib/librte_eal/linuxapp/eal/eal_pci.c b/lib/librte_eal/linuxapp/eal/eal_pci.c
index 7d9e1a9..688b052 100644
--- a/lib/librte_eal/linuxapp/eal/eal_pci.c
+++ b/lib/librte_eal/linuxapp/eal/eal_pci.c
@@ -310,6 +310,7 @@ pci_scan_one(const char *dirname, const struct rte_pci_addr *addr)
dev->max_vfs = (uint16_t)tmp;
}
+#ifdef RTE_EAL_NUMA_AWARE_HUGEPAGES
/* get numa node, default to 0 if not present */
snprintf(filename, sizeof(filename), "%s/numa_node",
dirname);
@@ -323,6 +324,9 @@ pci_scan_one(const char *dirname, const struct rte_pci_addr *addr)
"Set it 0 as default\n");
dev->device.numa_node = 0;
}
+#else
+ dev->device.numa_node = 0;
+#endif
rte_pci_device_name(addr, dev->name, sizeof(dev->name));
dev->device.name = dev->name;
--
2.7.4
next reply other threads:[~2017-07-13 10:28 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-13 10:28 Hemant Agrawal [this message]
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 ` [dpdk-dev] [PATCH v3] " Hemant Agrawal
2017-07-24 9:45 ` 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=1499941699-19478-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).