| Commit message (Collapse) | Author | Files | Lines |
|
... to make it easier to refactor all of the iteration uses.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
|
|
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>
|
|
See next commit for description.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
|
|
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>
|
|
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>
|
|
The ipaddr_t type was conflicting with code on omnios.
Remove the typedef
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
|
|
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
|
|
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#
|
|
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
|
|
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>
|
|
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
|
|
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
|
|
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
|
|
cumulus/etc --> tools/etc
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
|
|
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
|
|
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>
|
|
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
|
|
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>
|
|
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
|
|
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>
|
|
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>
|
|
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
|
|
* 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>
|
|
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>
|
|
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
|
|
Signed-off-by: Donald Sharp <sharpd@cumulunsnetworks.com>
|
|
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
|
|
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
|
|
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
|
|
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
|
|
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
|
|
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
|
|
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
|
|
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
|
|
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
|
|
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
|
|
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
|
|
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>
|
|
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>
|
|
can't be using them statics anymore sonny
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
|
|
data races
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
|
|
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>
|
|
gotta ignore clippy stuff
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
|
|
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
|
|
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
|
|
Should be able to fit more vty_out onto one line now
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
|
|
Saves 400 lines
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
|
|
Like *.println() in some other unspeakable languages
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
|
|
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>
|
|
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
|