eal: do not panic on vdev init failure
[dpdk.git] / lib / librte_eal / bsdapp / eal / eal.c
index ff4225f..debecaa 100644 (file)
@@ -593,8 +593,10 @@ rte_eal_init(int argc, char **argv)
                return -1;
        }
 
-       if (rte_eal_intr_init() < 0)
-               rte_panic("Cannot init interrupt-handling thread\n");
+       if (rte_eal_intr_init() < 0) {
+               rte_eal_init_alert("Cannot init interrupt-handling thread\n");
+               return -1;
+       }
 
        if (rte_eal_timer_init() < 0) {
                rte_eal_init_alert("Cannot init HPET or TSC timers\n");
@@ -602,13 +604,17 @@ rte_eal_init(int argc, char **argv)
                return -1;
        }
 
-       if (rte_eal_pci_init() < 0)
-               rte_panic("Cannot init PCI\n");
+       if (rte_eal_pci_init() < 0) {
+               rte_eal_init_alert("Cannot init PCI\n");
+               rte_errno = EPROTO;
+               rte_atomic32_clear(&run_once);
+               return -1;
+       }
 
        eal_check_mem_on_local_socket();
 
        if (eal_plugins_init() < 0)
-               rte_panic("Cannot init plugins\n");
+               rte_eal_init_alert("Cannot init plugins\n");
 
        eal_thread_init_master(rte_config.master_lcore);
 
@@ -658,11 +664,14 @@ rte_eal_init(int argc, char **argv)
                rte_panic("Cannot probe devices\n");
 
        /* Probe & Initialize PCI devices */
-       if (rte_eal_pci_probe())
-               rte_panic("Cannot probe PCI\n");
+       if (rte_eal_pci_probe()) {
+               rte_eal_init_alert("Cannot probe PCI\n");
+               rte_errno = ENOTSUP;
+               return -1;
+       }
 
        if (rte_eal_dev_init() < 0)
-               rte_panic("Cannot init pmd devices\n");
+               rte_eal_init_alert("Cannot init pmd devices\n");
 
        rte_eal_mcfg_complete();