summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas@opensourcerouting.org>2024-10-14 08:14:34 +0300
committerGitHub <noreply@github.com>2024-10-14 08:14:34 +0300
commitd1433ee9a8fa374ee653dcf1fe6e852481b17119 (patch)
tree499be8967149c5be35e65dace59a9f1d784309d1
parentc45e1066a29a3a4c499d07ffc602832a4476f6d5 (diff)
parentcf2624a993fd6992fbbce75434a5aefe22ce0bc2 (diff)
Merge pull request #17062 from donaldsharp/dplane_fpm_nl_problems
zebra: Only notify dplane work pthread when needed
-rw-r--r--fpm/fpm.h2
-rw-r--r--zebra/dplane_fpm_nl.c10
2 files changed, 8 insertions, 4 deletions
diff --git a/fpm/fpm.h b/fpm/fpm.h
index 70c0df5715..9003c643b0 100644
--- a/fpm/fpm.h
+++ b/fpm/fpm.h
@@ -65,7 +65,7 @@
/*
* Largest message that can be sent to or received from the FPM.
*/
-#define FPM_MAX_MSG_LEN 4096
+#define FPM_MAX_MSG_LEN MAX(MULTIPATH_NUM * 32, 4096)
#ifdef __SUNPRO_C
#pragma pack(1)
diff --git a/zebra/dplane_fpm_nl.c b/zebra/dplane_fpm_nl.c
index d594fc2c86..4fb57d84d9 100644
--- a/zebra/dplane_fpm_nl.c
+++ b/zebra/dplane_fpm_nl.c
@@ -1512,8 +1512,12 @@ static void fpm_process_queue(struct event *t)
/* Re-schedule if we ran out of buffer space */
if (no_bufs) {
- event_add_event(fnc->fthread->master, fpm_process_queue, fnc, 0,
- &fnc->t_dequeue);
+ if (processed_contexts)
+ event_add_event(fnc->fthread->master, fpm_process_queue, fnc, 0,
+ &fnc->t_dequeue);
+ else
+ event_add_timer_msec(fnc->fthread->master, fpm_process_queue, fnc, 10,
+ &fnc->t_dequeue);
event_add_timer(fnc->fthread->master, fpm_process_wedged, fnc,
DPLANE_FPM_NL_WEDGIE_TIME, &fnc->t_wedged);
} else
@@ -1525,7 +1529,7 @@ static void fpm_process_queue(struct event *t)
* until the dataplane thread gets scheduled for new,
* unrelated work.
*/
- if (dplane_provider_out_ctx_queue_len(fnc->prov) > 0)
+ if (processed_contexts)
dplane_provider_work_ready();
}