From: Aaron Conole Date: Wed, 22 Mar 2017 20:19:34 +0000 (-0400) Subject: eal: do not panic on timer init failure X-Git-Tag: spdx-start~4407 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=330bed86d35c8cbca29082604e2f3dea7b83b277;p=dpdk.git eal: do not panic on timer init failure 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 Acked-by: Bruce Richardson --- diff --git a/lib/librte_eal/bsdapp/eal/eal.c b/lib/librte_eal/bsdapp/eal/eal.c index c66cd33f9e..ff4225f388 100644 --- a/lib/librte_eal/bsdapp/eal/eal.c +++ b/lib/librte_eal/bsdapp/eal/eal.c @@ -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"); diff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c index bfb8260f1a..9fb5421ada 100644 --- a/lib/librte_eal/linuxapp/eal/eal.c +++ b/lib/librte_eal/linuxapp/eal/eal.c @@ -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();