Age | Commit message (Collapse) | Author |
|
* rib.h: (struct rib) Add lock field for refcounting.
* zserv.h: (struct zebra_t) Add a ribq workqueue to the zebra
'master' struct.
* zserv.c: (zread_ipv4_add) XMALLOC then memset should be XCALLOC.
* zebra_rib.c: Clean up refcounting of route_node, make struct rib
refcounted and convert rib_process to work-queue. In general,
rib's should be rib_addnode'd and delnode'd to route_nodes, and
these symmetrical functions will manage the locking of referenced
route_node and freeing of struct rib - rather than having users
manage each seperately - with much scope for bugs..
(newrib_free) removed and replaced with rib_lock
(rib_lock) new function, check state of lock and increment.
(rib_unlock) new function, check lock state and decrement. Free
struct rib if refcount hits 0, freeing struct nexthop's, as
newrib_free did.
(rib_addnode) Add RIB to route_node, locking both.
(rib_delnode) Delete RIB from route_node, unlocking each.
(rib_process) Converted to a work-queue work function.
Functional changes are minimal, just arguments, comments and
whitespace.
(rib_queue_add_qnode) Helper function to setup a ribq item.
(rib_queue_add) Helper function, same arguments as old
rib_process, to replace in callers of rib_process.
(rib_queue_qnode_del) ribq deconstructor.
(rib_queue_init) Create the ribq.
(rib_init) call rib_queue_init.
(remainder) Sanitise refcounting of route_node's. Convert to
rib_queue_add, rib_addnode and rib_delnode. Change XMALLOC/memset
to XCALLOC. Remove calls to nexthop_delete and nexthop_free.
|
|
Add wall-clock timing statistics to 'show thread cpu' output.
* thread.h: Define struct rusage_t to contain wall-clock time
and cpu time. Change GETRUSAGE macro to collect both pieces
of data. Make appropriate changes to struct cpu_thread_history
to track CPU time and real time. Change proto for
thread_consumed_time to return real and cpu time elapsed.
And declare a new global variable 'struct timeval recent_time'.
* thread.c (struct timeval recent_time): New global timestamp variable.
(timeval_adjust): If timeout is negative, set to 0 (not 10
microseconds). And remove upper bound of 1,000,000 seconds, since
this does not seem to make any sense (and it breaks
funcname_thread_add_timer_timeval).
(timeval_cmp): Should return long, not int.
(vty_out_cpu_thread_history): Show CPU time and real time.
(cpu_record_hash_print): Calculate totals for CPU and real time.
(cpu_record_print): Change 'show thread cpu' title to show CPU and
real time.
(thread_timer_remain_second): Put current time in global recent_time.
(funcname_thread_add_timer_timeval): Fix assert. Replace 2-case
switch assignment with a ternary expression. Use global recent_time
variable. Fix use of timeval_adjust (previously, the value was not
actually being adjusted).
(thread_cancel): Add missing "break" statement in case
THREAD_BACKGROUND.
(thread_timer_wait): Use global recent_time value instead of calling
gettimeofday. And there's no need to check for negative timeouts,
since timeval_subtract already sets these to zero.
(thread_timer_process): Timers are sorted, so bail out once we
encounter a timer that has not yet popped. And remove some
extraneous asserts.
(thread_fetch): Do not process foreground timers before calling
select. Instead, add them to the ready list just after the select.
Also, no need to maintain a count of the number of ready threads,
since we don't care how many there are, just whether there's
one at the head of the ready list (which is easily checked).
Stick current time in global variable recent_time to reduce
the number of calls to gettimeofday. Tighten logic for
calculating the select timeout.
(thread_consumed_time): Now returns real time and puts the elapsed
cpu time in an additional argument.
(thread_should_yield): Use real (wall-clock) time to decide whether
to yield.
(thread_call): Maintain CPU and real time statistics.
* vty.c (vty_command): For slow commands, show real and cpu time.
|
|
* workqueue.c (show_work_queues): Remove unused gettimeofday call.
|
|
* memory.h: memtypes is built source, default includes points to
top_builddir, so we should refer to lib/memtypes.h
|
|
* 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 >.
|
|
* buffer.c (buffer_write): Comment out call to buffer_flush_available.
This should speed up buffering at the expense of a possible increase
in latency in flushing the data if inside a long-running thread.
|
|
* quagga.xml.in: New, better, single integrated manifest for all
the services, courtesy of alan.maguire@sun.com.
* {{ospf,ospf6,rip,ripng,bgp}d,zebra}.xml.in: removed due to
previous
* quagga.init.in: Use the package tarname for properties, use
the correct daemon name variable.
* Makefile.am: Updated to match single manifest
* prototype.daemons.in: ditto
|
|
|
|
* main.c: new file, common 'main' portion which then calls
test_init.
* heavy.c: remove common portions now in 'main.
* heavy-wq.c: ditto
* heavy-thread.c: ditto
* heavy*.c: Set the slow_function iteration number lower, to 300, it
was several orders of magnitude too 'slow' to be useful. :)
* Makefile.am: main is a source of the tests. heavy should link
to the math library.
|
|
|
|
* 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.
|
|
the rpmbuild commandline, eg rpmbuild --define 'keep_build 1'
|
|
* thread.c: Kill unused TIMER_NO_SORT bits
|
|
to HACKING (which I added..)
|
|
* memory.c: Make the string field much wider
* memtypes.c: Correct the prefix list str/entry strings
|
|
* Makefile.am: Refer to source files via srcdir variable, fix
out-of-tree build breakage.
|
|
* HACKING: Add some notes about build system changes, to
document common oversights (common for me anyway).
Seperate sections with two newlines, easier to read.
|
|
* thread.h: Fix type for struct thread_master add_type: should be
unsigned char. Also, add some documentation of thread_add_background
args. And remove extraneous declaration of
show_thread_work_queues_cmd.
|
|
* memory.h: Move include of memtypes.h to after the definition of
struct memory_list, gcc 4.0 doesn't like arrays of incomplete
types.
|
|
* bgpd.8,isisd.8,ospf6d.8,ospfd.8,ripd.8,ripngd.8,zebra.8: Fix
spelling mistake: idenifier -> identifier.
|
|
* bgpd.8,isisd.8,ospf6d.8,ospfd.8,ripd.8,ripngd.8,zebra.8: Fix
spelling mistake: intrefaces -> interfaces.
|
|
|
|
* Makefile.am: Build heavythread
|
|
* heavy-thread.c: Andrew Schorr's adaptation of heavy.c to use a
background thread to avoid responsivity problems.
|
|
* thread.h: Add background thread type and thread_add_background
macro and accompanying funcname_... function.
export thread_should_yield, background threads can use it.
Lower thread yield time to 10ms, 100ms is noticeable lag and
a thread would only be /starting/ to finish sometime afterward.
* thread.c: (general) Add background thread type and schedule
nearly all thread types through the ready list for fairness.
(timeval_adjust) static qualifier missing
(vty_out_cpu_thread_history) add support for printout of
background threads
(show_thread_cpu) ditto.
(thread_master_debug) add debug of background list
(thread_master_create) fixup long line
(thread_add_unuse) add asserts for required state.
(thread_master_free) free background thread list
(funcname_thread_add_timer_timeval) make generic, able to
support arbitrary timer-like thread types.
(funcname_thread_add_timer) pass thread type to .._add_timer_timeval
(funcname_thread_add_timer_msec) ditto
(funcname_thread_add_background) Add a background thread, with an
optional millisecond delay factor, using .._add_timer_timeval.
(thread_cancel) Add background thread type.
Move the thread_list_delete common to all cases to bottom of
function, after the switch statement..
(thread_cancel_event) indent
(thread_timer_wait) Static qualifier, and make it able to cope
with arbitrary timer-like thread lists, so its of use to
background threads too.
(thread_process_fd) static qualifier. Again, make it take a list
reference rather than thread_master. Fix indentation.
(thread_timer_process) Check for ready timer-like threads in the
given list and move them on to the ready list - code originally
embedded in thread_fetch.
(thread_fetch) Schedule all threads, other than events, through
the ready list, to ensure fairness. Timer readying code moved to
thread_timer_process so it can be reused for background threads.
Remove the unneeded quagga_sigevent_process, as pointed out by
John Lin <john.ch.lin@gmail.com>.
(thread_should_yield) make this available.
|
|
|
|
* heavy.c: Add a timer thread to demonstrate thread interactivity,
Add a daemon_exit command to assist with debugging (eg for memory
tracers, etc..)
|
|
* Makefile.am: pkginfo.%.tmpl is a generated file, srcdir prefix
is not appropriate.
|
|
version of RIPng is v1).
|
|
* Makefile.am: Add @INCLUDES@ and srcdir to allow out-of-tree
builds to work.
|
|
* heavy.c: test programme to show how long-running functions
kill responsiveness. Demonstrating the most niggly problem
left in bgpd.
|
|
* configure.ac: Added AC_ARG_ENABLE(time-check). By default,
warning messages will now be printed for threads or commands that take
longer than 5 seconds, but this configure argument can be used
to disable the checks or change the threshold.
* thread.h (thread_consumed_time): Declare new function to calculate
elapsed microseconds.
* thread.c (thread_consumed_time): Must be global not static so we
can call it from lib/vty.c:vty_command.
(thread_should_yield): Surround with `#if 0' to make clear that this
function is not currently being used anywhere.
(thread_call): If CONSUMED_TIME_CHECK is defined, print a CPU HOG
warning message if the thread takes more than CONSUMED_TIME_CHECK
microseconds.
* vty.c (vty_command): If CONSUMED_TIME_CHECK is defined, print a CPU
HOG warning message if the command takes more than CONSUMED_TIME_CHECK
microseconds.
|
|
* memtypes.c: the comment about use of comments in the comments
headers was causing comment within comment warnings from compiler
* memtypes.awk: Add extensive comments on the file format for
memtypes.c.
tighten the pattern for the MTYPE matching action (suggestion from
Andrew) and tighten which field we try the match on.
|
|
* configure.ac: check for gawk, needed to build memtypes.h
|
|
* Makefile.am: memtypes.awk is gawk dependent, use the GAWK automake
var.
* memtypes.h: New file, auto-generated, checked in for convenience.
|
|
* topology/Makefile.am: random.c is a source of libtopology, so list
it.
|
|
* ospf_abr.c: (ospf_abr_announce_network_to_area) dont forget
to approve LSAs for the case where metric has changed, lsa gets
flushed otherwise. (backport candidate).
|
|
* memtypes.c: The new, unified location for memory type definitions.
The memtype enum and declarations for memory_lists are built from
this automatically and put into memtypes.h.
* memtypes.awk: New script to generate memtypes.h from memtypes.c
* memory.h: Finally, the enum can banished!
* memory.c: Finally, the seperate mtype memory_list definitions can
be banished!
(log_memstats) Increase width of fields
(show_memory_zebra_cmd) display zebra specific memory types.
Increase width of fields.
* Makefile.am: Add memtypes.{c,h}, add BUILT_SOURCES for memtypes.h
Add a rule to build memtypes.h using memtypes.awk.
Add memtypes.awk to EXTRA_DIST.
|
|
* Makefile.am: {i,r}.manifest are (or will be) system provided files
and not in CVS, hence dont depend on them or distribute them.
|
|
|
|
* test-buffer.c: Andrew's buffer tester
* test-memory.c: basic memory tester
* Makefile.am: Add new tests
|
|
|
|
* .cvsignore: Add built files
|
|
Implement non-blocking zclient I/O with buffering.
* zclient.h (struct zclient): Add two fields to support non-blocking
I/O: struct buffer *wb, and struct thread *t_write.
(zclient_free): Remove function.
(zebra_redistribute_send): Change 2nd arg from socket fd to
struct zclient * (needed to support non-blocking I/O and buffering).
(zclient_send_message): New function to send an arbitrary
message with non-blocking I/O.
* zclient.c (zclient_new): Create write buffer.
(zclient_free): Remove unused function.
(zclient_stop): Must cancel new t_write thread. Also, reset
all buffers: ibuf, obuf, and wb.
(zclient_failed): New helper function for typical error handling.
(zclient_flush_data): New thread to flush queued data.
(zclient_send_message): New function to send the message in
zclient->obuf to zebra using non-blocking I/O and buffering.
(zebra_message_send, zapi_ipv4_route, zapi_ipv6_route): Use
new zclient_send_message function instead of calling writen.
(zclient_start): Set socket non-blocking. Also, change 2nd arg
to zebra_redistribute_send from zclient->sock to zclient.
(zebra_redistribute_send): Change 2nd arg to struct zclient *.
Can now use zclient->obuf to assemble the message instead of
allocating a temporary stream. And call zclient_send_message to
send the message instead of writen.
(zclient_read): Convert to support non-blocking I/O by using
stream_read_try instead of deprecated stream_read.
(zclient_redistribute): Change 2nd arg to zebra_redistribute_send
from zclient->sock to zclient.
* ospf6_zebra.c (ospf6_zebra_redistribute, ospf6_zebra_no_redistribute):
Change 2nd arg to zebra_redistribute_send from zclient->sock
to zclient.
* ospf_zebra.c (ospf_zebra_add): Call zclient_send_message instead
of writen.
* rip_zebra.c (rip_redistribute_set, rip_redistribute_unset,
rip_redistribute_clean): Change 2nd arg to zebra_redistribute_send
from zclient->sock to zclient.
* ripng_zebra.c (ripng_redistribute_unset, ripng_redistribute_clean):
Change 2nd arg to zebra_redistribute_send from zclient->sock
to zclient.
* bgp_zebra.c (bgp_redistribute_set, bgp_redistribute_unset):
The 2nd arg to zebra_redistribute_send is now zclient instead of
zclient->sock.
* isis_zebra.h (isis_zebra_finish): Remove declaration of unused
function.
* isis_zebra.c (isis_zebra_route_add_ipv4): Call zclient_send_message
to send the message to zebra instead of calling writen directly, since
zclient_send_message understands non-blocking I/O and will manage
the buffer queue appropriately.
(isis_zebra_finish): Remove unused function, particularly since
the zclient_free function has been removed.
|
|
* configure.ac: Move AC_CANONICAL_* stuff before AM_INIT_AUTOMAKE to
eliminate warning message about AC_ARG_PROGRAM being called
before AC_CANONICAL_TARGET.
|
|
* Makefile.am: README.txt to EXTRA_DIST
* README.txt: new file, package creation, install, usage notes.
|
|
* configure.ac: Call AC_CANONICAL_{BUILD,TARGET} macros. Target isnt
set otherwise, afaict. AC_SUBST enable_{user,group,vty_group} and
quagga_statedir - the Solaris package bits for one need this.
configure the solaris/ Makefile.
* Makefile.am: solaris is a subdir - unconditional or else it wont
be included in non-solaris made dists.
|
|
* (all) Initial check-in of files for building S10 packages
* protototype.*.in: package prototype files for SysV packages
* *.xml.in: SMF manifests for Quagga daemons
* pkginfo.*.tmpl.in: daemon specific pkginfo, refererenced
by prototype files.
* pkginfo.tmpl.in: Quagga common pkginfo bits
* quagga.init.in: SMF method script
* Makefile.am: Automake file for building packages
* depend.*: Solaris 10 dependencies for packages, referenced by
prototype files.
* .cvsignore: no idea what this is for...
|
|
* if_ioctl_solaris.c: (if_lookup_linklocal) fix order of args
in ALL_LIST_ELEMENTS_RO macro.
|
|
* quagga.info: Update to match bgpd.texi addition
|