[dpdk-dev] [PATCH v12 6/7] eal: add failure handle mechanism for hot-unplug

Jeff Guo jia.guo at intel.com
Thu Oct 4 04:31:11 CEST 2018


On 10/2/2018 9:34 PM, Ananyev, Konstantin wrote:
> 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


you are right here, konstantin.

We should not assume the old action should always be sa_handler. There 
is a flags check missing here. Thanks.


>> +		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