All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] event/dlb2: race condition during dynamic linking
@ 2026-10-21 17:20 Pravin Pathak
  2026-10-22 16:46 ` Sarkar, Tirthendu
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Pravin Pathak @ 2026-10-21 17:20 UTC (permalink / raw)
  To: dev
  Cc: jerinj, tirthendu.sarkar, bruce.richardson, thomas,
	david.marchand, pravin.pathak.dev

dlb2 handles dynamic linking and linking asynchronously if queues
being linked/unlinked have traffic. It starts a thread if not already
started to handle the process. This change avoids the race condition
in thread creation where sometimes the thread starts immediately,
descheduling the calling thread and finishes the job and exits, and then
caller sets worker launched true when the thread is not running.

Signed-off-by: Pravin Pathak <pravin.pathak.dev@gmail.com>
---
 drivers/event/dlb2/pf/base/dlb2_osdep.h | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/event/dlb2/pf/base/dlb2_osdep.h b/drivers/event/dlb2/pf/base/dlb2_osdep.h
index 382a49090a..1505563f83 100644
--- a/drivers/event/dlb2/pf/base/dlb2_osdep.h
+++ b/drivers/event/dlb2/pf/base/dlb2_osdep.h
@@ -208,14 +208,16 @@ static inline void os_schedule_work(struct dlb2_hw *hw)
 
 	dlb2_dev = container_of(hw, struct dlb2_dev, hw);
 
+	dlb2_dev->worker_launched = true;
+
 	ret = rte_thread_create_internal_control(&complete_queue_map_unmap_thread,
 			"dlb-qunmap", dlb2_complete_queue_map_unmap, dlb2_dev);
-	if (ret)
+	if (ret) {
 		DLB2_ERR(dlb2_dev,
 			 "Could not create queue complete map/unmap thread, err=%d\n",
 			 ret);
-	else
-		dlb2_dev->worker_launched = true;
+		dlb2_dev->worker_launched = false;
+	}
 }
 
 /**
-- 
2.53.0


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

end of thread, other threads:[~2026-10-27 21:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-21 17:20 [PATCH v1] event/dlb2: race condition during dynamic linking Pravin Pathak
2026-10-22 16:46 ` Sarkar, Tirthendu
2026-10-23 12:49   ` Jerin Jacob
2026-10-22 16:51 ` Bruce Richardson
2026-10-27 21:00 ` Stephen Hemminger

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.