summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_evpn.c
diff options
context:
space:
mode:
authorRajasekar Raja <rajasekarr@nvidia.com>2024-05-18 00:43:59 +0200
committerRajasekar Raja <rajasekarr@nvidia.com>2024-05-18 00:43:59 +0200
commit920bf45e101c2163f4ed4a6d354026609e1eaeca (patch)
tree7a4e47cc298ffe0e7cf0124ed506fce47dbb0c3f /bgpd/bgp_evpn.c
parentMerge pull request #16012 from LabNConsulting/chopps/improve-grpc-test (diff)
downloadfrr-920bf45e101c2163f4ed4a6d354026609e1eaeca.tar.xz
frr-920bf45e101c2163f4ed4a6d354026609e1eaeca.zip
bgpd: backpressure - Fix to avoid CPU hog
In case when bgp_evpn_free or bgp_delete is called and the announce_list has few items where vpn/bgp does not match, we add the item back to the list. Because of this the list count is always > 0 thereby hogging CPU or infinite loop. Ticket: #3905624 Signed-off-by: Rajasekar Raja <rajasekarr@nvidia.com>
Diffstat (limited to 'bgpd/bgp_evpn.c')
-rw-r--r--bgpd/bgp_evpn.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/bgpd/bgp_evpn.c b/bgpd/bgp_evpn.c
index 1c3b4e05c..ce9666d61 100644
--- a/bgpd/bgp_evpn.c
+++ b/bgpd/bgp_evpn.c
@@ -6317,9 +6317,11 @@ struct bgpevpn *bgp_evpn_new(struct bgp *bgp, vni_t vni,
void bgp_evpn_free(struct bgp *bgp, struct bgpevpn *vpn)
{
struct bgp_dest *dest = NULL;
+ uint32_t ann_count = zebra_announce_count(&bm->zebra_announce_head);
- while (zebra_announce_count(&bm->zebra_announce_head)) {
+ while (ann_count) {
dest = zebra_announce_pop(&bm->zebra_announce_head);
+ ann_count--;
if (dest->za_vpn == vpn) {
bgp_path_info_unlock(dest->za_bgp_pi);
bgp_dest_unlock_node(dest);