[PATCH] eal: fix device unregister for event registered with device_name NULL
Stephen Hemminger
stephen at networkplumber.org
Tue Sep 24 17:50:29 CEST 2024
On Thu, 18 Jul 2024 12:37:28 -0700
longli at linuxonhyperv.com wrote:
> From: Malcolm Bumgardner <mbumgard at cisco.com>
>
> In the device event unregister code, it unconditionally remove all
> callbacks which are registered with device_name set to NULL. This results
> in many callbacks uncorrectly removed.
>
> Fix this by only removing callbacks with matching cb_fn and cb_arg.
>
> Signed-off-by: Malcolm Bumgardner <mbumgard at cisco.com>
>
> Fixes: a753e53d517b ("eal: add device event monitor framework")
> Cc: stable at dpdk.org
> Signed-off-by: Long Li <longli at microsoft.com>
> ---
> lib/eal/common/eal_common_dev.c | 13 +++++++------
> 1 file changed, 7 insertions(+), 6 deletions(-)
This patch solves the problem in the netvsc driver.
The netvsc driver registers a device event callback to discover when the VF
is added/removed. When the netvsc driver is stoppped, it unregisters this callback.
The bug is that the rte_dev code would end up removing all callbacks, including
the callback for other netvsc devices.
Perhaps a bugzilla entry or more direct example would have gotten more attention
on this.
Reviewed-by: Stephen Hemminger <stephen at networkplumber.org>
More information about the dev
mailing list