summaryrefslogtreecommitdiff
path: root/nest/rt-show.c
AgeCommit message (Collapse)Author
2023-01-19CLI closing fix when its action is run asynchronously.Maria Matejka
Some CLI actions, notably "show route", are run by queuing an event somewhere else. If the user closes the socket, in case such an action is being executed, the CLI must free the socket immediately from the error hook but the pool must remain until the asynchronous event finishes and cleans everything up.
2022-09-08Table access is now locked.Maria Matejka
2022-09-05Exporter routine refactoring to allow for nicer table lockingMaria 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-02Merge commit 'f0507f05ce57398e135651896dace4cb68eeed54' into thread-nextMaria Matejka
2022-07-18Merge commit '94eb0858' into thread-nextMaria 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-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-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-11Show route uses the export request also for one-net queriesMaria Matejka
2022-06-27Moved nexthop + hostentry display to other eattrsMaria 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-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-05-30Merge commit 'f15f2fcee7eeb5a100bd204a0e67018e25953420' into haugesundMaria Matejka
2022-05-30Merge commit '702c04fbef222e802ca4dfac645dc75ede522db6' into haugesundMaria Matejka
2022-05-30Merge commit '337c04c45e1472d6d9b531a3c55f1f2d30ebf308' into haugesundMaria Matejka
2022-05-30Merge commit 'f2f3163f6c3fba7f9ef03640d7b2f6323873d2cc' into haugesundMaria Matejka
2022-05-30Merge commit 'de86040b2cf4ec9bfbb64f0e208a19d4d7e51adc' into haugesundMaria Matejka
2022-05-30Merge commit 'ef6a903e6f44b467f9606018446095521ad01ef1' into haugesundMaria Matejka
2022-05-30Squashing the route attribute structure into one level.Maria Matejka
For now, all route attributes are stored as eattrs in ea_list. This should make route manipulation easier and it also allows for a layered approach of route attributes where updates from filters will be stored as an overlay over the previous version.
2022-05-30Route destination field merged with nexthop attribute; splitting flowspec ↵Maria Matejka
validation result out. As there is either a nexthop or another destination specification (or othing in case of ROAs and Flowspec), it may be merged together. This code is somehow quirky and should be replaced in future by better implementation of nexthop. Also flowspec validation result has its own attribute now as it doesn't have anything to do with route nexthop.
2022-05-26Moved nexthop from struct rta to extended attribute.Maria Matejka
This doesn't do anything more than to put the whole structure inside adata. The overall performance is certainly going downhill; we'll optimize this later. Anyway, this is one of the latest items inside rta and in several commits we may drop rta completely and move to eattrs-only routes.
2022-05-04Moved route preference to eattrsMaria Matejka
2022-05-04Moved advertising router info (FROM attribute) to eattrsMaria Matejka
2022-05-04Filters always allocate from tmp_linpoolMaria Matejka
2022-05-04Attribute list normalization cleanupMaria Matejka
2022-05-04Splitting route data structures out to libMaria Matejka
2022-03-09Merge commit 'f81702b7' into haugesundMaria Matejka
2022-03-09Merge commit '0767a0c2' into haugesundMaria Matejka
Conflicts: nest/rt-table.c
2022-03-09Merge commit '1b9189d5' into haugesundMaria Matejka
2022-03-09Merge commit '60880b539b8886f76961125d89a265c6e1112b7a' into haugesundMaria Matejka
2022-03-09Merge commit '5cff1d5f' into haugesundMaria Matejka
Conflicts: proto/bgp/attrs.c proto/pipe/pipe.c
2022-03-09Merge commit 'd5a32563' into haugesundMaria Matejka
2022-02-06Nest: Implement locking of prefix tries during walksOndrej Zajicek (work)
The prune loop may may rebuild the prefix trie and therefore invalidate walk state for asynchronous walks (used in 'show route in' cmd). Fix it by adding locking that keeps the old trie in memory until current walks are done. In future this could be improved by rebuilding trie walk states (by lookup for last found prefix) after the prefix trie rebuild.
2022-02-06Nest: Avoid unnecessary net_format() in 'show route' commandOndrej Zajicek (work)
When output of 'show route' command was generated, the net_format() was called for each network prematurely, even if the result was not needed. Fix the code to call net_format() only when needed. This makes queries that process many networks but show only few (e.g. 'show route where ..', or 'show route count') much faster (like 5x - 10x faster).
2022-02-06Nest: Add trie iteration code to 'show route'Ondrej Zajicek (work)
Add trie iteration code to rt_show_cont() CLI hook and use it to accelerate 'show route in <addr>' commands using interval queries.
2022-02-06Nest: Implement 'show route in <addr>' commandOndrej Zajicek (work)
Implement 'show route in <addr>' command, which shows all routes in networks that are subnets of given network. Currently limited to IP network types.
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-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-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-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-13Preexport: No route modification, no linpool neededMaria Matejka
2021-10-13RIP fixup + dropping the tmp_attrs mechanism as obsoleteMaria Matejka
2021-10-13Preference moved to RTA and set explicitly in protocolsMaria Matejka