[dpdk-dev] [PATCH v12 6/7] eal: add failure handle mechanism for hot-unplug
Ananyev, Konstantin
konstantin.ananyev at intel.com
Tue Oct 2 15:34:22 CEST 2018
Hi Jeff,
Looks ok to me in general, just one thing I missed before:
> +static void sigbus_handler(int signum, siginfo_t *info,
> + void *ctx __rte_unused)
> +{
> + int ret;
> +
> + RTE_LOG(INFO, EAL, "Thread[%d] catch SIGBUS, fault address:%p\n",
> + (int)pthread_self(), info->si_addr);
> +
> + rte_spinlock_lock(&failure_handle_lock);
> + ret = rte_bus_sigbus_handler(info->si_addr);
> + rte_spinlock_unlock(&failure_handle_lock);
> + if (ret == -1) {
> + rte_exit(EXIT_FAILURE,
> + "Failed to handle SIGBUS for hot-unplug, "
> + "(rte_errno: %s)!", strerror(rte_errno));
> + } else if (ret == 1) {
> + if (sigbus_action_old.sa_handler)
> + (*(sigbus_action_old.sa_handler))(signum);
Shouldn't we check sigbus_action_old.sa_flags here,and based on that
invoke either sa_handler() or sa_sigaction()?
Konstantin
> + else
> + rte_exit(EXIT_FAILURE,
> + "Failed to handle generic SIGBUS!");
> + }
> +
> + RTE_LOG(INFO, EAL, "Success to handle SIGBUS for hot-unplug!\n");
> +}
More information about the dev
mailing list