Merge pull request #17062 from donaldsharp/dplane_fpm_nl_problems

zebra: Only notify dplane work pthread when needed
This commit is contained in:
Donatas Abraitis 2024-10-14 08:14:34 +03:00 committed by GitHub
commit d1433ee9a8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 4 deletions

View file

@ -65,7 +65,7 @@
/* /*
* Largest message that can be sent to or received from the FPM. * 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 #ifdef __SUNPRO_C
#pragma pack(1) #pragma pack(1)

View file

@ -1512,8 +1512,12 @@ static void fpm_process_queue(struct event *t)
/* Re-schedule if we ran out of buffer space */ /* Re-schedule if we ran out of buffer space */
if (no_bufs) { if (no_bufs) {
event_add_event(fnc->fthread->master, fpm_process_queue, fnc, 0, if (processed_contexts)
&fnc->t_dequeue); 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, event_add_timer(fnc->fthread->master, fpm_process_wedged, fnc,
DPLANE_FPM_NL_WEDGIE_TIME, &fnc->t_wedged); DPLANE_FPM_NL_WEDGIE_TIME, &fnc->t_wedged);
} else } else
@ -1525,7 +1529,7 @@ static void fpm_process_queue(struct event *t)
* until the dataplane thread gets scheduled for new, * until the dataplane thread gets scheduled for new,
* unrelated work. * unrelated work.
*/ */
if (dplane_provider_out_ctx_queue_len(fnc->prov) > 0) if (processed_contexts)
dplane_provider_work_ready(); dplane_provider_work_ready();
} }