]> git.droids-corp.org - dpdk.git/commitdiff
eal: do not panic on memzone init failure
authorAaron Conole <aconole@redhat.com>
Wed, 22 Mar 2017 20:19:31 +0000 (16:19 -0400)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Mon, 27 Mar 2017 13:53:06 +0000 (15:53 +0200)
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 <aconole@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
lib/librte_eal/bsdapp/eal/eal.c
lib/librte_eal/linuxapp/eal/eal.c

index ab34c0df71ce71f0dc81922d839c4fee9b535bb7..a71566ca0f78c431012306fb399be67348867465 100644 (file)
@@ -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");
index a671ed46399f5111a3b1935d2d57f9494d1f4a6c..5a92b2875b3c69775cf702e697d17fb698f68969 100644 (file)
@@ -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");