Reduce the amount of time it takes to bring up a large number of peers

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
This commit is contained in:
Donald Sharp 2015-05-19 17:40:42 -07:00
parent 4a16ae86a6
commit 5ca5f1c8af
2 changed files with 3 additions and 14 deletions

View File

@ -63,13 +63,6 @@ static int bgp_keepalive_timer (struct thread *);
/* BGP FSM functions. */
static int bgp_start (struct peer *);
/* BGP start timer jitter. */
static int
bgp_start_jitter (int time)
{
return ((rand () % (time + 1)) - (time / 2));
}
static void
peer_xfer_stats (struct peer *peer_dst, struct peer *peer_src)
{
@ -179,8 +172,6 @@ peer_xfer_conn(struct peer *from_peer)
void
bgp_timer_set (struct peer *peer)
{
int jitter = 0;
switch (peer->status)
{
case Idle:
@ -193,9 +184,8 @@ bgp_timer_set (struct peer *peer)
}
else
{
jitter = bgp_start_jitter (peer->v_start);
BGP_TIMER_ON (peer->t_start, bgp_start_timer,
peer->v_start + jitter);
peer->v_start);
}
BGP_TIMER_OFF (peer->t_connect);
BGP_TIMER_OFF (peer->t_holdtime);
@ -205,7 +195,7 @@ bgp_timer_set (struct peer *peer)
break;
case Connect:
/* After start timer is expired, the peer moves to Connnect
/* After start timer is expired, the peer moves to Connect
status. Make sure start timer is off and connect timer is
on. */
BGP_TIMER_OFF (peer->t_start);

View File

@ -787,14 +787,13 @@ struct bgp_nlri
#define BGP_EVENTS_MAX 15
/* BGP timers default value. */
#define BGP_INIT_START_TIMER 5
#define BGP_INIT_START_TIMER 1
#define BGP_ERROR_START_TIMER 30
#define BGP_DEFAULT_HOLDTIME 180
#define BGP_DEFAULT_KEEPALIVE 60
#define BGP_DEFAULT_ASORIGINATE 15
#define BGP_DEFAULT_EBGP_ROUTEADV 30
#define BGP_DEFAULT_IBGP_ROUTEADV 5
#define BGP_CLEAR_CONNECT_RETRY 20
#define BGP_DEFAULT_CONNECT_RETRY 120
/* BGP default local preference. */