]> git.proxmox.com Git - mirror_frr.git/commit - bgpd/bgp_fsm.c
bgpd: batched i/o
authorQuentin Young <qlyoung@cumulusnetworks.com>
Fri, 2 Jun 2017 01:52:39 +0000 (01:52 +0000)
committerQuentin Young <qlyoung@cumulusnetworks.com>
Thu, 30 Nov 2017 21:18:00 +0000 (16:18 -0500)
commit9eb217ff69bb8c74191f9347b73959bc17ebe7df
tree600fca6240b6fddc365fcd2ca72ad4b91c1b9ea2
parentcfdc170e1ae6622d002941961476dc3b678258b7
bgpd: batched i/o

Instead of reading a packet header and the rest of the packet in two
separate i/o cycles, instead read a chunk of data at one time and then
parse as many packets as possible out of the chunk.

Also changes bgp_packet.c to batch process packets.

To avoid thrashing on useless mutex locks, the scheduling call for
bgp_process_packet has been changed to always succeed at the cost of no
longer being cancel-able. In this case this is acceptable; following the
pattern of other event-based callbacks, an additional check in
bgp_process_packet to ignore stray events is sufficient. Before deleting
the peer all events are cleared which provides the requisite ordering.

XXX: chunk hardcoded to 5, should use something similar to wpkt_quanta

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
bgpd/bgp_fsm.c
bgpd/bgp_io.c
bgpd/bgp_packet.c
bgpd/bgpd.c