> 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: [email protected]
>
> Reported-by: Randy Tice <[email protected]>
> Signed-off-by: Stephen Hemminger <[email protected]>
Reviewed-by: Long Li <[email protected]>
> ---
> .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@allegro-
> packets.com>
> Rami Rosen <[email protected]> <[email protected]> Rami Rosen
> <[email protected]> <[email protected]> Randy Schacher
> <[email protected]>
> +Randy Tice <[email protected]>
> Rani Sharoni <[email protected]>
> Ranjit Menon <[email protected]>
> Rasesh Mody <[email protected]> <[email protected]> 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