diff options
| author | Donald Sharp <sharpd@nvidia.com> | 2025-01-31 12:38:20 -0500 |
|---|---|---|
| committer | Mergify <37929162+mergify[bot]@users.noreply.github.com> | 2025-02-04 16:18:59 +0000 |
| commit | 35cd931347d76fb874156b4ecc26524df648e930 (patch) | |
| tree | 5aece242d61d6c621bcc1739b56e4304ff9de914 | |
| parent | 0e695f7083bcd979c24504eade6f93e965eeb845 (diff) | |
zebra: Ensure dplane does not send work back to master at wrong time
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>
(cherry picked from commit c41155221e7fb7890fecc37f1685063dce6caaca)
| -rw-r--r-- | zebra/zebra_dplane.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/zebra/zebra_dplane.c b/zebra/zebra_dplane.c index 00e990e856..910e52160b 100644 --- a/zebra/zebra_dplane.c +++ b/zebra/zebra_dplane.c @@ -7472,6 +7472,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); @@ -7536,11 +7546,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; } |
