summaryrefslogtreecommitdiff
path: root/nest/proto.c
AgeCommit message (Collapse)Author
2022-02-03Interfaces and neighbor notifications do properly enter protocol loopsMaria Matejka
2021-12-07Fixed a race condition in channel aux table cleanupMaria 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-23Fixed pipe reload/refeedMaria Matejka
2021-11-23Fixed channel export map confusionMaria Matejka
2021-11-22Corking also feed start to keep BIRD running when refeeds would easily cause ↵Maria Matejka
congestion
2021-11-22VRF setting reduced to one argument, using default dummy iface for default vrfMaria Matejka
2021-11-22Route table import-to-export announcement indirection to reduce pipe trafficMaria Matejka
2021-11-22Pipe runs in parallel.Maria 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-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-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-09Limit containmentMaria Matejka
2021-11-09Route export: rejected by filter bitmapMaria Matejka
If a route has been rejected by filter, store that information to avoid repeated export filter runs on rejected routes.
2021-11-09Protocol stats split to import and exportMaria Matejka
2021-10-13There may be a symbol with NULL protocol when reconfiguringMaria Matejka
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-03-17Minor fixes for restricted buildsOndrej Zajicek (work)
2021-03-16Pipe: Propagate debug flags from protocol to channelsOndrej Zajicek (work)
Pipe channels are kind-of implicit, so setting protocol debug flags should also set pipe debug flags.
2021-03-12Rate-limit scheduling of work-eventsOndrej Zajicek (work)
In general, events are code handling some some condition, which is scheduled when such condition happened and executed independently from I/O loop. Work-events are a subgroup of events that are scheduled repeatedly until some (often significant) work is done (e.g. feeding routes to protocol). All scheduled events are executed during each I/O loop iteration. Separate work-events from regular events to a separate queue and rate limit their execution to a fixed number per I/O loop iteration. That should prevent excess latency when many work-events are scheduled at one time (e.g. simultaneous reload of many BGP sessions).
2021-03-09Nest: No automatic ROA reload on non-reloadable channelsOndrej Zajicek (work)
2021-02-12Nest: Add option to control automatic RPKI reloadOndrej Zajicek (work)
Also, no automatic reload for BGP channels without import/export table.
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.
2021-02-07Filter: Recursive filter iteration codeOndrej Zajicek (work)
Add macros for recursive filter iteration that allows to examine all instructions reachable from a filter.
2021-01-06Nest: remove last_tx_filter_changeOndrej Zajicek (work)
No longer needed after redesign of export handling.
2020-12-07Nest: Per-channel debug flagsOndrej Zajicek (work)
The patch add support for per-channel debug flags, currently just 'states', 'routes', and 'filters'. Flag 'states' is used for channel state changes, remaining two for routes passed through the channel. The per-protocol debug flags 'routes'/'filters' still enable reporting of routes for all channels, to keep existing behavior. The patch causes minor changes in some log messages.
2020-11-24Fix some failed asserts due to add_tail()Ondrej Zajicek (work)
When config structures are copied due to template application, we need to reset list node structure before calling add_tail(). Thanks to Mikael Magnusson for patches.
2020-06-28Show info from multiple protocols when protocol is not specifiedOndrej Zajicek (work)
Most commands like 'show ospf neighbors' fail when protocol is not specified and there are multiple instances of given protocol type. This is annoying in BIRD 2, as many protocols have IPv4 and IPv6 instances. The patch changes that by showing output from all protocol instances of appropriate type. Note that the patch also removes terminating cli_msg() call from these commands and moves it to the common iterating code.
2020-04-09Configuration strings are constant.Maria Matejka
This is merely a const propagation. There was no problem in there.
2019-12-10Nest: Fix bitmap cleanupOndrej Zajicek (work)
Channel currently does not have independent pool and uses protocol pool, which is freed when protocol changes state to down, while channel is still in flushing. Move some some cleanup code to channel_do_flush() so it is done before freeing of protocol pool.
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-08-14Nest: Fix crash in route reload when some channels are not up.Ondrej Zajicek (work)
Only channels that are up can be reloaded.
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-08-06BGP: Improve reconfigurationOndrej Zajicek (work)
Several BGP channel options (including 'next hop self') could be reconfigured without session reset, with just route refeed/refresh. The patch improves reconfiguration code to do it that way.
2019-07-24Merge remote-tracking branch 'origin/mq-filter-stack'Ondrej Zajicek (work)
2019-07-24Nest: VRF of protocol can be explicitly specified as 'default'Ondrej Zajicek (work)
Protocol can have specified VRF, in such case it is restricted to a set of ifaces associated with the VRF, otherwise it can use all interfaces. The patch allows to specify VRF as 'default', in which case it is restricted to a set of iface not associated with any VRF.
2019-07-03Merge branch 'master' into mq-filter-stackMaria Matejka
2019-06-30Nest: Add command to request graceful restartOndrej Zajicek (work)
When 'graceful down' command is entered, protocols are shut down with regard to graceful restart. Namely Kernel protocol does not remove routes and BGP protocol does not send notification, just closes the connection.
2019-04-30BGP: Dynamic BGPOndrej Zajicek (work)
Support for dynamically spawning BGP protocols for incoming connections. Use 'neighbor range' to specify range of valid neighbor addresses, then incoming connections from these addresses spawn new BGP instances.
2019-02-20Conf: Symbol implementation converted from void pointers to unionMaria Matejka
... and consted some declarations.
2019-02-05Nest: Report preferred counters also when 'import keep filtered' is enabledOndrej Zajicek (work)
Thanks to Michal Nowak for reporting the issue.
2019-02-02Nest: Reestablish preferred countersOndrej Zajicek (work)
2018-12-18Perf: Protocol to measure BIRD performance internallyMaria Matějka
This protocol is highly experimental and nobody should use it in production. Anyway it may help you getting some insight into what eats so much time in filter processing.
2018-12-16Nest: fix bug in previous patches related to channel reconfigurationOndrej Zajicek (work)
The patch d506263d... blocked adding channel during reconfiguration, that broke protocols which use the same functiona also during init. This patch fixes that.