From: Mark Stapp Date: Wed, 16 Apr 2025 13:16:40 +0000 (-0400) Subject: Merge pull request #18497 from krishna-samy/show-metaq-counters X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=1ca756f315949b883584411bfe135f3b93f2b047;p=mirror%2Ffrr.git Merge pull request #18497 from krishna-samy/show-metaq-counters zebra: show command to display metaq info --- 1ca756f315949b883584411bfe135f3b93f2b047 diff --cc zebra/zebra_rib.c index e32b004ae9,a1975b8e67..c7dc5e5d07 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c @@@ -3300,10 -3359,19 +3359,19 @@@ static int rib_meta_queue_add(struct me listnode_add(mq->subq[qindex], rn); route_lock_node(rn); mq->size++; + atomic_fetch_add_explicit(&mq->total_metaq, 1, memory_order_relaxed); + atomic_fetch_add_explicit(&mq->total_subq[qindex], 1, memory_order_relaxed); + curr = listcount(mq->subq[qindex]); + high = atomic_load_explicit(&mq->max_subq[qindex], memory_order_relaxed); + if (curr > high) + atomic_store_explicit(&mq->max_subq[qindex], curr, memory_order_relaxed); + high = atomic_load_explicit(&mq->max_metaq, memory_order_relaxed); + if (mq->size > high) + atomic_store_explicit(&mq->max_metaq, mq->size, memory_order_relaxed); if (IS_ZEBRA_DEBUG_RIB_DETAILED) - rnode_debug(rn, re->vrf_id, "queued rn %p into sub-queue %s", - (void *)rn, subqueue2str(qindex)); + rnode_debug(rn, re->vrf_id, "queued rn %p into sub-queue %s mq size %u", (void *)rn, + subqueue2str(qindex), zrouter.mq->size); return 0; } @@@ -3333,10 -3415,19 +3415,19 @@@ static int rib_meta_queue_nhg_ctx_add(s listnode_add(mq->subq[qindex], w); mq->size++; + atomic_fetch_add_explicit(&mq->total_metaq, 1, memory_order_relaxed); + atomic_fetch_add_explicit(&mq->total_subq[qindex], 1, memory_order_relaxed); + curr = listcount(mq->subq[qindex]); + high = atomic_load_explicit(&mq->max_subq[qindex], memory_order_relaxed); + if (curr > high) + atomic_store_explicit(&mq->max_subq[qindex], curr, memory_order_relaxed); + high = atomic_load_explicit(&mq->max_metaq, memory_order_relaxed); + if (mq->size > high) + atomic_store_explicit(&mq->max_metaq, mq->size, memory_order_relaxed); if (IS_ZEBRA_DEBUG_RIB_DETAILED) - zlog_debug("NHG Context id=%u queued into sub-queue %s", - ctx->id, subqueue2str(qindex)); + zlog_debug("NHG Context id=%u queued into sub-queue %s mq size %u", ctx->id, + subqueue2str(qindex), zrouter.mq->size); return 0; } @@@ -3361,10 -3453,19 +3453,19 @@@ static int rib_meta_queue_nhg_process(s listnode_add(mq->subq[qindex], w); mq->size++; + atomic_fetch_add_explicit(&mq->total_metaq, 1, memory_order_relaxed); + atomic_fetch_add_explicit(&mq->total_subq[qindex], 1, memory_order_relaxed); + curr = listcount(mq->subq[qindex]); + high = atomic_load_explicit(&mq->max_subq[qindex], memory_order_relaxed); + if (curr > high) + atomic_store_explicit(&mq->max_subq[qindex], curr, memory_order_relaxed); + high = atomic_load_explicit(&mq->max_metaq, memory_order_relaxed); + if (mq->size > high) + atomic_store_explicit(&mq->max_metaq, mq->size, memory_order_relaxed); if (IS_ZEBRA_DEBUG_RIB_DETAILED) - zlog_debug("NHG id=%u queued into sub-queue %s", nhe->id, - subqueue2str(qindex)); + zlog_debug("NHG id=%u queued into sub-queue %s mq size %u", nhe->id, + subqueue2str(qindex), zrouter.mq->size); return 0; } @@@ -4227,11 -4334,22 +4339,22 @@@ void _route_entry_dump(const char *func static int rib_meta_queue_gr_run_add(struct meta_queue *mq, void *data) { + uint64_t curr, high; + listnode_add(mq->subq[META_QUEUE_GR_RUN], data); mq->size++; + atomic_fetch_add_explicit(&mq->total_metaq, 1, memory_order_relaxed); + atomic_fetch_add_explicit(&mq->total_subq[META_QUEUE_GR_RUN], 1, memory_order_relaxed); + curr = listcount(mq->subq[META_QUEUE_GR_RUN]); + high = atomic_load_explicit(&mq->max_subq[META_QUEUE_GR_RUN], memory_order_relaxed); + if (curr > high) + atomic_store_explicit(&mq->max_subq[META_QUEUE_GR_RUN], curr, memory_order_relaxed); + high = atomic_load_explicit(&mq->max_metaq, memory_order_relaxed); + if (mq->size > high) + atomic_store_explicit(&mq->max_metaq, mq->size, memory_order_relaxed); if (IS_ZEBRA_DEBUG_RIB_DETAILED) - zlog_debug("Graceful Run adding"); + zlog_debug("Graceful Run adding mq size %u", zrouter.mq->size); return 0; }