mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-10 21:51:06 +00:00
Merge pull request #16035 from raja-rajasekar/rajasekarr/backpressure_infinite_loop
bgpd: backpressure - Fix to avoid CPU hog
This commit is contained in:
commit
95b1b1d3e3
@ -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)
|
void bgp_evpn_free(struct bgp *bgp, struct bgpevpn *vpn)
|
||||||
{
|
{
|
||||||
struct bgp_dest *dest = NULL;
|
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);
|
dest = zebra_announce_pop(&bm->zebra_announce_head);
|
||||||
|
ann_count--;
|
||||||
if (dest->za_vpn == vpn) {
|
if (dest->za_vpn == vpn) {
|
||||||
bgp_path_info_unlock(dest->za_bgp_pi);
|
bgp_path_info_unlock(dest->za_bgp_pi);
|
||||||
bgp_dest_unlock_node(dest);
|
bgp_dest_unlock_node(dest);
|
||||||
|
@ -3908,11 +3908,13 @@ int bgp_delete(struct bgp *bgp)
|
|||||||
int i;
|
int i;
|
||||||
struct bgp_dest *dest = NULL;
|
struct bgp_dest *dest = NULL;
|
||||||
struct graceful_restart_info *gr_info;
|
struct graceful_restart_info *gr_info;
|
||||||
|
uint32_t ann_count = zebra_announce_count(&bm->zebra_announce_head);
|
||||||
|
|
||||||
assert(bgp);
|
assert(bgp);
|
||||||
|
|
||||||
while (zebra_announce_count(&bm->zebra_announce_head)) {
|
while (ann_count) {
|
||||||
dest = zebra_announce_pop(&bm->zebra_announce_head);
|
dest = zebra_announce_pop(&bm->zebra_announce_head);
|
||||||
|
ann_count--;
|
||||||
if (dest->za_bgp_pi->peer->bgp == bgp) {
|
if (dest->za_bgp_pi->peer->bgp == bgp) {
|
||||||
bgp_path_info_unlock(dest->za_bgp_pi);
|
bgp_path_info_unlock(dest->za_bgp_pi);
|
||||||
bgp_dest_unlock_node(dest);
|
bgp_dest_unlock_node(dest);
|
||||||
|
Loading…
Reference in New Issue
Block a user