patch 'eal/freebsd: fix lock in alarm callback' has been queued to stable release 22.11.2

Xueming Li xuemingl at nvidia.com
Mon Feb 27 08:00:58 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=fb395ef1d0e7dcdf5899dbe1a6e71226c09e2fed

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From fb395ef1d0e7dcdf5899dbe1a6e71226c09e2fed Mon Sep 17 00:00:00 2001
From: Chengwen Feng <fengchengwen at huawei.com>
Date: Mon, 13 Feb 2023 12:44:52 +0000
Subject: [PATCH] eal/freebsd: fix lock in alarm callback
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit fc6bdd5248e843ba1300c8d46d43b263b4a69438 ]

The spinlock should unlock when clock_gettime() failed. This patch
fixes it by invoking clock_gettime() before lock.

Fixes: 26021a715067 ("eal/bsd: support alarm API")

Signed-off-by: Chengwen Feng <fengchengwen at huawei.com>
Acked-by: Bruce Richardson <bruce.richardson at intel.com>
---
 lib/eal/freebsd/eal_alarm.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/eal/freebsd/eal_alarm.c b/lib/eal/freebsd/eal_alarm.c
index 1023c32937..1a3e6c0aad 100644
--- a/lib/eal/freebsd/eal_alarm.c
+++ b/lib/eal/freebsd/eal_alarm.c
@@ -171,12 +171,12 @@ eal_alarm_callback(void *arg __rte_unused)
 	struct timespec now;
 	struct alarm_entry *ap;

-	rte_spinlock_lock(&alarm_list_lk);
-	ap = LIST_FIRST(&alarm_list);
-
 	if (clock_gettime(CLOCK_TYPE_ID, &now) < 0)
 		return;

+	rte_spinlock_lock(&alarm_list_lk);
+	ap = LIST_FIRST(&alarm_list);
+
 	while (ap != NULL && timespec_cmp(&now, &ap->time) >= 0) {
 		ap->executing = 1;
 		ap->executing_id = pthread_self();
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:45.671928700 +0800
+++ 0151-eal-freebsd-fix-lock-in-alarm-callback.patch	2023-02-27 14:08:40.959237000 +0800
@@ -1 +1 @@
-From fc6bdd5248e843ba1300c8d46d43b263b4a69438 Mon Sep 17 00:00:00 2001
+From fb395ef1d0e7dcdf5899dbe1a6e71226c09e2fed Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit fc6bdd5248e843ba1300c8d46d43b263b4a69438 ]
@@ -10 +12,0 @@
-Cc: stable at dpdk.org


More information about the stable mailing list