summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_keepalives.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* bgpd: update pthreads to use lib changesQuentin Young2018-01-241-1/+1
| | | | | | | | | | | | Use the new threading facilities provided in lib/ to streamline the threads used in bgpd. In particular, all of the lifecycle code has been removed from the I/O thread and replaced with the default loop. Did not do the same to the keepalives thread as it is much smaller (doesn't need the event system). Also cleaned up some comments to match the style guide. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* bgpd, tests: comment formattingQuentin Young2017-11-301-8/+13
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* bgpd: restyle bgp_keepalives.[ch]Quentin Young2017-11-301-23/+17
| | | | | | And update copyright header. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* bgpd: rename peer_keepalives* --> bgp_keepalives*Quentin Young2017-11-301-9/+9
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* bgpd: implement buffered readsQuentin Young2017-11-301-1/+2
| | | | | | | | | | | | | | | | * Move and modify all network input related code to bgp_io.c * Add a real input buffer to `struct peer` * Move connection initialization to its own thread.c task instead of piggybacking off of bgp_read() * Tons of little fixups Primary changes are in bgp_packet.[ch], bgp_io.[ch], bgp_fsm.[ch]. Changes made elsewhere are almost exclusively refactoring peer->ibuf to peer->curr since peer->ibuf is now the true FIFO packet input buffer while peer->curr represents the packet currently being processed by the main pthread. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* bgpd: use new threading infraQuentin Young2017-11-301-0/+3
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* bgpd: dynamically allocate synchronization primitivesQuentin Young2017-11-301-0/+7
| | | | | | | | | | | | | | Changes all synchronization primitives to be dynamically allocated. This should help catch any subtle errors in pthread lifecycles. This change also pre-initializes synchronization primitives before threads begin to run, eliminating a potential race condition that probably would have caused a segfault on startup on a very fast box. Also changes mutex and condition variable allocations to use MTYPE_PTHREAD and updates tests to do the proper initializations. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* bgpd: put BGP keepalives in a pthreadQuentin Young2017-11-301-0/+83
This patch, in tandem with moving packet writes into a dedicated kernel thread, fixes session flaps caused by long-running internal operations starving the (old) userspace write thread. BGP keepalives are now produced by a kernel thread and placed onto the peer's output queue. These are then consumed by the write thread. Both of these tasks are concurrent with the rest of bgpd, obviating the session flaps described above. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>