]> git.puffer.fish Git - mirror/frr.git/commitdiff
zebra: Ensure dplane does not send work back to master at wrong time 17969/head
authorDonald Sharp <sharpd@nvidia.com>
Fri, 31 Jan 2025 17:38:20 +0000 (12:38 -0500)
committerDonald Sharp <sharpd@nvidia.com>
Fri, 31 Jan 2025 17:38:20 +0000 (12:38 -0500)
When looping through the dplane providers, the worklist was
being populated with items from the last provider and then
the event system was checked to see if we should stop processing.
If the event system says `yes` then the dplane code would stop
and send the worklist to the master zebra pthread for collection.
This obviously skipped the next dplane provider on the list
which is double plus not good.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
zebra/zebra_dplane.c

index b57c930154dc89d7c07d86181b9ae753e68d53b2..9acdb4b2f8c60c62ceaba23c92ba5664d0902c6c 100644 (file)
@@ -7528,6 +7528,16 @@ static void dplane_thread_loop(struct event *event)
                if (!zdplane_info.dg_run)
                        break;
 
+               /*
+                * The yield should only happen after a bit of work has been
+                * done but before we pull any new work off any provider
+                * queue to continue looping.  This is a safe spot to
+                * do so.
+                */
+               if (event_should_yield(event)) {
+                       reschedule = true;
+                       break;
+               }
                /* Locate next provider */
                next_prov = dplane_prov_list_next(&zdplane_info.dg_providers,
                                                  prov);
@@ -7592,11 +7602,6 @@ static void dplane_thread_loop(struct event *event)
                        zlog_debug("dplane dequeues %d completed work from provider %s",
                                   counter, dplane_provider_get_name(prov));
 
-               if (event_should_yield(event)) {
-                       reschedule = true;
-                       break;
-               }
-
                /* Locate next provider */
                prov = next_prov;
        }