eal: do not panic on timer init failure
authorAaron Conole <aconole@redhat.com>
Wed, 22 Mar 2017 20:19:34 +0000 (16:19 -0400)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Mon, 27 Mar 2017 13:55:49 +0000 (15:55 +0200)
After code inspection, there is no way for eal_timer_init() to fail.  It
simply returns 0 in all cases.  As such, this test could either go-away
or stay here as 'future-proofing'.

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 c66cd33..ff4225f 100644 (file)
@@ -596,8 +596,11 @@ rte_eal_init(int argc, char **argv)
        if (rte_eal_intr_init() < 0)
                rte_panic("Cannot init interrupt-handling thread\n");
 
-       if (rte_eal_timer_init() < 0)
-               rte_panic("Cannot init HPET or TSC timers\n");
+       if (rte_eal_timer_init() < 0) {
+               rte_eal_init_alert("Cannot init HPET or TSC timers\n");
+               rte_errno = ENOTSUP;
+               return -1;
+       }
 
        if (rte_eal_pci_init() < 0)
                rte_panic("Cannot init PCI\n");
index bfb8260..9fb5421 100644 (file)
@@ -871,8 +871,11 @@ rte_eal_init(int argc, char **argv)
                return -1;
        }
 
-       if (rte_eal_timer_init() < 0)
-               rte_panic("Cannot init HPET or TSC timers\n");
+       if (rte_eal_timer_init() < 0) {
+               rte_eal_init_alert("Cannot init HPET or TSC timers\n");
+               rte_errno = ENOTSUP;
+               return -1;
+       }
 
        eal_check_mem_on_local_socket();