[PATCH v5 1/4] eal/linux: filter uevent Netlink in kernel
Stephen Hemminger
stephen at networkplumber.org
Wed Aug 19 21:08:50 CEST 2026
The EAL uevent only needs/wants messages from the kernel.
Better to let kernel side do the filtering to avoid any overrun
issues in DPDK interrupt thread.
There is no exposed API definition here. The convention
is kernel is 1 and libudev uses 2.
Since kernel is now filtering can remove step in uevent parsing.
Fixes: 0d0f478d0483 ("eal/linux: add uevent parse and process")
Cc: stable at dpdk.org
Reported-by: Randy Tice <rtice at cisco.com>
Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
---
.mailmap | 1 +
lib/eal/linux/eal_dev.c | 8 ++++----
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/.mailmap b/.mailmap
index fcb3d1bb3f..9b7713b6df 100644
--- a/.mailmap
+++ b/.mailmap
@@ -1380,6 +1380,7 @@ Ralf Hoffmann <ralf.hoffmann at allegro-packets.com>
Rami Rosen <ramirose at gmail.com> <rami.rosen at intel.com>
Rami Rosen <ramirose at gmail.com> <roszenrami at gmail.com>
Randy Schacher <stuart.schacher at broadcom.com>
+Randy Tice <rtice at cisco.com>
Rani Sharoni <ranish at nvidia.com>
Ranjit Menon <ranjit.menon at intel.com>
Rasesh Mody <rmody at marvell.com> <rasesh.mody at cavium.com>
diff --git a/lib/eal/linux/eal_dev.c b/lib/eal/linux/eal_dev.c
index ec408649d0..666967667f 100644
--- a/lib/eal/linux/eal_dev.c
+++ b/lib/eal/linux/eal_dev.c
@@ -29,6 +29,9 @@ static bool hotplug_handle;
#define EAL_UEV_MSG_LEN 4096
#define EAL_UEV_MSG_ELEM_LEN 128
+/* Listen only to messages from kernel (not libudev) */
+#define EAL_UEV_GROUP_KERNEL 1
+
/*
* spinlock for device hot-unplug failure handling. If it try to access bus or
* device, such as handle sigbus on bus or handle memory failure for device
@@ -116,7 +119,7 @@ dev_uev_socket_fd_create(void)
memset(&addr, 0, sizeof(addr));
addr.nl_family = AF_NETLINK;
addr.nl_pid = 0;
- addr.nl_groups = 0xffffffff;
+ addr.nl_groups = EAL_UEV_GROUP_KERNEL;
ret = bind(fd, (struct sockaddr *) &addr, sizeof(addr));
if (ret < 0) {
@@ -164,9 +167,6 @@ dev_uev_parse(const char *buf, struct rte_dev_event *event, int length)
* check device uevent from kernel side, no need to check
* uevent from udev.
*/
- if (!strncmp(buf, "libudev", 7)) {
- return -1;
- }
if (!strncmp(buf, "ACTION=", 7)) {
buf += 7;
i += 7;
--
2.53.0
More information about the stable
mailing list