DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH 3/4] timer: fix rte_timer_stop_all
@ 2022-08-03 16:26 Naga Harish K S V
  2022-08-03 17:49 ` Stephen Hemminger
  2022-08-10  7:09 ` [PATCH v2 3/4] timer: fix function to stop all timers Naga Harish K S V
  0 siblings, 2 replies; 10+ messages in thread
From: Naga Harish K S V @ 2022-08-03 16:26 UTC (permalink / raw)
  To: erik.g.carrillo; +Cc: dev

there is a possibility of deadlock in this api,
as same spinlock is tried to be acquired in nested manner.

This patch removes the acquisition of nested locking.

Signed-off-by: Naga Harish K S V <s.v.naga.harish.k@intel.com>
---
 lib/timer/rte_timer.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/lib/timer/rte_timer.c b/lib/timer/rte_timer.c
index 9994813d0d..cfbc8cb028 100644
--- a/lib/timer/rte_timer.c
+++ b/lib/timer/rte_timer.c
@@ -987,21 +987,16 @@ rte_timer_stop_all(uint32_t timer_data_id, unsigned int *walk_lcores,
 		walk_lcore = walk_lcores[i];
 		priv_timer = &timer_data->priv_timer[walk_lcore];
 
-		rte_spinlock_lock(&priv_timer->list_lock);
-
 		for (tim = priv_timer->pending_head.sl_next[0];
 		     tim != NULL;
 		     tim = next_tim) {
 			next_tim = tim->sl_next[0];
 
-			/* Call timer_stop with lock held */
-			__rte_timer_stop(tim, 1, timer_data);
+			__rte_timer_stop(tim, 0, timer_data);
 
 			if (f)
 				f(tim, f_arg);
 		}
-
-		rte_spinlock_unlock(&priv_timer->list_lock);
 	}
 
 	return 0;
-- 
2.25.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2022-08-18 13:13 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-03 16:26 [PATCH 3/4] timer: fix rte_timer_stop_all Naga Harish K S V
2022-08-03 17:49 ` Stephen Hemminger
2022-08-10  7:20   ` Naga Harish K, S V
2022-08-10  7:09 ` [PATCH v2 3/4] timer: fix function to stop all timers Naga Harish K S V
2022-08-10 19:29   ` Carrillo, Erik G
2022-08-10 19:38     ` Stephen Hemminger
2022-08-11 15:42     ` Naga Harish K, S V
2022-08-11 15:37   ` [PATCH v3 " Naga Harish K S V
2022-08-12 16:07     ` [PATCH v4 " Naga Harish K S V
2022-08-18 13:12       ` Carrillo, Erik G

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).