summaryrefslogtreecommitdiff
path: root/nest
AgeCommit message (Collapse)Author
2022-09-01Table debug is now a per-table setting and has categories.Maria Matejka
2022-09-01Default tables are not created unless actually used.Maria Matejka
This allows for setting default table values at the beginning of config file before "master4" and "master6" tables are initialized.
2022-08-30Tables: Requesting prune only after export cleanupMaria Matejka
We can't free the network structures before the export has been cleaned up, therefore it makes more sense to request prune only after export cleanup. This change also reduces prune calls on table shutdown.
2022-08-03Merge commit 'c7d0c5b2' into thread-nextMaria Matejka
2022-08-03Merge commit '18f66055' into thread-nextMaria Matejka
2022-08-03Merge commit '038fcf1c' into thread-nextMaria Matejka
It was necessary to update the code to match removal of rta, as well as existence of cached nested attribute lists.
2022-08-02Merge commit 'f0507f05ce57398e135651896dace4cb68eeed54' into thread-nextMaria Matejka
2022-08-02Also next hop update routines are corking themselves when congestion is detectedMaria Matejka
2022-08-02Route table cork: Indicate whether the export queues are congested.Maria Matejka
These routines detect the export congestion (as defined by configurable thresholds) and propagate the state to readers. There are no readers for now, they will be added in following commits.
2022-07-28Moved the thread starting code to IO loop codeMaria Matejka
2022-07-18Event lists rewritten to a single linked listMaria Matejka
In multithreaded environment, we need to pass messages between workers. This is done by queuing events to their respective queues. The double-linked list is not really useful for that as it needs locking everywhere. This commit rewrites the event subsystem to use a single-linked list where events are enqueued by a single atomic instruction and the queue is processed after atomically moving the whole queue aside.
2022-07-18Merge commit '94eb0858' into thread-nextMaria Matejka
2022-07-18Fixing build issues caused by a nonportable Makefile ruleMaria Matejka
2022-07-15Merge commit 'c70b3198' into thread-next [lots of conflicts]Maria Matejka
There were more conflicts that I'd like to see, most notably in route export. If a bisect identifies this commit with something related, it may be simply true that this commit introduces that bug. Let's hope it doesn't happen.
2022-07-14Fixed invalid routes handlingMaria Matejka
The invalid routes were filtered out before they could ever get exported, yet some of the routines need them available, e.g. for display or import reload. Now the invalid routes are properly exported and dropped in channel export routines instead.
2022-07-13Merge commit '2e5bfeb73ac25e236a24b6c1a88d0f2221ca303f' into thread-nextMaria Matejka
2022-07-13Merge commit '7e9cede1fd1878fb4c00e793bccd0ca6c18ad452' into thread-nextMaria Matejka
2022-07-13Fixed bug in repeated show route commandMaria Matejka
Introduced by 13ef5e53dd4a98c80261139b4c9ce4b1074cac40, the CLI was not properly cleaned up when the command finished, causing BIRD to not parse any other command after "show route".
2022-07-12Merge commit 'f18968f5' into thread-nextMaria Matejka
2022-07-12Removing the rte_modify APIMaria Matejka
For BGP LLGR purposes, there was an API allowing a protocol to directly modify their stale routes in table before flushing them. This API was called by the table prune routine which violates the future locking requirements. Instead of this, BGP now requests a special route export and reimports these routes into the table, allowing for asynchronous execution without locking the table on export.
2022-07-12Route refresh in tables uses a stale counter.Maria Matejka
Until now, we were marking routes as REF_STALE and REF_DISCARD to cleanup old routes after route refresh. This needed a synchronous route table walk at both beginning and the end of route refresh routine, marking the routes by the flags. We avoid these walks by using a stale counter. Every route contains: u8 stale_cycle; Every import hook contains: u8 stale_set; u8 stale_valid; u8 stale_pruned; u8 stale_pruning; In base_state, stale_set == stale_valid == stale_pruned == stale_pruning and all routes' stale_cycle also have the same value. The route refresh looks like follows: + ----------- + --------- + ----------- + ------------- + ------------ + | | stale_set | stale_valid | stale_pruning | stale_pruned | | Base | x | x | x | x | | Begin | x+1 | x | x | x | ... now routes are being inserted with stale_cycle == (x+1) | End | x+1 | x+1 | x | x | ... now table pruning routine is scheduled | Prune begin | x+1 | x+1 | x+1 | x | ... now routes with stale_cycle not between stale_set and stale_valid are deleted | Prune end | x+1 | x+1 | x+1 | x+1 | + ----------- + --------- + ----------- + ------------- + ------------ + The pruning routine is asynchronous and may have high latency in high-load environments. Therefore, multiple route refresh requests may happen before the pruning routine starts, leading to this situation: | Prune begin | x+k | x+k | x -> x+k | x | ... or even | Prune begin | x+k+1 | x+k | x -> x+k | x | ... if the prune event starts while another route refresh is running. In such a case, the pruning routine still deletes routes not fitting between stale_set and and stale_valid, effectively pruning the remnants of all unpruned route refreshes from before: | Prune end | x+k | x+k | x+k | x+k | In extremely rare cases, there may happen too many route refreshes before any route prune routine finishes. If the difference between stale_valid and stale_pruned becomes more than 128 when requesting for another route refresh, the routine walks the table synchronously and resets all the stale values to a base state, while logging a warning.
2022-07-11There are now no internal tables at all.Maria Matejka
2022-07-11Export tables merged with BGP prefix hashMaria Matejka
Until now, if export table was enabled, Nest was storing exactly the route before rt_notify() was called on it. This was quite sloppy and spooky and it also wasn't reflecting the changes BGP does before sending. And as BGP is storing the routes to be sent anyway, we are simply keeping the already-sent routes in there to better rule out unneeded reexports. Some of the route attributes (IGP metric, preference) make no sense in BGP, therefore these will be probably replaced by something sensible. Also the nexthop shown in the short output is the BGP nexthop.
2022-07-11Do not try to check flowspec validity for piped routesMaria Matejka
2022-07-11Fixed bad import table attributes freeingMaria Matejka
2022-07-11Attribute lists split to storage headers and data to save BGP memoryMaria Matejka
2022-07-11Show route uses the export request also for one-net queriesMaria Matejka
2022-07-11Merge remote-tracking branch 'origin/master' into backportMaria Matejka
2022-07-11Merge commit 'beb5f78a' into backportMaria Matejka
2022-07-10Merge version 2.0.10 into backportMaria Matejka
2022-06-27Filter: Implement for loopsOndrej Zajicek (work)
For loops allow to iterate over elements in compound data like BGP paths or community lists. The syntax is: for [ <type> ] <variable> in <expr> do <command-body>
2022-06-27Filter: Improve handling of stack frames in filter bytecodeOndrej Zajicek (work)
When f_line is done, we have to pop the stack frame. The old code just removed nominal number of args/vars. Change it to use stored ventry value modified by number of returned values. This allows to allocate variables on a stack frame during execution of f_lines instead of just at start. But we need to know the number of returned values for a f_line. It is 1 for term, 0 for cmd. Store that to f_line during linearization.
2022-06-27Nest: Cleanups in as_path_filter()Ondrej Zajicek (work)
Use struct f_val as a common argument for as_path_filter(), as suggested by Alexander Zubkov. That allows to use NULL sets as valid arguments.
2022-06-27Preexport callback now takes the channel instead of protocol as argumentMaria Matejka
Passing protocol to preexport was in fact a historical relic from the old times when channels weren't a thing. Refactoring that to match current extensibility needs.
2022-06-27Moved nexthop + hostentry display to other eattrsMaria Matejka
2022-06-27Route attribute display now normalizes ea_lists.Maria Matejka
This is needed to display every attribute only once with overlay attribute lists recently introduced.
2022-06-27Fixed new route comparisonMaria Matejka
2022-06-27Fixed displaying BGP and RIP attributes after recent reworksMaria Matejka
2022-06-27Fixed minor bugs in handling some route attributesMaria Matejka
2022-06-27Fixed undefined attribute handlingMaria Matejka
2022-06-27The show-route CLI command now uses the route export APIMaria Matejka
In the multithreaded environment, it is not supposed that anybody traverses the routing table as the CLI show-route was doing. Now the routing table traversal is gone and CLI won't hold the table locked while computing filters.
2022-06-24Allowed optimized exporting of a subprefix treeMaria Matejka
Added an option for export filter to allow for prefiltering based on the prefix. Routes outside the given prefix are completely ignored. Config is simple: export in <net> <filter>;
2022-06-24Table export generalized to allow for exporting from non-tablesMaria Matejka
2022-06-20Import tables are stored as an attribute layer inside the main tables.Maria Matejka
The separate import tables were too memory-greedy, there is no need for them being stored as full-sized tables.
2022-06-17Route attribute storage keeps the previous layersMaria Matejka
2022-06-16Showing the nexthop resolution target in import tablesMaria Matejka
2022-06-08Merge commit '938742decc6e1d6d3a0375dd012b75172e747bbc' into haugesundMaria Matejka
2022-06-08Merge commit '950775f6fa3d569a9d7cd05e33538d35e895d688' into haugesundMaria Matejka
There were quite a lot of conflicts in flowspec validation code which ultimately led to some code being a bit rewritten, not only adapted from this or that branch, yet it is still in a limit of a merge.
2022-06-07Fixing FlowSpec validation for v3 internal APIMaria Matejka
Validation is called internally from route table at the same place where nexthop resolution is done. Also accounting for rte->sender semantics change (not a channel but the import hook instead).
2022-06-04Nest: Improve GC strategy for rtablesOndrej Zajicek
Use timer (configurable as 'gc period') to schedule routing table GC/pruning to ensure that prune is done on time but not too often. Randomize GC timers to avoid concentration of GC events from different tables in one loop cycle. Fix a bug that caused minimum inter-GC interval be 5 us instead of 5 s. Make default 'gc period' adaptive based on number of routing tables, from 10 s for small setups to 600 s for large ones. In marge multi-table RS setup, the patch improved time of flushing a downed peer from 20-30 min to <2 min and removed 40s latencies.