0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-11-08 20:28:43 +00:00
Commit Graph

539 Commits

Author SHA1 Message Date
Maria Matejka
45cd4bbe9c Fixed deferred route freeing crash
The sending channel may be already gone when rte_free_deferred()
is finally called so we have to log about route freeing in the
synchronous call instead.
2024-06-12 09:23:50 +02:00
Maria Matejka
8f4a784e14 Netindex is now net-type specific
Combining all network types in one netindex was just a waste of memory
and too much complexity for no reason.
2024-06-05 17:47:32 +02:00
Maria Matejka
a19d0de42f Table: Freeing routes deferred to save rcu synchronization 2024-06-04 22:20:18 +02:00
Maria Matejka
d4ea561917 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-04 10:11:36 +02:00
Maria Matejka
b287c13f21 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-04 10:11:36 +02:00
Maria Matejka
7a169e46a8 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-04 10:11:36 +02:00
Maria Matejka
34acf22fc7 Netindex: consistency checks and deletion of whole hash 2024-06-04 10:11:36 +02:00
Maria Matejka
ce1a8be9af Hostentry: made src ea_list atomic to help with consistency 2024-06-04 10:11:36 +02:00
Maria Matejka
9490ed2bc5 Export: Next feed step-up is now internal
There is no much reason to do anything else than the netindex technique.
2024-06-04 10:11:36 +02:00
Maria Matejka
10bb1c1e9d 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-04 10:11:36 +02:00
Maria Matejka
76ca53e4f8 SKIP_BACK_DECLARE: easier embedded-to-parent typecasting 2024-05-25 19:37:16 +02:00
Maria Matejka
f6ad42777d Lockless feed of a single net 2024-05-25 19:37:16 +02:00
Maria Matejka
091130e84b 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-05-25 19:37:16 +02:00
Maria Matejka
2b38a833cd 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-05-22 11:34:34 +02:00
Maria Matejka
6fb467a54c RCU Unwinder refactored from route table to a separate structure 2024-05-22 11:34:34 +02:00
Maria Matejka
eaf187b57b 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-05-22 11:34:34 +02:00
Maria Matejka
be902fc55c Fixed flush condition when stale cycle valid/set indicators wrap around 2024-05-22 11:34:34 +02:00
Maria Matejka
182a97f5e6 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-05-22 11:34:34 +02:00
Maria Matejka
83a409abd2 Cached route attributes now have explicitly marked layers
Also the rta_* functions renamed to ea_* functions
2024-05-22 11:34:34 +02:00
Maria Matejka
46164395b2 Fixed all implicit seq_cst warnings caused by the previous commit 2024-05-22 11:34:34 +02:00
Maria Matejka
670c46725b Fixed announcement inconsistency between feeds and regular exports 2024-05-22 11:34:34 +02:00
Maria Matejka
2eebb680c2 Fixed best route announcements after NHU
When more routes in one net changed at once, the best route
announcements were inconsistent which confused exporters.
2024-05-22 11:34:34 +02:00
Maria Matejka
67aafd99d3 Route flag REF_OBSOLETE
Marking routes obsolete when being removed from table, just to be sure.
2024-05-22 11:34:34 +02:00
Maria Matejka
6a13c02d3b Removed the obsolete birdloop flagger
This was useful when events were locking. As now sending events is lockless,
we can drop this obsolete routine for good.
2024-05-22 11:34:34 +02:00
Maria Matejka
59dc95aa25 Simplified table deletion (one less step) 2024-05-22 11:34:34 +02:00
Maria Matejka
728d19703d Hostentry usecount converted to lfuc 2024-05-22 11:34:34 +02:00
Maria Matejka
a6ef8cd492 Route table export journal converted to the generic structure 2024-05-22 11:34:34 +02:00
Maria Matejka
684332b7d2 Replacing the NHU table loop flag with a proper event 2024-05-22 11:34:34 +02:00
Maria Matejka
6bbe9dea3a Flowspec links don't peruse the all-hooks list for lookup 2024-05-22 11:34:34 +02:00
Maria Matejka
77a0310f87 Refactoring: back-merged export data structures
Table-specific structures inheriting commons are too crazy.
2024-05-22 11:34:33 +02:00
Maria Matejka
10f41cda87 Refactoring of struct rt_pending_export
Now it stores const rte * instead of struct rte_storage * to allow for
different storage backends.
2024-05-22 11:34:33 +02:00
Maria Matejka
c06ce7090f Static: Unlock IGP tables on cleanup to avoid problems with hostentry unlocking 2024-05-18 15:50:03 +02:00
Maria Matejka
1e55a8168a Fixed in-table route refresh counter to not randomly add 256 2024-05-18 15:47:45 +02:00
Maria Matejka
a9124be384 Fixed hostcache notifier pool
This pool has to be the service pool to allow the seq bitmaps to grow
from the exporter and feeder routines
2024-05-18 15:47:45 +02:00
Maria Matejka
e38cd2b215 Fixed reporting about exported routes 2024-05-18 15:47:12 +02:00
Maria Matejka
3371ea0843 CLang compilation fix 2024-05-18 15:41:10 +02:00
Maria Matejka
3b217f2984 Fixed L3VPN after merge to v3.
Semantics of rt_get_source() has changed between v2 and v3. Also other
minor fixes were needed to make it run.
2024-01-30 23:14:10 +01:00
Maria Matejka
06030d8bf0 Hostentry eattrs are now properly zeroed 2024-01-30 23:14:10 +01:00
Maria Matejka
95adf7b0fa Fixed regression in route feeding.
We were, once again, forgetting to mark empty-net journal entries as
processed, as was fixed in 32bb548c11.

Introduced in 548dbb2252.
Caught by cf-ebgp-graceful.
2024-01-30 21:31:13 +01:00
Maria Matejka
ea0f2c6194 Fixed attributes normalization with underlays in place 2024-01-28 13:16:25 +01:00
Maria Matejka
25e20485ae Fixed route table attribute caching 2024-01-26 14:42:55 +01:00
Maria Matejka
365ea12ea1 MPLS Subsystem Proper Locking
Added also some debug lines if debug is on.
2024-01-26 14:42:44 +01:00
Maria Matejka
e711a991d4 MPLS: FEC Map moved from protocol to MPLS channel 2024-01-08 13:03:25 +01:00
Maria Matejka
548dbb2252 Replacing table FIB by netindex and simple pointer block
Using the netindex data structure to simplify route storage inside route
tables. This should also help with future unlocking of route import.
2024-01-08 09:34:32 +01:00
Maria Matejka
25906bc5e9 Merge commit 'ef814fb2d6415206fce280c37466ea889291b043' into HEAD 2023-12-08 12:13:58 +01:00
Maria Matejka
ef814fb2d6 Merge commit 'bb094fb6' into mq-aggregator-for-v3 2023-12-08 12:09:17 +01:00
Maria Matejka
bb094fb6c7 Refactoring also net_roa_check
Having 4 functions doing almost the same is more mess than three macros.
2023-12-08 12:08:28 +01:00
Maria Matejka
8c19f8a209 Merge commit 'db1eb46664d4c76d56dc55a63ce7abe853fc6862' into HEAD 2023-12-08 11:33:43 +01:00
Maria Matejka
db1eb46664 Merge commit '54ddf90f6370f06efc71c3ffd6e02d031a86866f' into mq-aggregator-for-v3 2023-12-08 09:08:38 +01:00
Maria Matejka
54ddf90f63 Conf: debug tables
For now just a dummy config but it is needed for forward
compatibility with v3.
2023-12-07 14:38:05 +01:00