[PATCH v17 02/13] net/sxe: add ethdev probe and remove

Stephen Hemminger stephen at networkplumber.org
Mon Feb 9 20:05:34 CET 2026


On Mon,  9 Feb 2026 09:24:47 +0800
liujie5 at linkdatatechnology.com wrote:

> static s32 sxe_hdc_cmd_process(struct sxe_hw *hw, u64 trace_id,
> +				struct sxe_hdc_trans_info *trans_info)
> +{
> +	s32 ret;
> +	u8 retry_idx;
> +	struct sxe_adapter *adapter = hw->adapter;
> +	sigset_t old_mask, new_mask;
> +	sigemptyset(&new_mask);
> +	sigaddset(&new_mask, SIGINT);
> +	sigaddset(&new_mask, SIGTERM);
> +	ret = pthread_sigmask(SIG_BLOCK, &new_mask, &old_mask);
> +	if (ret) {
> +		LOG_ERROR_BDF("hdc set signal mask failed, ret=%d", ret);
> +		goto l_ret;
> +	}
> +
> +	LOG_DEBUG_BDF("hw[%p] cmd trace=0x%" SXE_PRIX64 "", hw, trace_id);
> +
> +	ret = sem_wait(sxe_hdc_sema_get());
> +	if (ret) {
> +		LOG_WARN_BDF("hw[%p] hdc concurrency full", hw);
> +		goto l_ret;
> +	}
> +
> +	for (retry_idx = 0; retry_idx < 250; retry_idx++) {
> +		ret = sxe_hdc_packet_trans(hw, trace_id, trans_info);
> +		if (ret == SXE_SUCCESS) {
> +			goto l_up;
> +		} else if (ret == -SXE_HDC_RETRY_ERR) {
> +			rte_delay_ms(10);
> +			continue;
> +		} else {
> +			LOG_ERROR_BDF("sxe hdc packet trace_id=0x%" SXE_PRIX64
> +					" trans error, ret=%d", trace_id, ret);
> +			ret = -EFAULT;
> +			goto l_up;
> +		}
> +	}
> +
> +l_up:
> +	LOG_DEBUG_BDF("hw[%p] cmd trace=0x%" SXE_PRIX64 "", hw, trace_id);
> +	sem_post(sxe_hdc_sema_get());
> +l_ret:
> +	ret = pthread_sigmask(SIG_SETMASK, &old_mask, NULL);
> +	if (ret)
> +		LOG_ERROR_BDF("hdc restore old signal mask failed, ret=%d", ret);
> +
> +	if (ret == -SXE_HDC_RETRY_ERR)
> +		ret = -EFAULT;
> +
> +	return ret;
> +}
> +

Drivers must not use or manipulate signals. Doing so could break applications.
Several years ago DPDK broke a Network Appliance vendors app from the signal
manipulation in TAP device.

This is a blocker for me.


More information about the dev mailing list