]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: backpressure - Improve debuggability 16404/head
authorRajasekar Raja <rajasekarr@nvidia.com>
Thu, 11 Jul 2024 03:17:14 +0000 (20:17 -0700)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Tue, 16 Jul 2024 16:15:32 +0000 (16:15 +0000)
Improve debuggability in backpressure code.

Ticket :#3980988

Signed-off-by: Rajasekar Raja <rajasekarr@nvidia.com>
(cherry picked from commit 186db96c06e4f44b4450fcba88f0fa680ee0b92d)

bgpd/bgpd.c

index a5ba540135317437cafde6691f47c82e755dc706..08d1268e9e6bf42fda1190a36045a9d106b75487 100644 (file)
@@ -3916,6 +3916,7 @@ int bgp_delete(struct bgp *bgp)
        struct bgp_dest *dest_next = NULL;
        struct bgp_table *dest_table = NULL;
        struct graceful_restart_info *gr_info;
+       uint32_t cnt_before, cnt_after;
 
        assert(bgp);
 
@@ -3923,6 +3924,7 @@ int bgp_delete(struct bgp *bgp)
         * Iterate the pending dest list and remove all the dest pertaininig to
         * the bgp under delete.
         */
+       cnt_before = zebra_announce_count(&bm->zebra_announce_head);
        for (dest = zebra_announce_first(&bm->zebra_announce_head); dest;
             dest = dest_next) {
                dest_next = zebra_announce_next(&bm->zebra_announce_head, dest);
@@ -3934,6 +3936,11 @@ int bgp_delete(struct bgp *bgp)
                }
        }
 
+       cnt_after = zebra_announce_count(&bm->zebra_announce_head);
+       if (BGP_DEBUG(zebra, ZEBRA))
+               zlog_debug("Zebra Announce Fifo cleanup count before %u and after %u during BGP %s deletion",
+                          cnt_before, cnt_after, bgp->name_pretty);
+
        bgp_soft_reconfig_table_task_cancel(bgp, NULL, NULL);
 
        /* make sure we withdraw any exported routes */