vlib: handle worker sync in wait one loop 70/43370/2
authorFlorin Coras <[email protected]>
Thu, 3 Jul 2025 22:00:39 +0000 (18:00 -0400)
committerFlorin Coras <[email protected]>
Thu, 3 Jul 2025 22:05:08 +0000 (22:05 +0000)
Type: improvement

Change-Id: I8dcd9b7d305878eb385eb27481be6a241b4a024c
Signed-off-by: Florin Coras <[email protected]>
src/vlib/threads.c

index a1839e7..8c4a6fe 100644 (file)
@@ -1616,7 +1616,13 @@ vlib_worker_wait_one_loop (void)
   for (ii = 1; ii < vec_len (counts); ii++)
     {
       while (counts[ii] == vgm->vlib_mains[ii]->main_loop_count)
-       CLIB_PAUSE ();
+       {
+         /* worker sync requested, vlib_worker_sync_rpc probably pending
+          * so at least one worker cannot make any progress */
+         if (vlib_worker_threads->wait_before_barrier)
+           break;
+         CLIB_PAUSE ();
+       }
     }
 
   vec_free (counts);