]> git.puffer.fish Git - mirror/frr.git/commit
bgpd: Modify bgp to handle packet events in a FIFO
authorDonald Sharp <sharpd@nvidia.com>
Fri, 21 Mar 2025 11:48:50 +0000 (07:48 -0400)
committerDonald Sharp <sharpd@nvidia.com>
Tue, 25 Mar 2025 13:10:46 +0000 (09:10 -0400)
commit12bf042c688fedf82637fab9ff77aa1eab271160
treec843f30f8d18fa4c03591c755b0805ba9a32a6af
parentf3790640d32908065dac91d84a687a98001dca25
bgpd: Modify bgp to handle packet events in a FIFO

Current behavor of BGP is to have a event per connection.  Given
that on startup of BGP with a high number of neighbors you end
up with 2 * # of peers events that are being processed.  Additionally
once BGP has selected the connection this still only comes down
to 512 events.  This number of events is swamping the event system
and in addition delaying any other work from being done in BGP at
all because the the 512 events are always going to take precedence
over everything else.  The other main events are the handling
of the metaQ(1 event), update group events( 1 per update group )
and the zebra batching event.  These are being swamped.

Modify the BGP code to have a FIFO of connections.  As new data
comes in to read, place the connection on the end of the FIFO.
Have the bgp_process_packet handle up to 100 packets spread
across the individual peers where each peer/connection is limited
to the original quanta.  During testing I noticed that withdrawal
events at very very large scale are taking up to 40 seconds to process
so I added a check for yielding to further limit the number of packets
being processed.

This change also allow for BGP to be interactive again on scale
setups on initial convergence.  Prior to this change any vtysh
command entered would be delayed by 10's of seconds in my setup
while BGP was doing other work.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
bgpd/bgp_fsm.c
bgpd/bgp_io.c
bgpd/bgp_io.h
bgpd/bgp_main.c
bgpd/bgp_packet.c
bgpd/bgpd.c
bgpd/bgpd.h