patch 'dev: fix callback lookup when unregistering device' has been queued to stable release 23.11.3
Xueming Li
xuemingl at nvidia.com
Mon Nov 11 07:26:56 CET 2024
Hi,
FYI, your patch has been queued to stable release 23.11.3
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 11/30/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://git.dpdk.org/dpdk-stable/log/?h=23.11-staging
This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=310058b8699eb2833fe0b8093a355f29fcea1b67
Thanks.
Xueming Li <xuemingl at nvidia.com>
---
>From 310058b8699eb2833fe0b8093a355f29fcea1b67 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
Cc: Xueming Li <xuemingl at nvidia.com>
[ 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 7aa2c27226..4b8a131d55 100644
--- a/.mailmap
+++ b/.mailmap
@@ -860,6 +860,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.34.1
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2024-11-11 14:23:05.948838523 +0800
+++ 0010-dev-fix-callback-lookup-when-unregistering-device.patch 2024-11-11 14:23:05.022192842 +0800
@@ -1 +1 @@
-From 66fd2cc2e47c69ee57f0fe32558e55b085c2e32d Mon Sep 17 00:00:00 2001
+From 310058b8699eb2833fe0b8093a355f29fcea1b67 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 66fd2cc2e47c69ee57f0fe32558e55b085c2e32d ]
@@ -13 +15,0 @@
-Cc: stable at dpdk.org
@@ -24 +26 @@
-index a66da3c8cb..8004772125 100644
+index 7aa2c27226..4b8a131d55 100644
@@ -27,2 +29,2 @@
-@@ -886,6 +886,7 @@ Mahipal Challa <mchalla at marvell.com>
- Mahmoud Maatuq <mahmoudmatook.mm at gmail.com>
+@@ -860,6 +860,7 @@ Mahesh Adulla <mahesh.adulla at amd.com>
+ Mahipal Challa <mchalla at marvell.com>
@@ -36 +38 @@
-index a99252b02f..70aa04dcd9 100644
+index 614ef6c9fc..bc53b2e28d 100644
More information about the stable
mailing list