summaryrefslogtreecommitdiffstats
path: root/tests/lib/test_checksum.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2017-07-11ospf6d: use macro for LSDB walksDavid Lamparter10-99/+61
... to make it easier to refactor all of the iteration uses. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-11lib: table: use hash for exact-match lookupsDavid Lamparter1-29/+15
Most read accesses of route_table are actually exact matches where walking down the tree is wildly inefficient. Use a parallel hash structure instead. This significantly speeds up processes that are performance-bound by table accesses, e.g. BGP withdraw processing. In other locations, the improvement is not seen as strongly, e.g. when filter processing is the limiting factor. [includes fix to ignore prefix host bits in hash comparison] Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-11lib: table: maintain parallel hash for route_tableDavid Lamparter2-1/+28
See next commit for description. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-11lib: add some abstraction guards for table codeDavid Lamparter5-4/+48
route_node->parent and route_node->link shouldn't be touched by user code since that is a recipe for trouble once we have a hash table in parallel. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-11lib: use "union prefixconstptr" in table codeDavid Lamparter2-15/+20
This allows passing struct prefix_{ipv4,ipv6,evpn} * in addition to struct prefix * without an extra cast (since the union uses the gcc transparent-union extension present in all compilers that we support.) Also applies some "const" while we're at it. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-10lib: Remove typedef from ipaddrDonald Sharp2-6/+6
The ipaddr_t type was conflicting with code on omnios. Remove the typedef Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-10bgpd: Install SAFI_LABELED_UNICAST routes in SAFI_UNICAST tableDaniel Walton1-1/+0
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2017-07-07bgpd: peer-group members 'activate' when they shouldn'tDaniel Walton1-0/+4
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com> Today if you configure the following where the 'fabric' peer-group has been deactivated for ipv4 unicast and then assign swp1/swp2 to that peer-group we end up activating those two peers for ipv4 unicast. conf t no router bgp 100 router bgp 100 neighbor fabric peer-group neighbor fabric capability extended-nexthop neighbor fabric remote-as external ! address-family ipv4 unicast no neighbor fabric activate ! neighbor swp1 interface peer-group fabric neighbor swp2 interface peer-group fabric neighbor 1.1.1.1 peer-group fabric end cel-redxp-10# show run bgp ! router bgp 100 neighbor fabric peer-group neighbor fabric remote-as external neighbor fabric capability extended-nexthop neighbor swp1 interface peer-group fabric neighbor swp2 interface peer-group fabric neighbor 1.1.1.1 peer-group fabric ! address-family ipv4 unicast no neighbor fabric activate neighbor swp1 activate neighbor swp2 activate exit-address-family ! cel-redxp-10# With the patch we do not activate swp1/swp2 cel-redxp-10# show run bgp ! router bgp 100 neighbor fabric peer-group neighbor fabric remote-as external neighbor fabric capability extended-nexthop neighbor swp1 interface peer-group fabric neighbor swp2 interface peer-group fabric neighbor 1.1.1.1 peer-group fabric ! address-family ipv4 unicast no neighbor fabric activate exit-address-family ! cel-redxp-10#
2017-07-06lib: fix more docstringsQuentin Young2-5/+2
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-07-06lib: fix vty_out with >1024 bytes of outputDavid Lamparter1-2/+4
Consuming va_args modifies its internal bits, hence the need to copy it... but the copying wasn't quite right just yet. Fixes: 4d5f445 ("lib: add vty_outln()") Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-05bgpd: Install SAFI_LABELED_UNICAST routes in SAFI_UNICAST tableDaniel Walton2-39/+4
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2017-07-05bgpd: "address-family" not displayed in configurationDaniel Walton1-1/+1
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-05*: fix excess docstringQuentin Young14-151/+53
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-07-05doc: update build docs for ubuntuQuentin Young3-12/+12
cumulus/etc --> tools/etc Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-07-05lib: warn about too much docstringQuentin Young1-0/+8
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-07-05zebra: fix mpls_str2label()Quentin Young1-1/+1
When making improvements to error handling in this code I accidentally introduced an off-by-one. Fix it. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-07-02lib, vtysh: rebase hashstatsQuentin Young2-17/+14
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-07-02lib: use doubles instead of long doublesQuentin Young1-20/+21
NetBSD can't take the square root of a long double and we should be fine just using a double here anyway Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-07-02*: update hash_create(), hash_create_size()Quentin Young28-37/+38
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-07-02lib, vtysh: hashtable statisticsQuentin Young4-136/+231
Adds the ability to name hash tables, and a new cli command that will show various summary statistics for named hash tables. Statistics computed are - load factor - full load factor (see comments) - stddev of full load factor Standard deviation is computed by storing the sum of squares of bucket lengths. This is somewhat susceptible to overflow. On platforms where a double is 32 bits, placing 65535 or more elements into a hash table opens up the potential for overflow, depending on how they are arranged in buckets (which depends on the hash function). For example, placing 65535 elements into one hash bucket would cause ssq overflow, but distributing 40000000 elements evenly among 400000 buckets (100 elements per bucket) would not. These cases are extremely degenerate, so the vague possibility of overflow in an informational command is deemed an acceptable tradeoff for constant time calculation of variance without locks or compromising efficiency of actual table operations. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-07-02lib: add statistics for hash tablesQuentin Young4-0/+164
Adds a function that calculates various statistics on our implementation of a hash table. These are useful for evaluating performance. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-06-30bgpd: Install SAFI_LABELED_UNICAST routes in SAFI_UNICAST tableDaniel Walton1-7/+2
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2017-06-30lib: printf bugfixes & improvementQuentin Young4-11/+14
* Fix bad format specifier in thread.[ch] * Move PRINTF_ATTRIBUTE macro to zebra.h * Use PRINTF_ATTRIBUTE on termtable printers Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-06-30ospfd: Fix 'advanced' type data base showDonald Sharp1-29/+11
Two things: 1) Some advanced 'show ip ospf database'... code was not working properly. Fix the cli to handle this appropriately 2) Consolidate two cli functions into one. Signed-off-by: Donald Sharp <sharpd@cumulusnetworkscom>
2017-06-30ospf6d: Fix zclient cleanup on shutdownDonald Sharp1-1/+4
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-06-30ospfd: Fix zclient cleanup on shutdownDonald Sharp1-0/+2
Signed-off-by: Donald Sharp <sharpd@cumulunsnetworks.com>
2017-06-30pimd: Fix zclient cleanup on shutdownDonald Sharp2-0/+10
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-06-30ripd: Fix zclient cleanup on shutdownDonald Sharp3-0/+10
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-06-30ripngd: Fix zclient cleanup on shutdownDonald Sharp3-0/+9
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-06-30nhrpd: Fix zclient cleanup on shutdownDonald Sharp1-0/+1
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-06-30isisd: Fix zclient cleanup on shutdownDonald Sharp3-0/+10
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-06-30eigrpd: Fix zclient cleanup on shutdownDonald Sharp1-2/+4
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-06-30babeld: Fix zclient cleanup on shutdownDonald Sharp1-0/+1
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-06-30lib: Fix clang warningDonald Sharp1-1/+1
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-06-30bgpd: Make SAFI-1 and SAFI-4 use the same tableDaniel Walton1-3/+4
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2017-06-30bgpd: Make SAFI-1 and SAFI-4 use the same tableDaniel Walton1-2/+2
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2017-06-30lib: fix merge errorQuentin Young1-1/+0
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-06-30lib: more `show thread cpu`Quentin Young20-29/+49
Add support for naming pthreads. Also, note that we don't have any records yet if that's the case. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-06-30lib: make `show thread...` commands mt-awareQuentin Young2-164/+163
This patch fixes up show thread commands so that they know about and operate on all extant thread_masters, since we can now have multiple running in any given application. This change also eliminates a heap use after free that appears when using a single cpu_record shared among multiple threads. Since struct thread's have pointers to bits of memory that are freed when the global statistics hash table is freed, later accesses are invalid. By moving the stats hash to be unique to each thread_master this problem is sidestepped. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-06-30lib: mt-safe tracebacksQuentin Young3-20/+30
can't be using them statics anymore sonny Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-06-30lib: un-static trash buffer for pipe pokerQuentin Young1-1/+1
data races Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-06-30lib: always use 64-bit integers for jsonQuentin Young3-10/+2
json-c does not (yet) offer support for unsigned integer types, and furthermore, the docs state that all integers are stored internally as 64-bit. So there's never a case in which we would want to limit, implicitly or otherwise, the range of an integer when adding it to a json object. Among other things this fixes the display of ASN values greater than (1/2) * (2^32 - 1) Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-06-29lib, bgpd: fix .gitignoreQuentin Young2-0/+4
gotta ignore clippy stuff Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-06-29*: rebase vty_outln() -> masterQuentin Young5-16/+15
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-06-29*: vty_outln (vty, "") --> vty_out (vty, VTYNL)Quentin Young49-216/+216
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-06-29*: s/VTY_NEWLINE/VTYNL/gQuentin Young47-1041/+1032
Should be able to fit more vty_out onto one line now Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-06-29*: use vty_outlnQuentin Young121-4545/+4177
Saves 400 lines Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-06-29lib: add vty_outln()Quentin Young2-13/+33
Like *.println() in some other unspeakable languages Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-06-29bgpd, lib, zebra: Fix if_update function to represent what it doesDonald Sharp5-11/+6
The if_update function was taking the interface name as input and reapplying it, using strncpy to reapply the name. This has several issues. strncpy should not be used to copy memory in place. The second issue is that the interface name is not actually changing when we update interface to be in the new vrf. Since every usage of if_update was just reapplying the same name the interface actually had, just remove that part of the function and rename it to if_update_to_new_vrf to represent what it is actually doing. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-06-29ospfd: The CLI validates the IP addressJafar Al-Gharaibeh1-2/+2
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>