From: Aaron Conole Date: Wed, 22 Mar 2017 20:19:31 +0000 (-0400) Subject: eal: do not panic on memzone init failure X-Git-Tag: spdx-start~4410 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=ce3bede01e74f45fff611fdcf97bd6fe82b3f9a0;p=dpdk.git eal: do not panic on memzone init failure When memzone initialization fails, report the error to the calling application rather than panic(). Without a good way of detaching / releasing hugepages, at this point the application will have to restart. Signed-off-by: Aaron Conole Acked-by: Bruce Richardson --- diff --git a/lib/librte_eal/bsdapp/eal/eal.c b/lib/librte_eal/bsdapp/eal/eal.c index ab34c0df71..a71566ca0f 100644 --- a/lib/librte_eal/bsdapp/eal/eal.c +++ b/lib/librte_eal/bsdapp/eal/eal.c @@ -569,8 +569,11 @@ rte_eal_init(int argc, char **argv) if (rte_eal_memory_init() < 0) rte_panic("Cannot init memory\n"); - if (rte_eal_memzone_init() < 0) - rte_panic("Cannot init memzone\n"); + if (rte_eal_memzone_init() < 0) { + rte_eal_init_alert("Cannot init memzone\n"); + rte_errno = ENODEV; + return -1; + } if (rte_eal_tailqs_init() < 0) rte_panic("Cannot init tail queues for objects\n"); diff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c index a671ed4639..5a92b2875b 100644 --- a/lib/librte_eal/linuxapp/eal/eal.c +++ b/lib/librte_eal/linuxapp/eal/eal.c @@ -839,8 +839,11 @@ rte_eal_init(int argc, char **argv) /* the directories are locked during eal_hugepage_info_init */ eal_hugedirs_unlock(); - if (rte_eal_memzone_init() < 0) - rte_panic("Cannot init memzone\n"); + if (rte_eal_memzone_init() < 0) { + rte_eal_init_alert("Cannot init memzone\n"); + rte_errno = ENODEV; + return -1; + } if (rte_eal_tailqs_init() < 0) rte_panic("Cannot init tail queues for objects\n");