Skip to content

Commit

Permalink
Porting Zebra fpm backpressure to dplane_fpm_sonic
Browse files Browse the repository at this point in the history
Apply the following patch to dplane_fpm_sonic:
* Zebra fpm backpressure (FRRouting/frr#16220)

Signed-off-by: cscarpitta <cscarpit@cisco.com>
  • Loading branch information
cscarpitta committed Dec 12, 2024
1 parent 73226ca commit d07db9f
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/sonic-frr/dplane_fpm_sonic/dplane_fpm_sonic.c
Original file line number Diff line number Diff line change
Expand Up @@ -2172,6 +2172,25 @@ static int fpm_nl_process(struct zebra_dplane_provider *prov)

fnc = dplane_provider_get_data(prov);
limit = dplane_provider_get_work_limit(prov);

frr_with_mutex (&fnc->ctxqueue_mutex) {
cur_queue = dplane_ctx_queue_count(&fnc->ctxqueue);
}

if (cur_queue >= (uint64_t)limit) {
if (IS_ZEBRA_DEBUG_FPM)
zlog_debug("%s: Already at a limit(%" PRIu64
") of internal work, hold off",
__func__, cur_queue);
limit = 0;
} else {
if (IS_ZEBRA_DEBUG_FPM)
zlog_debug("%s: current queue is %" PRIu64
", limiting to lesser amount of %" PRIu64,•
__func__, cur_queue, limit - cur_queue);
limit -= cur_queue;
}

for (counter = 0; counter < limit; counter++) {
ctx = dplane_provider_dequeue_in_ctx(prov);
if (ctx == NULL)
Expand Down

0 comments on commit d07db9f

Please sign in to comment.