summaryrefslogtreecommitdiffstats
path: root/lib/workqueue.c
Commit message (Collapse)AuthorAgeFilesLines
* Merge Quagga master branch -- as of 1-Mar-2012 -- into euro_ix_bex21bChris Hall2012-03-171-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Version 0.99.20ex21b This brings us up to date with: commit 48f99b0c2bfed8d3880732d188e1d5964f575ee4 Date: Thu Sep 29 16:55:23 2011 +0400 release: 0.99.20 and the subsequent: commit dc00d2bb56aa6a84dd2328133f69db3c3e6d9dc7 Date: Sun Jan 8 14:47:06 2012 +0000 Marker merge for 'RE-0.99.17.6' This marker merge (i.e. an 'ours' strategy merge) is a placeholder to show that all commits in Quagga-RE stable, to its release RE-0.99.17.6 tag, have been reviewed and merged into 'master'. and then further commits (in descending date order) commit b51a3a31500133e3e26f12e7639f297c655bc735 commit ef2d5d100431031c32ea35b3c834b46cff16f511 commit 4c78376f96cd2ca56f1c6476b76fd659654431f5 commit e854095932260b3e6187902aa9a7baa0e96b9428 commit e6b03b77766dce8009ad7b4a2392e14addf4ab0f commit c25eaffdb2190149e768dc4ee4efc913c6d02992 commit d034aa027ef44d0a74805c27ad2a4d8ea20395d1 commit 907fd95e502e10334e5390c73cc57588b88b8171 commit 7fd6cd819ff98f0580b745ba637990df9c20ef0f commit 4c0cf00afc4340a429a9c4830f638b4593d7c3af commit 4afa50b393ff1fb34dd577888a05b81dfdced5af commit 6eb0c5ab1d43bcf9edd4fefd19031f2b96ded728 commit aca43b656623f38dfa6ea835dacbdfec51d03a67 commit 6bb1273e83c29b3aeff9584bc8f6272e773294ad commit d660f698427277ce695a5b756f3143c8304274ea commit 6134b875f39986564aced5e2d7329fcd852f17f4 commit b4e45f67057be22133b6bec88cdf285d5c8214db commit 6eac79a6fed4842e00607c00c445213b51bba377 commit cb32fd690a957819865219a847e3c21a53a0f419 commit 73bfe0bd9adb8e4dfcee7239e56a425c6d58f4e9 commit f768f367bcd1f37a53c563495176a5a134caf234 commit c7ec179a95c1ed4fcd3d3be3f981c8c20dce534a commit cddf391bf6839e9f093cef15508669c1f3f92122 commit 5a616c08ce089e25dc0e8da920727af4d11279bf commit 6ae93c058725991df5a9ae35cefec368919b5fea commit fc98d16ea77372f4ab4231e8904f8467e8d1ef71 A summary of the changes that relate to bppd, zebra and the lib follows. bgpd changes * attribute handling: (a) now checks the flag byte for all attributes and issues suitable log messages and notifications, (b) reports some length issues that previously let slide (local pref). Tighten End-of-RIB detection -- now iff an MP_UNREACH is the *only* attribute and no ordinary update or withdraw. * added --socket/-z option -- sets zebra socket name * sets IPv6 tclass as required * improved next hop handling and added "show ip bgp scan" and "show ip bgpd scan detail" commands. see commits: fc98d16ea77372f4ab4231e8904f8467e8d1ef71 0e8032d69961ae196c11ba6ead856084c7acf7c2 b64bfc1c4a552fc0b4dd024d5f77171ec848a5df 318f0d8a7f5e8e87086bbf2a9e7c4b35638951ac 8e80bdf20f493a71bcf74262ed3aa3a2437f4df6 f04a80a5d209dbb54f6fec5d0149b7c0e489d29e * removed SAFI_UNICAST_MULTICAST * fiddled with SAFI_MPLS_LABELED_VPN -- unsure if this is now complete -- stuff here TODO ! * support for multicast SAFI see commits: 73bfe0bd9adb8e4dfcee7239e56a425c6d58f4e9 5a616c08ce089e25dc0e8da920727af4d11279bf * added "match probability" commands * uses "route_types.txt" more effectively -- which affects the implementation of "redistribute" commands see commit: e0ca5fde7be5b5ce90dae78c2477e8245aecb8e9 * "nexthop-local unchanged" included in configuration. zebra changes * some whitespace change clutter :-( * ZEBRA_HELLO and mopping up routes (BZ#448) * implement route_types.h * support for SAFI_MULTICAST commit f768f367bcd1f37a53c563495176a5a134caf234 IPv6 MP-BGP Routes addition and deletion commit cddf391bf6839e9f093cef15508669c1f3f92122 IPv4 MP-BGP Routes addition and deletion * brought up to date with RFC6275 * add --socket/-z option * add "ipv6 nd mtu <1-65535>" commands lib changes * filter-list handling -- does not free the filter-list before calling the delete_hook(). However, unlike commit 6a2e0f36b103386e57dbe3a6ee4716e809111198 *does* remove the filter-list from the name look-up, before calling the delete_hook() -- which I believe works better. * md5.c now includes RFC 2104 HMAC However fixed to remove compiler warning, by replacing use of caddr_t by unsigned char*. Some phantom whitespace changes elsewhere * prefix.c: commits d171bf58ef12ace43d48565e6870722dece1e6ed 051954f574b9c26458518a7029aeed118f0da620 9663386f16e6285a322747514527fdf1d19788e4 - optimise masklen2ip() and apply_mask_ipv4() -- the version here should work on a Big-Endian machine as well. - optimise ip_masklen() -- the version here should (a) work on a Big-Endian machine, (b) give the same result as before if the netmask is not, in fact, valid, and (c) uses just 256 bytes of table -- not 64K. Version here is probably not quite as fast as the previous patch... but certainly faster that what was there before. * zclient.c: introduced zclient_serv_path, for general zclient and for bgpd zlookup. Added ZEBRA_HELLO to client start. Added safi to ipv4 and ipv6 route add/delete.
| * general: remove inline qualifiers and move in-header functions to objectsPaul Jakma2012-01-061-1/+1
| | | | | | | | | | | | * (general) Move functions in headers into files, to be compiled into shared object files. Remove inline qualifier from functions. Let the compiler do the work.
| * lib: Make workqueue more conservative about ramping upPaul Jakma2010-12-081-8/+9
| | | | | | | | | | | | * workqueue.c: (work_queue_run) Err more on the side of keeping granularity down, by being more conservative about increasing it. Also, fix mispelling.
* | vtysh partly restored. bgpd not crashing on over-size messages.Chris Hall2012-02-191-40/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NB: this is a partial interim version -- NOT for production. Reinstate vtysh. In bgpd: cope better with generating oversize messages. The "pipework" branch is no more. There is now "euro_ix" and "euro_ix_b", where 'b' stands for 'bleedin'. The "pipework" is currently in 'bleedin'. Version updated to: 0.99.18ex20b Major changes in this commit: * modified bgpd to avoid crashing if an oversize message is created. At present, any oversize messages are simply discarded. This may be a mistake... since it is possible that some routes that should have been withdrawn are not. TBA. The stream lib facilities have been overhauled to may this easier. * restoring vtysh. At present the vtysh is thought to work, except that it does not currently create integrated configuration files. For the time being, *only* the following compile: lib, bgpd, zebra, vtysh, tests All other daemons will fail to compile, and must be disabled.
* | Bring "ex" version up to date with 0.99.18ex15pChris Hall2011-03-291-15/+16
| | | | | | | | | | | | | | | | | | Release: 0.99.18ex15p -- Pipework Branch Also fixes issue with unknown attributes -- does not release them prematurely. Contains the "bgpd: New show commands for improved view and address family support", which is post 0.99.18. (But not RFC 5082 GTSM.)
* | Revised thread/timer handling, work queue and scheduling.Chris Hall2010-02-161-103/+182
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Updated quagga thread handling to use qtimers when using the new qpnexus -- so all timers are qtimers in the new scheme. Updated work queue handling so that each work queue item is a single malloced structure, not three. (Only bgpd and zebra use the work queue system.) When using qpnexus the background thread queue is no longer a timer queue, but simply a list of pending background threads. When a background thread is waiting on a timer, it is in the qtimer pile, same like any other thread. When using qpnexus, the only remaining quagga thread queues are the event and ready queues. Revised the qpnexus loop so that only when there is nothing else to do will it consider the background threads. Revised write I/O in the BGP Engine so that all writing is via the connection's write buffer. Revised the write I/O in the Routeing Engine, so that it passes groups of updates in a single mqueue message. This all reduces the number of TCP packets sent (because BGP messages are collected together in the connection's write buffer) and reduces the number of mqueue messages involved. (No need for TCP_CORK.) Code and comments review for the new code. modified: bgpd/bgp_advertise.c modified: bgpd/bgp_common.h modified: bgpd/bgp_connection.c modified: bgpd/bgp_connection.h modified: bgpd/bgp_engine.h modified: bgpd/bgp_fsm.c modified: bgpd/bgp_main.c modified: bgpd/bgp_msg_read.c modified: bgpd/bgp_msg_write.c modified: bgpd/bgp_network.c modified: bgpd/bgp_packet.c modified: bgpd/bgp_packet.h modified: bgpd/bgp_peer.c modified: bgpd/bgp_peer_index.h modified: bgpd/bgp_route.c modified: bgpd/bgp_route_refresh.h modified: bgpd/bgp_session.c modified: bgpd/bgp_session.h modified: bgpd/bgpd.c new file: bgpd/bgpd.cx modified: lib/mqueue.h modified: lib/qpnexus.c modified: lib/qpnexus.h modified: lib/qpselect.c modified: lib/qtimers.c modified: lib/qtimers.h modified: lib/sigevent.c modified: lib/stream.c modified: lib/stream.h modified: lib/thread.c modified: lib/thread.h modified: lib/workqueue.c modified: lib/workqueue.h modified: tests/heavy-wq.c modified: zebra/zebra_rib.c
* [bgp] Fix crash on SIGHUP, deref of freed workqueuesSteve Hill2009-06-021-0/+3
| | | | | | | * lib/workqueue.c: free-ing workqueues had never been tested obviously, queue's thread was not being stopped * bgpd/bgpd.c: null out freed workqueues, to prevent acting on freed workqueues
* + initial edition of meta-queue for RIB updates processing (bug #431)Denis Ovsienko2008-06-021-14/+2
|
* + fixed bug #418 (changing address on an existing interface doesn't cause ↵Denis Ovsienko2007-11-121-5/+19
| | | | existing static routes to be revalidated)
* [lib] Trivial: fix line lengths of a comment in workqueu.cPaul Jakma2006-03-301-2/+3
| | | | | | 2006-03-30 Paul Jakma <paul.jakma@sun.com> * workqueue.c: (work_queue_run) fix line length of comment
* [lib/workqueue] remove the useless 'delay' factor.paul2006-02-021-25/+12
| | | | | | | | | | | | | | 2006-02-02 Paul Jakma <paul.jakma@sun.com> * workqueue.h: (struct work_queue) Remove the delay field. It served no purpose and just introduced bad behaviour. Should be excised before its allowed to escape into 1.0. This removes need for the 'flood' and runs_since_clear fields. * workqueue.c: (general) excise delay factor between queue runs, hence the 'flood' crap too.. See above. * bgp_route.c: (bgp_{clear_node,process}_queue_init) delay field is removed from workqueue spec.
* [workqueue] Update workqueue users callbacks to additional argumentspaul2005-11-141-2/+2
| | | | | | | | | | | | | | 2005-11-14 Paul Jakma <paul.jakma@sun.com> * (general) pass struct work-queue to callback functions. * workqueue.h: (struct work_queue) move the state flag variables to end. Add an opaque pointer to spec, for user-data global to the queue. Pass reference to work_queue to all callbacks. * workqueue.c: (work_queue_item_remove) pass ref to workqueue to user callbacks. (work_queue_run) ditto.
* 2005-11-14 Paul Jakma <paul.jakma@sun.com>paul2005-11-141-11/+27
| | | | | | | | | | | | | | | | | | | | | * (general) Add state to detect queue floods. There's no sense trying to be sparing of CPU resources, if the queue is flooding and using ever more memory resources. we should just get on with clearing the queue. The sense of delay and hold were wrong way around, fix. * workqueue.h: (struct work_queue) Add status bitfield. Add 'flood' integer to workqueue spec. Add runs_since_clear counter to workqueue. * workqueue.c: (work_queue_new) set defaults for delay, hold and flood. (work_queue_add) initial schedule should use delay, not hold. (show_work_queues) Print flood field, conserve whitespace. (work_queue_unplug) use delay, not hold. (work_queue_run) consecutive runs should be seperated by hold time, not delay. Keep track of number of consecutive runs, go into 'overdrive' if queue is being flooded, we can't avoid making heavy use of resources, better to use CPU than ever more RAM.
* 2005-05-23 Paul Jakma <paul@dishone.st>paul2005-05-231-18/+65
| | | | | | | | | | | | | | | | | | | | | | | | * workqueue.h: Add a WQ_QUEUE_BLOCKED item_status return code, to allow a queue function to indicate the queue is not ready/blocked - rather than any problem with the item at hand. Add a notion of being able to 'plug' and 'unplug' a queue. Add helpers to plug/unplug a queue. Add a completion callback, to be called when a queue is emptied. * workqueue.c: (work_queue_new) remove useless list_free. (work_queue_schedule) new internal helper function to schedule queue, if appropriate. (work_queue_add) use work_queue_schedule (show_work_queues) Print 'P' if queue is plugged. (work_queue_plug) new API function, plug a queue - ie prevent it from 'drained' / processed / scheduled. (work_queue_unplug) unplug a queue, allowing it to be drained / scheduled / processed again. (work_queue_run) Add support for WQ_QUEUE_BLOCKED. Add comment for RETRY_NOW case. Make hysteris more aggresive in ramping up granularity, improves performance significantly. Add support for calling completion callback when queue is emptied, possibly useful for knowing when to unplug a queue.
* 2005-04-27 Andrew J. Schorr <ajschorr@alumni.princeton.edu>ajs2005-04-271-3/+0
| | | | * workqueue.c (show_work_queues): Remove unused gettimeofday call.
* 2005-04-27 Paul Jakma <paul.jakma@sun.com>paul2005-04-271-10/+9
| | | | | | | | | | * workqueue.h: (struct work_queue_item) change retry_count to ran, its a count of number item has been run. * workqueue.c: (show_work_queues) Fix formating of slightly bugfix: fix SIGFPE if wq->runs is 0. (work_queue_run) retry logic was slightly wrong. cycles.best is 0 initialy, granularity is 1, so update best if cycles >= granularity, not just >.
* 2005-04-25 Paul Jakma <paul.jakma@sun.com>paul2005-04-251-0/+329
* workqueue.{c,h}: Helper API for setting up and running queues via background threads. * command.c: install the 'show workqueues' command * memtypes.c: Add work queue mtypes, and a rib-queue type for a zebra rib work queue. * memtypes.h: Updated to match memtypes.c * Makefile.am: Add new workqueue files to build.