0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-12-22 09:41:54 +00:00
Commit Graph

5042 Commits

Author SHA1 Message Date
Katerina Kubecova
e87080fd08 mrt: mrt looks working both period and from cli
mrt: mrt looks working both period and from cli

fixup

fixup
2024-06-24 13:42:27 +02:00
Katerina Kubecova
e0fd481b98 mrt.c: period mrt logging works (but routes in v3 seem to have less attributes)
mrt: mrt looks working

mrt: mrt looks working

mrt: mrt looks workingfrom both period and cli

mrt: mrt looks workingfrom both period and from cli

mrt: mrt looks workingfrom both period and from cli
2024-06-24 09:42:03 +02:00
Katerina Kubecova
5f996b4bbf generic nexthop eattr in bgp error 2024-06-24 09:42:03 +02:00
Katerina Kubecova
b3e13eddb9 proto.c: show protocol uses only proto id and attr table 2024-06-24 09:42:03 +02:00
Maria Matejka
f715b3decc IO loop: fixed unassigned count 2024-06-24 09:42:03 +02:00
Maria Matejka
24010536f3 Table: Freeing routes deferred to save rcu synchronization 2024-06-24 09:42:03 +02:00
Maria Matejka
4e60865a4d Route attributes now use the common lockfree usecount
Also route attributes are not freed immediately anymore.
2024-06-24 09:42:03 +02:00
Maria Matejka
fc1ea9119f Hash: dropped relics of hash iterators 2024-06-24 09:42:03 +02:00
Maria Matejka
a04f5c7524 Route attribute hash replaced with the generic one 2024-06-24 09:42:03 +02:00
Maria Matejka
e4b9f0f70d Softened warning about too much time spent in loop
Now the warning needs at least 10 ms after the scheduled end time
to ever complain.

TODO: make this configurable
2024-06-24 09:42:03 +02:00
Maria Matejka
487b21b491 BGP: Freeing prefixes deferred to save rcu synchronization 2024-06-24 09:42:03 +02:00
Maria Matejka
2fedf99924 Common parts of the ROA updater moved into the table
Channel is now just subscribing to yet another journal announcing
digested tries from the ROA table.

Creating tries in every channel on-the-fly was too slow to handle
and it ate obnoxious amounts of memory. Instead, the tries are
constructed directly in the table and the channels are notified
with the completed tries.

The delayed export-release mechanism is used to keep the tries allocated
until routes get reloaded.
2024-06-24 09:42:03 +02:00
Maria Matejka
e994aa93c7 Task deferrer: kinda more dumb-resistant macro
Originally, this mechanism required to check whether there's enough time to work
and then to send an event. This macro combines all the logic and goes more straightforwardly
to the _end_ of the export processing loop.

One should note that there were two cases where the export processing loop
was deferred at the _beginning_, which led to ignoring some routes on
reimports. This wasn't easily noticeable in the tests until the one-task
limit got a ceiling on 300 ms to keep reasonable latency.
2024-06-24 09:42:03 +02:00
Maria Matejka
a971064310 Never allow more than 300 ms per loop 2024-06-24 09:42:03 +02:00
Maria Matejka
36aa64fe1c BGP: export table stores routes, reloads and shows in CLI.
In future, this and rtable's data structures should be probably merged
but it isn't a good idea to do now. The used data structure is similar
to rtable -- an array of pointers to linked lists.

Feed is lockless, as with all tables.

Full export (receiving updates) is not supported yet but we don't have
any method how to use it anyway. Gonna implement it later.
2024-06-24 09:42:03 +02:00
Maria Matejka
bbb9532f1e BGP: Prefix table uses a pointer array instead of hash 2024-06-24 09:42:03 +02:00
Maria Matejka
1e7fb948a8 RCU: Rewritten to be more straightforward 2024-06-24 09:42:03 +02:00
Maria Matejka
78a7d16c9d Unit test for RCU 2024-06-24 09:42:03 +02:00
Maria Matejka
178ae9ba9e Netindex: consistency checks and deletion of whole hash 2024-06-24 09:42:03 +02:00
Maria Matejka
1371661156 If debugging, store a malloc circular log for easier debugging 2024-06-24 09:42:03 +02:00
Maria Matejka
102cea56f2 Hostentry: made src ea_list atomic to help with consistency 2024-06-24 09:42:03 +02:00
Maria Matejka
7ef2a042bc Slab: can be deleted as a single object 2024-06-24 09:42:03 +02:00
Maria Matejka
a9208e602d Export: Next feed step-up is now internal
There is no much reason to do anything else than the netindex technique.
2024-06-24 09:42:03 +02:00
Maria Matejka
dd841dd472 BGP: Simpler hashing in export table
We need a hashing simple enough to allow for feeding by netindex.
2024-06-24 09:42:03 +02:00
Maria Matejka
5ed9dcb1b6 BGP: Export uses common attribute cache
There is no real need for storing bucket attributes locally and we may
save some memory by caching the attributes in one central place.

If this becomes a contention problem, we should reduce the lock load
of the central attribute cache.
2024-06-24 09:42:03 +02:00
Maria Matejka
ea9f64e0ec BGP: pending TX prefixes link netindex instead of copying net_addr
This helps with memory consumption, allows for removal of multiple
slab/mblock ifs and prepares for easier feeds.
2024-06-24 09:42:03 +02:00
Maria Matejka
1eed19cadb BGP: refactored pending TX back into channel 2024-06-24 09:42:03 +02:00
Maria Matejka
5cbebfc940 Real almost-lockless feeds and more pull-like exports
Introducing a new omnipotent internal API to just pass route updates
from whatever point wherever we want.

From now on, all the exports should be processed by RT_WALK_EXPORTS
macro, and you can also issue a separate feed-only request to just get a
feed and finish.

The exporters can now also stop and the readers must expect that to
happen and recover. Main tables don't stop, though.
2024-06-24 09:42:03 +02:00
Maria Matejka
1d0e47e74b BGP: explicitly sending route refresh from CLI 2024-06-24 09:42:03 +02:00
Maria Matejka
402a574050 Protocol filter reload is now done by 'reload filters'
This prepares for the separate 'reload bgp' command triggering BGP Route Refresh
2024-06-24 09:42:03 +02:00
Maria Matejka
2357fc7d95 Static: Fixed undefined nexthop padding problems 2024-06-24 09:42:03 +02:00
Maria Matejka
b6e70f5ecf Netindex: fixed resolving net by index 2024-06-24 09:42:03 +02:00
Maria Matejka
2537e7f924 RIP partial reload never worked properly, running full reload always 2024-06-24 09:42:03 +02:00
Maria Matejka
b9db1d70fe Dropping obsolete protocol Perf
We have now better methods how to measure overall performance
and this obsolete protocol has basically rotten away. If anybody
needs its features, feel free to revive it in future.
2024-06-24 09:42:03 +02:00
Maria Matejka
23c861f95e OSPF partial reload never worked properly, running full reload always 2024-06-24 09:42:03 +02:00
Maria Matejka
89c92abb7a Simplified temporary resources
Also TMP_SAVED now uses the CLEANUP hook to allow for breaks and returns
2024-06-24 09:42:03 +02:00
Maria Matejka
39f69064ec SKIP_BACK_DECLARE: easier embedded-to-parent typecasting 2024-06-24 09:42:03 +02:00
Maria Matejka
66e98f69f8 Lockless feed of a single net 2024-06-24 09:42:03 +02:00
Maria Matejka
21c1df625a Using ea_lookup_tmp() for temporarily keeping attribute references
To avoid needs for keeping local temporary references for attributes,
now one can use ea_lookup_tmp() to ensure that the attributes are
valid and stored until the task ends. After that, the attributes are
automatically unref'd and also deallocated if needed.
2024-06-24 09:42:03 +02:00
Maria Matejka
bff3b7eb2c Refactored the deferring framework into a separate structure 2024-06-24 09:42:03 +02:00
Maria Matejka
e39a76d6f6 Avoiding RCU synchronization deadlock when locking in critical section
Explicitly marking domains eligible for RCU synchronization. It's then
forbidden to lock these domains in RCU critical section to avoid
possible deadlock.
2024-06-24 09:42:03 +02:00
Maria Matejka
2ca9e6fdeb RCU Unwinder refactored from route table to a separate structure 2024-06-24 09:42:03 +02:00
Maria Matejka
020c34136f Table feeds are now lockless
This commit makes the route chains in the tables atomic. This allows not
only standard exports but also feeds and bulk exports to be processed
without ever locking the table.

Design note: the overall data structures are quite brittle. We're using
RCU read-locks to keep track about readers, and we're indicating ongoing
work on the data structures by prepending a REF_OBSOLETE sentinel node
to make every reader go waiting.

All the operations are intended to stay inside nest/rt-table.c and it
may be even best to further refactor the code to hide the routing table
internal structure inside there. Nobody shall definitely write any
routines manipulating live routes in tables from outside.
2024-06-24 09:42:03 +02:00
Maria Matejka
629e29febf Fixed flush condition when stale cycle valid/set indicators wrap around 2024-06-24 09:42:03 +02:00
Maria Matejka
074384d6ba Kernel: replaced synchronous prune by a refeed 2024-06-24 09:42:03 +02:00
Maria Matejka
37e8cffc0a Lockless hostentry resolution
Now the hostentry doesn't need to lock table, instead it tracks the
hostentry version and retries if the hostentry changed while updating.
2024-06-24 09:42:03 +02:00
Maria Matejka
c872b8f826 Cached route attributes now have explicitly marked layers
Also the rta_* functions renamed to ea_* functions
2024-06-24 09:42:03 +02:00
Maria Matejka
ba3b8607fb Netindex: Dropping tmp handle mechanism in favor of deferred lfuc_unlock 2024-06-24 09:42:03 +02:00
Maria Matejka
a66be7641e Fixed all implicit seq_cst warnings caused by the previous commit 2024-06-24 09:42:03 +02:00
Maria Matejka
51795c3e05 Enabling warnings for implicit seq_cst in atomic access 2024-06-24 09:42:03 +02:00