From 963792e8c5ba834f1f7bb2555e90aa4b2ff6f33c Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Thu, 10 Oct 2024 16:00:08 -0400 Subject: [PATCH 1/3] zebra: Only notify dplane work pthread when needed The fpm_nl_process function was getting the count of the total number of ctx's processed. This leads to after having processed 1 context to always signal the dataplane that there is work to do. Change the code to only notify the dplane worker when a context was actually added to the outgoing context queue. Signed-off-by: Donald Sharp --- zebra/dplane_fpm_nl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zebra/dplane_fpm_nl.c b/zebra/dplane_fpm_nl.c index d594fc2c8640..0e54952eea2c 100644 --- a/zebra/dplane_fpm_nl.c +++ b/zebra/dplane_fpm_nl.c @@ -1525,7 +1525,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(); } From 8aa97a439fc21c66132fdaf8ce0113e16801be04 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Thu, 10 Oct 2024 20:08:32 -0400 Subject: [PATCH 2/3] zebra: Slow down fpm_process_queue When the fpm_process_queue has run out of space but has written to the fpm output buffer, schedule it to wake up immediately, as that the write will go out pretty much immediately, since it was scheduled first. If the fpm_process_queue has not written to the output buffer then delay the processing by 10 milliseconds to allow a possibly backed up write processing to have a chance to complete it's work. Signed-off-by: Donald Sharp --- zebra/dplane_fpm_nl.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/zebra/dplane_fpm_nl.c b/zebra/dplane_fpm_nl.c index 0e54952eea2c..4fb57d84d98f 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 From cf2624a993fd6992fbbce75434a5aefe22ce0bc2 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Fri, 11 Oct 2024 09:33:35 -0400 Subject: [PATCH 3/3] fpm: Allow max fpm message size to float based on ecmp Currently the max message size is 4k. With a 256 way ecmp FRR is seeing message sizes that are in the 6k size. There is desire to allow this to increase as well to 512. Since the multipath size directly effects how big the message may be when sending the routes ecmp let's give a bit of headroom for this value when compiling FRR at greater sizes. Additionally since we know not everyone is using such large ecmp, allow them to build as appropriate for their use cases. Signed-off-by: Donald Sharp --- fpm/fpm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fpm/fpm.h b/fpm/fpm.h index 70c0df57157e..9003c643b00c 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)