summaryrefslogtreecommitdiff
path: root/nest/route.h
AgeCommit message (Collapse)Author
2021-12-01Faster shutdown and cleanups by freeing route attributes strictly from main loopMaria Matejka
2021-12-01Faster prune on table deletionMaria Matejka
2021-12-01fixed duplicate routes propagationMaria Matejka
2021-11-30For safer memory allocations, resources are bound to loops.Maria Matejka
Also all loops have their basic resource pool for allocations which are auto-freed when the loop is stopping.
2021-11-22Higher settle times when route refresh in the source table is runningMaria Matejka
2021-11-22Route attribute cache is now lockless on read / clone.Maria Matejka
Lots of time was spent locking when accessing route attribute cache. This overhead should be now reduced to a minimum.
2021-11-22Route table import-to-export announcement indirection to reduce pipe trafficMaria Matejka
2021-11-22Routing tables now have their own loops.Maria Matejka
This basically means that: * there are some more levels of indirection and asynchronicity, mostly in cleanup procedures, requiring correct lock ordering * all the internal table operations (prune, next hop update) are done without blocking the other parts of BIRD * the protocols may get their own loops very soon
2021-11-22Route subscription uses eventsMaria Matejka
2021-11-22Global table update pool removedMaria Matejka
2021-11-22Locking route attributes cacheMaria Matejka
To access route attribute cache from multiple threads at once, we have to lock the cache on writing. The route attributes data structures are safe to read unless somebody tries to tamper with the cache itself.
2021-11-22Route sources have an explicit ownerMaria Matejka
This commit prevents use-after-free of routes belonging to protocols which have been already destroyed, delaying also all the protocols' shutdown until all of their routes have been finally propagated through all the pipes down to the appropriate exports. The use-after-free was somehow hypothetic yet theoretically possible in rare conditions, when one BGP protocol authors a lot of routes and the user deletes that protocol by reconfiguring in the same time as next hop update is requested, causing rte_better() to be called on a not-yet-pruned network prefix while the owner protocol has been already freed. In parallel execution environments, this would happen an inter-thread use-after-free, causing possible heisenbugs or other nasty problems.
2021-11-22Table cork: Stop creating updates when there are too many pending.Maria Matejka
The corked procedure gets a callback when uncorked. Supported by table maintenance routines and also BGP.
2021-11-22Split route table event into separate eventsMaria Matejka
The former rt_event is dropped in favour of separate table events. This allows for selective corking of NHU and prune.
2021-11-22Converting the former BFD loop to a universal IO loop and protocol loop.Maria Matejka
There is a simple universal IO loop, taking care of events, timers and sockets. Primarily, one instance of a protocol should use exactly one IO loop to do all its work, as is now done in BFD. Contrary to previous versions, the loop is now launched and cleaned by the nest/proto.c code, allowing for a protocol to just request its own loop by setting the loop's lock order in config higher than the_bird. It is not supported nor checked if any protocol changed the requested lock order in reconfigure. No protocol should do it at all.
2021-11-22Route export is now asynchronous.Maria Matejka
To allow for multithreaded execution, we need to break the import-export chain and buffer the exports before actually processing them.
2021-11-22Special table hooks rectified.Maria Matejka
* internal tables are now more standalone, having their own import and export hooks * route refresh/reload uses stale counter instead of stale flag, allowing to drop walking the table at the beginning * route modify (by BGP LLGR) is now done by a special refeed hook, reimporting the modified routes directly without filters
2021-11-22Table import and export are now explicit hooks.Maria Matejka
Channels have now included rt_import_req and rt_export_req to hook into the table instead of just one list node. This will (in future) allow for: * channel import and export bound to different tables * more efficient pipe code (dropping most of the channel code) * conversion of 'show route' to a special kind of export * temporary static routes from CLI The import / export states are also updated to the new algorithms.
2021-11-09Secondary and merged exports get a whole feed instead of traversing the ↵Maria Matejka
table structures directly
2021-11-09Nest: Route generations and explicit tracking route propagion through pipesMaria Matejka
2021-11-09Refeed is done from export table when appropriateMaria Matejka
2021-11-09Split route data structure to storage (ro) / manipulation (rw) structures.Maria Matejka
Routes are now allocated only when they are just to be inserted to the table. Updating a route needs a locally allocated route structure. Ownership of the attributes is also now not transfered from protocols to tables and vice versa but just borrowed which should be easier to handle in a multithreaded environment.
2021-10-13RIP fixup + dropping the tmp_attrs mechanism as obsoleteMaria Matejka
2021-10-13BGP: Moved the suppressed and stale flags to pflagsMaria Matejka
2021-10-13Kernel: Convert the rte-local attributes to extended attributes and flags to ↵Maria Matejka
pflags
2021-10-13Dropping the RTS_DUMMY temporary route storage.Maria Matejka
Kernel route sync is done by other ways now and this code is not used currently.
2021-10-13Babel: Convert the rte-local attributes to extended attributesMaria Matejka
2021-10-13OSPF: Convert the rte-local attributes to extended attributesMaria Matejka
2021-10-13RIP: convert the rte-local attributes to extended attributesMaria Matejka
2021-10-13Extended route attributes may include also pointersMaria Matejka
2021-10-13Route: moved rte_src pointer from rta to rteMaria Matejka
It is an auxiliary key in the routing table, not a route attribute.
2021-10-13Preference moved to RTA and set explicitly in protocolsMaria Matejka
2021-10-13Export table: Delay freeing of old stored route.Maria Matejka
This is needed to provide the protocols the full old route after filters when export table is enabled.
2021-04-19Internal route tables have a reduced cleanup routineMaria Matejka
This fixes an internal table cleanup bug introduced in ff397df7edcbe7a8abca5b419729b9c64c063847.
2021-03-30Routing table is now a resource allocated from its own poolMaria Matejka
This also fixes memory leaks from import/export tables being never cleaned up and freed.
2021-02-10Nest: Automatic channel reloads based on RPKI changesOndrej Zajicek (work)
If there are roa_check() calls in channel filters, then the channel subscribes to ROA table notifications, which are sent when ROA tables are updated (subject to settle time) and trigger channel reload or refeed.
2020-05-01Nest: Added const to ea_show just to declare that this shouldn't really ↵Maria Matejka
change anything
2020-02-21RIP: Demand circuit support (RFC 2091)Ondrej Zajicek (work)
2020-02-04Added missing externMaria Matejka
Thanks to Robert Scheck <bird@robert-scheck.de> who reported it and Toke Høiland-Jørgensen <toke@toke.dk> who suggested this patch.
2020-01-07KRT: Improve syncer code to avoid using temporary data in rtableOndrej Zajicek (work)
The old code stored route verdicts and temporary routes directly in rtable. The new code do not store received routes (it immediately compares them with exported routes and resolves conflicts) and uses internal bitmap to keep track of which routes were received and which needs to be reinstalled. By not putting 'invalid' temporary routes to rtable, we keep rtable in consistent state, therefore scan no longer needs to be atomic operation and could be splitted to multiple events.
2019-12-19KRT: Remove KRF_SYNC_ERROR flagOndrej Zajicek (work)
This info is now stored in an internal bmap. Unfortunately, net.flags is still needed for temporary kernel data.
2019-12-16KRT: Remove KRF_INSTALLED flagOndrej Zajicek (work)
The same information is stored in export_map of kernel protocol.
2019-11-26Nest: Use bitmaps to keep track of exported routesOndrej Zajicek (work)
Use a hierarchical bitmap in a routing table to assign ids to routes, and then use bitmaps (indexed by route id) in channels to keep track whether routes were exported. This avoids unreliable and inefficient re-evaluation of filters for old routes in order to determine whether they were exported.
2019-10-09BGP: AIGP metric support (RFC 7311)Ondrej Zajicek (work)
2019-08-14BGP: implement Adj-RIB-OutOndrej Zajicek (work)
The patch implements optional internal export table to a channel and hooks it to BGP so it can be used as Adj-RIB-Out. When enabled, all exported (post-filtered) routes are stored there. An export table can be examined using e.g. 'show route export table bgp1.ipv4'.
2019-07-10Merge branch 'master' into mq-filter-stackMaria Matejka
2019-07-02Netlink: Handle alien routes with unsorted nexthopsOndrej Zajicek (work)
Nest requires that nexthops are sorted, the kernel protocol have to ensure that for alien routes.
2019-03-18Merge branch 'master' into HEADMaria Matejka
2019-03-14Nest: Update handling of temporary attributesOndrej Zajicek (work)
The temporary atttributes are no longer removed by ea_do_prune(), but they are undefined by store_tmp_attrs() protocol hooks. This fixes several bugs where temporary attributes were removed when they should not or not removed when they should be. The flag EAF_TEMP is no longer needed and was removed. Update all protocol make_tmp_attrs() / store_tmp_attrs() hooks to use helper functions and to handle unset attributes properly. Also fix some related bugs like improper handling of empty eattr list.
2019-03-06OSPF: Improved handling of tmpattrsOndrej Zajicek (work)
Keep track of whether OSPF tmpattrs are actually defined for given route (using flags in rte->pflags). That makes them behave more like real eattrs so a protocol can define just a subset of them or they can be undefined by filters. Do not set ospf_metric2 for other than type 2 external OSPF routes and do not set ospf_tag for non-external OSPF routes. That also fixes a bug where internal/inter-area route propagated from one OSPF instance to another is initiated with infinity ospf_metric2. Thanks to Yaroslav Dronskii for the bugreport.