patch 'gpudev: fix deadlocks when registering callback' has been queued to stable release 22.11.2
Xueming Li
xuemingl at nvidia.com
Mon Feb 27 07:58:51 CET 2023
Hi,
FYI, your patch has been queued to stable release 22.11.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/01/23. 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=22.11-staging
This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=22.11-staging&id=b9a14f6737000ffc6badaf72e5da6ba2194e285c
Thanks.
Xueming Li <xuemingl at nvidia.com>
---
>From b9a14f6737000ffc6badaf72e5da6ba2194e285c Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand at redhat.com>
Date: Tue, 3 Jan 2023 11:49:00 +0100
Subject: [PATCH] gpudev: fix deadlocks when registering callback
Cc: Xueming Li <xuemingl at nvidia.com>
[ upstream commit 75d75530072e95a56799f0a8af261fc2eaf564ab ]
gpu_callback_lock was not released in some branches of the register
helper.
While at it, set rte_errno in one of those branches.
Fixes: 18cb07563165 ("gpudev: add event notification")
Signed-off-by: David Marchand <david.marchand at redhat.com>
Acked-by: Elena Agostini <eagostini at nvidia.com>
---
lib/gpudev/gpudev.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/lib/gpudev/gpudev.c b/lib/gpudev/gpudev.c
index 805719d00c..8f12abef23 100644
--- a/lib/gpudev/gpudev.c
+++ b/lib/gpudev/gpudev.c
@@ -408,6 +408,7 @@ rte_gpu_callback_register(int16_t dev_id, enum rte_gpu_event event,
callback->function == function &&
callback->user_data == user_data) {
GPU_LOG(INFO, "callback already registered");
+ rte_rwlock_write_unlock(&gpu_callback_lock);
return 0;
}
}
@@ -415,7 +416,9 @@ rte_gpu_callback_register(int16_t dev_id, enum rte_gpu_event event,
callback = malloc(sizeof(*callback));
if (callback == NULL) {
GPU_LOG(ERR, "cannot allocate callback");
- return -ENOMEM;
+ rte_rwlock_write_unlock(&gpu_callback_lock);
+ rte_errno = ENOMEM;
+ return -rte_errno;
}
callback->function = function;
callback->user_data = user_data;
--
2.25.1
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2023-02-27 14:08:41.726526900 +0800
+++ 0024-gpudev-fix-deadlocks-when-registering-callback.patch 2023-02-27 14:08:40.739237000 +0800
@@ -1 +1 @@
-From 75d75530072e95a56799f0a8af261fc2eaf564ab Mon Sep 17 00:00:00 2001
+From b9a14f6737000ffc6badaf72e5da6ba2194e285c Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 75d75530072e95a56799f0a8af261fc2eaf564ab ]
@@ -11 +13,0 @@
-Cc: stable at dpdk.org
More information about the stable
mailing list