]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: optimize holdtime timer cancelling
authorJorge Boncompte [DTI2] <jorge@dti2.net>
Mon, 7 May 2012 16:53:07 +0000 (16:53 +0000)
committerDavid Lamparter <equinox@opensourcerouting.org>
Tue, 22 May 2012 18:35:47 +0000 (20:35 +0200)
* bgp_packet.c: (bgp_update_receive) for every update received we queue
  an event just to cancel the holdtime timer, done in bgp_fsm_update().
  Instead cancel the timer directly an avoid a scheduling pass.

  This incidently fixes another problem found on a slow box, where thousands
of events threads were queued, and run, but never freed, because they are
moved to the unused list that grows without bounds.

Signed-off-by: Jorge Boncompte [DTI2] <jorge@dti2.net>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
bgpd/bgp_packet.c

index cfa0b57cb0f9a156d701f10ede4ace68c74a9b5d..024f5e7be64fbfbc5ab3eb54f16a2897d4030fd7 100644 (file)
@@ -1854,8 +1854,8 @@ bgp_update_receive (struct peer *peer, bgp_size_t size)
   peer->update_in++;
   peer->update_time = bgp_clock ();
 
-  /* Generate BGP event. */
-  BGP_EVENT_ADD (peer, Receive_UPDATE_message);
+  /* Cancel holdtime timer */
+  BGP_TIMER_OFF (peer->t_holdtime);
 
   return 0;
 }