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

Kevin Traynor ktraynor at redhat.com
Thu Feb 23 16:06:21 CET 2023


Hi,

FYI, your patch has been queued to stable release 21.11.4

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/28/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://github.com/kevintraynor/dpdk-stable

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/118edbb63464c5cf13f76106fb1b8adf32552763

Thanks.

Kevin

---
>From 118edbb63464c5cf13f76106fb1b8adf32552763 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

[ 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
@@ -172,10 +172,10 @@ eal_alarm_callback(void *arg __rte_unused)
 	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;
-- 
2.39.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-23 14:46:25.976987694 +0000
+++ 0090-eal-freebsd-fix-lock-in-alarm-callback.patch	2023-02-23 14:46:23.883236360 +0000
@@ -1 +1 @@
-From fc6bdd5248e843ba1300c8d46d43b263b4a69438 Mon Sep 17 00:00:00 2001
+From 118edbb63464c5cf13f76106fb1b8adf32552763 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit fc6bdd5248e843ba1300c8d46d43b263b4a69438 ]
+
@@ -10 +11,0 @@
-Cc: stable at dpdk.org



More information about the stable mailing list