Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FRR pthread improvements #1672

Merged
merged 4 commits into from
Jan 26, 2018
Merged

Commits on Jan 24, 2018

  1. lib: streamline frr_pthreads, add default loop

    Some work on FRR's pthread wrapper.
    
    * Provide a built-in way to synchronize thread startup
    * Make utility functions take frr_pthread * instead of its integer ID
    * Pass frr_pthread * as pthread start function argument
    * Correct some comment styling
    * Rename some variables to match naming conventions in the file
    * Change parameter ordering in stop function prototype to follow the
      convention in the other functions
    * Default new frr_pthreads to using a vanilla event loop
    
    For the last point, the original goal when designing the implementation
    of pthreads into FRR was to be able to use the thread.c event based
    system inside pthreads. This code essentially encapuslates all the
    thread.c functionality into an easy to use pthread out of the box.
    Creating a new frr_pthread with a null attributes field will cause the
    created frr_pthread to run a thread.c event loop. The upshot of this is
    that it is now possible to safely run existing functions in a pthread in
    roughly 3 lines of code. It also serves as an example / starting point
    for others.
    
    Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
    qlyoung committed Jan 24, 2018
    Configuration menu
    Copy the full SHA
    a45dc97 View commit details
    Browse the repository at this point in the history
  2. bgpd: update pthreads to use lib changes

    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>
    qlyoung committed Jan 24, 2018
    Configuration menu
    Copy the full SHA
    a715eab View commit details
    Browse the repository at this point in the history
  3. tests: make tests happy for pthread changes

    Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
    qlyoung committed Jan 24, 2018
    Configuration menu
    Copy the full SHA
    cadc5f3 View commit details
    Browse the repository at this point in the history
  4. bgpd: check flags before attempting keepalive ops

    If a peer already has keepalives turned on when asking to turn them on,
    return immediately. Same thing for turning them off.
    
    Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
    qlyoung committed Jan 24, 2018
    Configuration menu
    Copy the full SHA
    096476d View commit details
    Browse the repository at this point in the history