patch 'dev: fix callback lookup when unregistering device' has been queued to stable release 22.11.7
luca.boccassi at gmail.com
luca.boccassi at gmail.com
Wed Oct 23 23:15:46 CEST 2024
Hi,
FYI, your patch has been queued to stable release 22.11.7
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 10/25/24. So please
shout if anyone has objections.
Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.
Queued patches are on a temporary branch at:
https://github.com/bluca/dpdk-stable
This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/66228c9ae76ca68940b1e9b4bb46bd587447c365
Thanks.
Luca Boccassi
---
>From 66228c9ae76ca68940b1e9b4bb46bd587447c365 Mon Sep 17 00:00:00 2001
From: Malcolm Bumgardner <mbumgard at cisco.com>
Date: Thu, 18 Jul 2024 12:37:28 -0700
Subject: [PATCH] dev: fix callback lookup when unregistering device
[ upstream commit 66fd2cc2e47c69ee57f0fe32558e55b085c2e32d ]
In the device event unregister code, it unconditionally removes all
callbacks which are registered with device_name set to NULL.
This results in many callbacks incorrectly removed.
Fix this by only removing callbacks with matching cb_fn and cb_arg.
Fixes: a753e53d517b ("eal: add device event monitor framework")
Signed-off-by: Malcolm Bumgardner <mbumgard at cisco.com>
Signed-off-by: Long Li <longli at microsoft.com>
Reviewed-by: Stephen Hemminger <stephen at networkplumber.org>
---
.mailmap | 1 +
lib/eal/common/eal_common_dev.c | 13 +++++++------
2 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/.mailmap b/.mailmap
index 0a91d70e4c..80d6d50ba9 100644
--- a/.mailmap
+++ b/.mailmap
@@ -823,6 +823,7 @@ Mahesh Adulla <mahesh.adulla at amd.com>
Mahipal Challa <mchalla at marvell.com>
Mah Yock Gen <yock.gen.mah at intel.com>
Mairtin o Loingsigh <mairtin.oloingsigh at intel.com>
+Malcolm Bumgardner <mbumgard at cisco.com>
Mallesham Jatharakonda <mjatharakonda at oneconvergence.com>
Mallesh Koujalagi <malleshx.koujalagi at intel.com>
Malvika Gupta <malvika.gupta at arm.com>
diff --git a/lib/eal/common/eal_common_dev.c b/lib/eal/common/eal_common_dev.c
index 614ef6c9fc..bc53b2e28d 100644
--- a/lib/eal/common/eal_common_dev.c
+++ b/lib/eal/common/eal_common_dev.c
@@ -550,16 +550,17 @@ rte_dev_event_callback_unregister(const char *device_name,
next = TAILQ_NEXT(event_cb, next);
if (device_name != NULL && event_cb->dev_name != NULL) {
- if (!strcmp(event_cb->dev_name, device_name)) {
- if (event_cb->cb_fn != cb_fn ||
- (cb_arg != (void *)-1 &&
- event_cb->cb_arg != cb_arg))
- continue;
- }
+ if (strcmp(event_cb->dev_name, device_name))
+ continue;
} else if (device_name != NULL) {
continue;
}
+ /* Remove only matching callback with arg */
+ if (event_cb->cb_fn != cb_fn ||
+ (cb_arg != (void *)-1 && event_cb->cb_arg != cb_arg))
+ continue;
+
/*
* if this callback is not executing right now,
* then remove it.
--
2.45.2
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2024-10-23 22:16:40.785278188 +0100
+++ 0006-dev-fix-callback-lookup-when-unregistering-device.patch 2024-10-23 22:16:40.435940252 +0100
@@ -1 +1 @@
-From 66fd2cc2e47c69ee57f0fe32558e55b085c2e32d Mon Sep 17 00:00:00 2001
+From 66228c9ae76ca68940b1e9b4bb46bd587447c365 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 66fd2cc2e47c69ee57f0fe32558e55b085c2e32d ]
+
@@ -13 +14,0 @@
-Cc: stable at dpdk.org
@@ -24 +25 @@
-index a66da3c8cb..8004772125 100644
+index 0a91d70e4c..80d6d50ba9 100644
@@ -27,2 +28,2 @@
-@@ -886,6 +886,7 @@ Mahipal Challa <mchalla at marvell.com>
- Mahmoud Maatuq <mahmoudmatook.mm at gmail.com>
+@@ -823,6 +823,7 @@ Mahesh Adulla <mahesh.adulla at amd.com>
+ Mahipal Challa <mchalla at marvell.com>
@@ -36 +37 @@
-index a99252b02f..70aa04dcd9 100644
+index 614ef6c9fc..bc53b2e28d 100644
More information about the stable
mailing list