Skip to content

Commit

Permalink
zebra: Slow down fpm_process_queue
Browse files Browse the repository at this point in the history
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 <sharpd@nvidia.com>
  • Loading branch information
donaldsharp committed Oct 11, 2024
1 parent 963792e commit 8aa97a4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions zebra/dplane_fpm_nl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8aa97a4

Please sign in to comment.