summaryrefslogtreecommitdiff
path: root/lib/resource.c
AgeCommit message (Collapse)Author
2023-04-04Resource dumps also write out block addressesMaria Matejka
2022-09-18Memory pages allocator is now a global simple lockless structureMaria Matejka
2022-08-02Introducing basic RCU primitives for lock-less shared data structuresMaria Matejka
2022-07-18Merge commit '94eb0858' into thread-nextMaria Matejka
2022-05-04Explicit definition structures of route attributesMaria Matejka
Changes in internal API: * Every route attribute must be defined as struct ea_class somewhere. * Registration of route attributes known at startup must be done by ea_register_init() from protocol build functions. * Every attribute has now its symbol registered in a global symbol table defined as SYM_ATTRIBUTE * All attribute ID's are dynamically allocated. * Attribute value custom formatting hook is defined in the ea_class. * Attribute names are the same for display and filters, always prefixed by protocol name. Also added some unit testing code for filters with route attributes.
2022-03-15Printf variant with a result allocated inside a pool / linpoolMaria Matejka
2022-03-09Single-threaded version of sark-branch memory page managementMaria Matejka
2022-03-02Introducing an universal temporary linpool flushed after every taskMaria Matejka
2021-11-27Memory statistics split into Effective and OverheadMaria Matejka
This feature is intended mostly for checking that BIRD's allocation strategies don't consume much memory space. There are some cases where withdrawing routes in a specific order lead to memory fragmentation and this output should give the user at least a notion of how much memory is actually used for data storage and how much memory is "just allocated" or used for overhead. Also raising the "system allocator overhead estimation" from 8 to 16 bytes; it is probably even more. I've found 16 as a local minimum in best scenarios among reachable machines. I couldn't find any reasonable method to estimate this value when BIRD starts up. This commit also fixes the inaccurate computation of memory overhead for slabs where the "system allocater overhead estimation" was improperly added to the size of mmap-ed memory.
2021-10-13Multipage allocationMaria Matejka
We can also quite simply allocate bigger blocks. Anyway, we need these blocks to be aligned to their size which needs one mmap() two times bigger and then two munmap()s returning the unaligned parts. The user can specify -B <N> on startup when <N> is the exponent of 2, setting the block size to 2^N. On most systems, N is 12, anyway if you know that your configuration is going to eat gigabytes of RAM, you are almost forced to raise your block size as you may easily get into memory fragmentation issues or you have to raise your maximum mapping count, e.g. "sysctl vm.max_map_count=(number)".
2021-09-10Bound allocated pages to resource pools with page caches to avoid ↵Maria Matejka
unnecessary syscalls
2021-03-30Resources: added mb_move() to complement rmove() for memory blocksMaria Matejka
2020-05-01Lists: Replaced replace_node() by update_node() which is the only use of ↵Maria Matejka
that function.
2020-05-01Uninitialized list nodes fixesMaria Matejka
2016-12-07RPKI protocol with one cache server per protocolPavel Tvrdík
The RPKI protocol (RFC 6810) using the RTRLib (http://rpki.realmv6.org/) that is integrated inside the BIRD's code. Implemeted transports are: - unprotected transport over TCP - secure transport over SSHv2 Example configuration of bird.conf: ... roa4 table r4; roa6 table r6; protocol rpki { debug all; # Import both IPv4 and IPv6 ROAs roa4 { table r4; }; roa6 { table r6; }; # Set cache server (validator) address, # overwrite default port 323 remote "rpki-validator.realmv6.org" port 8282; # Overwrite default time intervals retry 10; # Default 600 seconds refresh 60; # Default 3600 seconds expire 600; # Default 7200 seconds } protocol rpki { debug all; # Import only IPv4 routes roa4 { table r4; }; # Set cache server address to localhost, # use default ports tcp => 323 or ssh => 22 remote 127.0.0.1; # Use SSH transport instead of unprotected transport over TCP ssh encryption { bird private key "/home/birdgeek/.ssh/id_rsa"; remote public key "/home/birdgeek/.ssh/known_hosts"; user "birdgeek"; }; } ...
2016-03-23Birdlib: Do cleanups after remove/freeOndrej Zajicek (work)
To avoid byzantine behavior in case of some errors, linked lists are cleared after rem_node() and resource headers are cleared after rfree().
2014-02-06Many changes in I/O and OSPF sockets and packet handling.Ondrej Zajicek
I/O: - BSD: specify src addr on IP sockets by IP_HDRINCL - BSD: specify src addr on UDP sockets by IP_SENDSRCADDR - Linux: specify src addr on IP/UDP sockets by IP_PKTINFO - IPv6: specify src addr on IP/UDP sockets by IPV6_PKTINFO - Alternative SKF_BIND flag for binding to IP address - Allows IP/UDP sockets without tx_hook, on these sockets a packet is discarded when TX queue is full - Use consistently SOL_ for socket layer values. OSPF: - Packet src addr is always explicitly set - Support for secondary addresses in BSD - Dynamic RX/TX buffers - Fixes some minor buffer overruns - Interface option 'tx length' - Names for vlink pseudoifaces (vlinkX) - Vlinks use separate socket for TX - Vlinks do not use fixed associated iface - Fixes TTL for direct unicast packets - Fixes DONTROUTE for OSPF sockets - Use ifa->ifname instead of ifa->iface->name
2013-09-16BFD work in progress.Ondrej Zajicek
Now it compiles and mostly works.
2013-09-10Initial BFD commit, work in progress.Ondrej Zajicek
2012-04-22Small typo in programmer's documentation.Ondrej Filip
2010-06-02Implements command that shows memory usage.Ondrej Zajicek
2009-09-17Fixes headers for uintptr_t (and build on NetBSD).Ondrej Zajicek
2009-09-04Clear memory allocated by ralloc().Ondrej Zajicek
This also fixes bug that timer->recurrent was not cleared in tm_new() and unexpected recurrence of startup timer in BGP confused state machine and caused crash.
2009-07-06Fixes memory alignment problems on Sparc64.Ondrej Zajicek
Not quite standard construction, i should add some autoconf macro. Not tested yet.
2009-06-10Changes OSPF to generate stub networks for non-primary addresses.Ondrej Zajicek
Also does some reorganization in RT LSA announcement.
2008-12-25fixes some 64-bit related bugs.Ondrej Zajicek
Filter code used 'aux' integer field of 'symbol' struct to store ptr to next symbol and both 'aux2' and 'def' fields for value. Changed to just 'def' for value and 'aux2' for ptr to next symbol. Also another minor bugfix.
2004-06-05One more in the library.Martin Mares
2004-05-31Added rmove() (by Andreas, tweaked by me).Martin Mares
2000-06-05Documented memory resources.Martin Mares
2000-05-08Implemented debugging function rlookup() which you can call from gdbMartin Mares
to see what resource does the address given as a parameter belong to.
2000-03-31Use bsprintf() instead of sprintf().Martin Mares
2000-03-31Include "lib/string.h" instead of <string.h>. It should give us bzero()Martin Mares
and other non-portable functions on all systems.
1999-03-29Clarify resource dumps and include them in the main debugging dump.Martin Mares
1999-03-04Use dmalloc instead of EFence when available (dmalloc has lot of improvementsMartin Mares
over EFence and also hopefully smaller memory overhead, but sadly it's non-free for commercial use). If the DMALLOC_OPTIONS environment variable is not set, switch on `reasonable' checks by default. Also introduced mb_allocz() for cleared mb_alloc().
1998-05-26Resource pools are now named.Martin Mares
1998-05-24Staticized some variables and functions.Martin Mares
1998-05-03BIRD library: The story continues.Martin Mares
Complete resource manages and IP address handling.