Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bgpd: backpressure - Fix to avoid CPU hog #16035

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion bgpd/bgp_evpn.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 3 additions & 1 deletion bgpd/bgpd.c
Original file line number Diff line number Diff line change
Expand Up @@ -3908,11 +3908,13 @@ int bgp_delete(struct bgp *bgp)
int i;
struct bgp_dest *dest = NULL;
struct graceful_restart_info *gr_info;
uint32_t ann_count = zebra_announce_count(&bm->zebra_announce_head);

assert(bgp);

while (zebra_announce_count(&bm->zebra_announce_head)) {
while (ann_count) {
dest = zebra_announce_pop(&bm->zebra_announce_head);
ann_count--;
if (dest->za_bgp_pi->peer->bgp == bgp) {
bgp_path_info_unlock(dest->za_bgp_pi);
bgp_dest_unlock_node(dest);
Expand Down
Loading