[dpdk-dev] [PATCH 03/25] eal: No panic on hugepages info init
Aaron Conole
aconole at redhat.com
Fri Jan 27 15:56:41 CET 2017
When attempting to scan hugepages, signal to the eal.c that an error has
occured, rather than performing a panic.
Signed-off-by: Aaron Conole <aconole at redhat.com>
---
lib/librte_eal/linuxapp/eal/eal_hugepage_info.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/lib/librte_eal/linuxapp/eal/eal_hugepage_info.c b/lib/librte_eal/linuxapp/eal/eal_hugepage_info.c
index 18858e2..4d47eaf 100644
--- a/lib/librte_eal/linuxapp/eal/eal_hugepage_info.c
+++ b/lib/librte_eal/linuxapp/eal/eal_hugepage_info.c
@@ -283,9 +283,11 @@ eal_hugepage_info_init(void)
struct dirent *dirent;
dir = opendir(sys_dir_path);
- if (dir == NULL)
- rte_panic("Cannot open directory %s to read system hugepage "
+ if (dir == NULL) {
+ RTE_LOG(ERR, EAL, "Cannot open directory %s to read system hugepage "
"info\n", sys_dir_path);
+ return -1;
+ }
for (dirent = readdir(dir); dirent != NULL; dirent = readdir(dir)) {
struct hugepage_info *hpi;
--
2.7.4
More information about the dev
mailing list