[PATCH v4] eal/linux: harden uevent recv error handling

Stephen Hemminger stephen at networkplumber.org
Tue Aug 18 04:15:33 CEST 2026


On Mon, 17 Aug 2026 16:16:02 -0400
Randy Tice <rtice at cisco.com> wrote:

> -	if (ret < 0 && errno == EAGAIN)
> +	if (ret < 0 &&
> +		(errno == EAGAIN || errno == EWOULDBLOCK || errno == EINTR)) {
> +		/* non-blocking or interrupted */
>  		return;
> -	else if (ret <= 0) {
> +	} else if (ret < 0 && (errno == ENOBUFS)) {
> +		/* non-fatal transient memory condition */
> +		EAL_LOG(ERR, "unexpected error on uevent recv: %s",
> +			strerror(errno));
> +		return;
> +	} else if (ret <= 0) {
>  		/* connection is closed or broken, can not up again. */
>  		EAL_LOG(ERR, "uevent socket connection is broken.");
>  		rte_eal_alarm_set(1, dev_delayed_unregister, NULL);
> -- 
Since there are multiple error conditions it reads better with single (ret < 0) if followed
by looking at errno.

PS: if you are getting ENOBUFS, the root cause is not having big enough socket receive
buffer and/or starving out the core handling control operations.

If you looks a uevent the internal state of devices is corrupted. Probably need
to figure out how to schedule some form of rescanning.


More information about the dev mailing list