From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Long Li <longli@microsoft.com>,
Stephen Hemminger <stephen@networkplumber.org>,
stable@dpdk.org, Randy Tice <rtice@cisco.com>,
Jianfeng Tan <jianfeng.tan@intel.com>,
Jeff Guo <jia.guo@intel.com>
Subject: [PATCH v5 3/4] eal/linux: report uevent socket overrun
Date: Wed, 19 Aug 2026 12:08:52 -0700 [thread overview]
Message-ID: <20260819191036.679330-4-stephen@networkplumber.org> (raw)
In-Reply-To: <20260819191036.679330-1-stephen@networkplumber.org>
Make uevent handler handle case where kernel netlink receive
buffer is overrun. If this happens the DPDK device state
will potentially be out of sync, but better not to give up.
The code already handles the case of kernel sending a zero
length message; it just ignores it.
Fixes: 0d0f478d0483 ("eal/linux: add uevent parse and process")
Cc: stable@dpdk.org
Reported-by: Randy Tice <rtice@cisco.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/eal/linux/eal_dev.c | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/lib/eal/linux/eal_dev.c b/lib/eal/linux/eal_dev.c
index fb5c8bf070..b535122ff6 100644
--- a/lib/eal/linux/eal_dev.c
+++ b/lib/eal/linux/eal_dev.c
@@ -270,11 +270,20 @@ dev_uev_handler(__rte_unused void *param)
ret = recv(rte_intr_fd_get(intr_handle), buf, EAL_UEV_MSG_LEN,
MSG_DONTWAIT);
- if (ret < 0 && errno == EAGAIN)
- return;
- else if (ret <= 0) {
- /* connection is closed or broken, can not up again. */
- EAL_LOG(ERR, "uevent socket connection is broken.");
+ if (ret < 0) {
+ /* transient error */
+ if (errno == EAGAIN || errno == EWOULDBLOCK || errno == EINTR)
+ return;
+
+ /* kernel netlink messages lost */
+ if (errno == ENOBUFS) {
+ EAL_LOG(NOTICE, "kernel receive buffer overrun");
+ return;
+ }
+
+ EAL_LOG(ERR, "unexpected error on uevent recv: %s",
+ strerror(errno));
+
rte_eal_alarm_set(1, dev_delayed_unregister, NULL);
return;
}
--
2.53.0
next prev parent reply other threads:[~2026-08-19 19:11 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-13 20:16 [PATCH] eal/linux: harden uevent recv error handling Randy Tice
2026-08-13 22:57 ` Stephen Hemminger
2026-08-17 18:53 ` [PATCH v2] " Randy Tice
2026-08-17 19:23 ` [PATCH v3] " Randy Tice
2026-08-17 20:16 ` [PATCH v4] " Randy Tice
2026-08-18 2:15 ` Stephen Hemminger
2026-08-19 19:08 ` [PATCH v5 0/4] eal: uevent overrun mitigation Stephen Hemminger
2026-08-19 19:08 ` [PATCH v5 1/4] eal/linux: filter uevent Netlink in kernel Stephen Hemminger
2026-08-19 19:08 ` [PATCH v5 2/4] eal/linux: increase uevent socket buffer Stephen Hemminger
2026-08-19 19:08 ` Stephen Hemminger [this message]
2026-08-19 19:08 ` [PATCH v5 4/4] doc: add warning about control threads Stephen Hemminger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260819191036.679330-4-stephen@networkplumber.org \
--to=stephen@networkplumber.org \
--cc=dev@dpdk.org \
--cc=jia.guo@intel.com \
--cc=jianfeng.tan@intel.com \
--cc=longli@microsoft.com \
--cc=rtice@cisco.com \
--cc=stable@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox