eal: do not panic on interrupt thread init

There could be some confusion as to why the call failed - this change
will always reflect the value of the error in rte_error.

When initializing the interrupt thread, there are a number of possible
reasons for failure - some of which are correctable by the application.
Do not panic() needlessly, and give the application a change to reflect
this information to the user.

Signed-off-by: Aaron Conole <aconole@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
This commit is contained in:
Aaron Conole 2017-03-22 16:19:35 -04:00 committed by Thomas Monjalon
parent 330bed86d3
commit c050e5abae
3 changed files with 12 additions and 5 deletions

View 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");

View File

@ -890,8 +890,10 @@ rte_eal_init(int argc, char **argv)
rte_config.master_lcore, (int)thread_id, cpuset,
ret == 0 ? "" : "...");
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_bus_scan())
rte_panic("Cannot scan the buses for devices\n");

View File

@ -898,13 +898,16 @@ rte_eal_intr_init(void)
* create a pipe which will be waited by epoll and notified to
* rebuild the wait list of epoll.
*/
if (pipe(intr_pipe.pipefd) < 0)
if (pipe(intr_pipe.pipefd) < 0) {
rte_errno = errno;
return -1;
}
/* create the host thread to wait/handle the interrupt */
ret = pthread_create(&intr_thread, NULL,
eal_intr_thread_main, NULL);
if (ret != 0) {
rte_errno = ret;
RTE_LOG(ERR, EAL,
"Failed to create thread for interrupt handling\n");
} else {