From d0dcbe07baffdbff39521e5ae8eca3f80a8d6f3e Mon Sep 17 00:00:00 2001 From: Chris Hall Date: Thu, 27 May 2010 21:09:56 +0100 Subject: Adjustments to scheduling of Routing Engine work. These changes mean that Quagga copes a little better when there are very large numbers of updates/withrawal messages arriving all at once... ...it is not possible to cure the problem of overloading Quagga by throwing too much at it. However, these changes at least mean that when BGP sessions drop, the Routing Engine will notice that in a reasonable time, and can clear up all routes associated with the session (throwing away any updates/withdraws already received, but not yet dealt with.) Amonst these changes are Chris Caputo's patches for bgp_node locking issues -- see quagga-dev 7960 mailing list message. --- bgpd/bgp_route.c | 73 ++++++++++++++++++++++++++++++++------------------------ 1 file changed, 42 insertions(+), 31 deletions(-) (limited to 'bgpd/bgp_route.c') diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 6553b3ff..ff7dada3 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -6860,7 +6860,10 @@ bgp_show_route_in_table (struct vty *vty, struct bgp *bgp, if ((rm = bgp_node_match (table, &match)) != NULL) { if (prefix_check && rm->p.prefixlen != match.prefixlen) - continue; + { + bgp_unlock_node (rm); + continue; + } for (ri = rm->info; ri; ri = ri->info_next) { @@ -6874,6 +6877,8 @@ bgp_show_route_in_table (struct vty *vty, struct bgp *bgp, display++; route_vty_out_detail (vty, bgp, &rm->p, ri, AFI_IP, SAFI_MPLS_VPN); } + + bgp_unlock_node (rm); } } } @@ -11655,41 +11660,47 @@ bgp_clear_damp_route (struct vty *vty, const char *view_name, if ((table = rn->info) != NULL) if ((rm = bgp_node_match (table, &match)) != NULL) - if (! prefix_check || rm->p.prefixlen == match.prefixlen) - { - ri = rm->info; - while (ri) - { - if (ri->extra && ri->extra->damp_info) - { - ri_temp = ri->info_next; - bgp_damp_info_free (ri->extra->damp_info, 1); - ri = ri_temp; - } - else - ri = ri->info_next; - } - } + { + if (! prefix_check || rm->p.prefixlen == match.prefixlen) + { + ri = rm->info; + while (ri) + { + if (ri->extra && ri->extra->damp_info) + { + ri_temp = ri->info_next; + bgp_damp_info_free (ri->extra->damp_info, 1); + ri = ri_temp; + } + else + ri = ri->info_next; + } + } + bgp_unlock_node (rm); + } } } else { if ((rn = bgp_node_match (bgp->rib[afi][safi], &match)) != NULL) - if (! prefix_check || rn->p.prefixlen == match.prefixlen) - { - ri = rn->info; - while (ri) - { - if (ri->extra && ri->extra->damp_info) - { - ri_temp = ri->info_next; - bgp_damp_info_free (ri->extra->damp_info, 1); - ri = ri_temp; - } - else - ri = ri->info_next; - } - } + { + if (! prefix_check || rn->p.prefixlen == match.prefixlen) + { + ri = rn->info; + while (ri) + { + if (ri->extra && ri->extra->damp_info) + { + ri_temp = ri->info_next; + bgp_damp_info_free (ri->extra->damp_info, 1); + ri = ri_temp; + } + else + ri = ri->info_next; + } + } + bgp_unlock_node (rn); + } } return CMD_SUCCESS; -- cgit v1.2.3