[dpdk-stable] patch 'timer: add limitation note for sync stop and reset' has been queued to stable release 19.11.6
luca.boccassi at gmail.com
luca.boccassi at gmail.com
Wed Oct 28 11:44:33 CET 2020
Hi,
FYI, your patch has been queued to stable release 19.11.6
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/30/20. 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.
Thanks.
Luca Boccassi
---
>From 92749fc95c9c53d6eef799b70af2d0e1246c3bf6 Mon Sep 17 00:00:00 2001
From: Erik Gabriel Carrillo <erik.g.carrillo at intel.com>
Date: Wed, 9 Sep 2020 09:41:14 -0500
Subject: [PATCH] timer: add limitation note for sync stop and reset
[ upstream commit 0875ec4dd55a548a1f8a27674b1c136c0800d73d ]
If a timer's callback function calls rte_timer_reset_sync() or
rte_timer_stop_sync() on another timer that is in the RUNNING state and
owned by the current lcore, the *_sync() calls will loop indefinitely.
Relatedly, if a timer's callback function calls *_sync() on another
timer that is in the RUNNING state and is owned by a different lcore,
but a timer callback function runs on that different lcore and calls
*_sync() on a timer that is in the RUNNING state and owned by the
current lcore, the two lcores will loop indefinitely.
Add a note in the rte_timer_stop_sync and rte_timer_reset_sync
documentation that indicates that these APIs should not be used inside
timer callback functions in order to avoid the hangs described above,
and suggests an alternative.
Bugzilla ID: 491
Signed-off-by: Erik Gabriel Carrillo <erik.g.carrillo at intel.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli at arm.com>
---
lib/librte_timer/rte_timer.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/lib/librte_timer/rte_timer.h b/lib/librte_timer/rte_timer.h
index 9dc5fc3092..88cc267686 100644
--- a/lib/librte_timer/rte_timer.h
+++ b/lib/librte_timer/rte_timer.h
@@ -274,6 +274,12 @@ int rte_timer_reset(struct rte_timer *tim, uint64_t ticks,
* The callback function of the timer.
* @param arg
* The user argument of the callback function.
+ *
+ * @note
+ * This API should not be called inside a timer's callback function to
+ * reset another timer; doing so could hang in certain scenarios. Instead,
+ * the rte_timer_reset() API can be called directly and its return code
+ * can be checked for success or failure.
*/
void
rte_timer_reset_sync(struct rte_timer *tim, uint64_t ticks,
@@ -313,6 +319,12 @@ int rte_timer_stop(struct rte_timer *tim);
*
* @param tim
* The timer handle.
+ *
+ * @note
+ * This API should not be called inside a timer's callback function to
+ * stop another timer; doing so could hang in certain scenarios. Instead, the
+ * rte_timer_stop() API can be called directly and its return code can
+ * be checked for success or failure.
*/
void rte_timer_stop_sync(struct rte_timer *tim);
--
2.20.1
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2020-10-28 10:35:15.296554170 +0000
+++ 0114-timer-add-limitation-note-for-sync-stop-and-reset.patch 2020-10-28 10:35:11.668832438 +0000
@@ -1,8 +1,10 @@
-From 0875ec4dd55a548a1f8a27674b1c136c0800d73d Mon Sep 17 00:00:00 2001
+From 92749fc95c9c53d6eef799b70af2d0e1246c3bf6 Mon Sep 17 00:00:00 2001
From: Erik Gabriel Carrillo <erik.g.carrillo at intel.com>
Date: Wed, 9 Sep 2020 09:41:14 -0500
Subject: [PATCH] timer: add limitation note for sync stop and reset
+[ upstream commit 0875ec4dd55a548a1f8a27674b1c136c0800d73d ]
+
If a timer's callback function calls rte_timer_reset_sync() or
rte_timer_stop_sync() on another timer that is in the RUNNING state and
owned by the current lcore, the *_sync() calls will loop indefinitely.
@@ -19,7 +21,6 @@
and suggests an alternative.
Bugzilla ID: 491
-Cc: stable at dpdk.org
Signed-off-by: Erik Gabriel Carrillo <erik.g.carrillo at intel.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli at arm.com>
@@ -28,10 +29,10 @@
1 file changed, 12 insertions(+)
diff --git a/lib/librte_timer/rte_timer.h b/lib/librte_timer/rte_timer.h
-index 7af83783b0..22a27aa08d 100644
+index 9dc5fc3092..88cc267686 100644
--- a/lib/librte_timer/rte_timer.h
+++ b/lib/librte_timer/rte_timer.h
-@@ -262,6 +262,12 @@ int rte_timer_reset(struct rte_timer *tim, uint64_t ticks,
+@@ -274,6 +274,12 @@ int rte_timer_reset(struct rte_timer *tim, uint64_t ticks,
* The callback function of the timer.
* @param arg
* The user argument of the callback function.
@@ -44,7 +45,7 @@
*/
void
rte_timer_reset_sync(struct rte_timer *tim, uint64_t ticks,
-@@ -301,6 +307,12 @@ int rte_timer_stop(struct rte_timer *tim);
+@@ -313,6 +319,12 @@ int rte_timer_stop(struct rte_timer *tim);
*
* @param tim
* The timer handle.
More information about the stable
mailing list