0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-11-09 12:48:43 +00:00
Commit Graph

567 Commits

Author SHA1 Message Date
Maria Matejka
5ea6423cb9 Fixed secondary route export 2024-06-28 22:03:45 +02:00
Maria Matejka
c2480ff533 Export: Throw a warning instead of crashing on export_accepted_map inconsistency 2024-06-28 22:03:45 +02:00
Maria Matejka
6eea722d3f Forbid locking altogether when RCU reader is active 2024-06-28 22:03:45 +02:00
Maria Matejka
b797444e94 Merge commit 'b95dc8f29f18eb177f91fdc4bf0716fac9b15366' into mq-config-ref
Also converted all _Bool's to bool.
2024-06-26 17:19:24 +02:00
Maria Matejka
3d45539455 ROA aggregator uses its own rte source instead of recycling 2024-06-26 11:29:43 +02:00
Maria Matejka
d23db54da0 ROA: Switching off digestor splitting 2024-06-26 11:29:43 +02:00
Maria Matejka
0b6e752bd9 Conflating multiple partial ROA reload requests together 2024-06-26 11:29:43 +02:00
Maria Matejka
282066ee29 Moved the cork thresholds massively up
This allows for more efficient import and export bundling, including
best route export and next hop resolution.
2024-06-26 11:29:12 +02:00
Maria Matejka
67875e76d9 Safer cleanup of table auxiliary routines 2024-06-19 12:36:55 +02:00
Maria Matejka
a1405a5bc7 Prefilter runs before generating feeds 2024-06-16 21:36:45 +02:00
Maria Matejka
d6233b4de0 Table cork now uses callbacks and direct flush to uncork 2024-06-15 23:31:44 +02:00
Maria Matejka
83045e9a1f Configuration obstacles made a separate, explicit structure
With this, one can walk the obstacle list in a debugger and
easier see which specific object is holding the reference.
2024-06-14 23:16:07 +02:00
Maria Matejka
4ac55615e4 BGP and HCU uncorking is processed in the right loop
closes #86

The uncork events are running from mainloop so these should just
dispatch the right event to the right loop. Doing anything long there
is bad for performance and latency as the uncork list may be huge.
2024-06-12 22:40:17 +02:00
Maria Matejka
3ed192edc3 Table: RCU synchronization moved to lfjour
the sync is actually needed when the pages get freed, not precisely
after every item cleanup, as the data technically stays intact until the
deferred free's are called.
2024-06-12 18:07:40 +02:00
Maria Matejka
95d8329043 Table: fixed export_all flush when export_best is idle 2024-06-12 14:48:33 +02:00
Maria Matejka
9991fbbe0b TMP: table best-all cleanup debug 2024-06-12 14:48:33 +02:00
Maria Matejka
4d01ca3e8f Every table has its own netindex now
It's obnoxiously slow to walk over sparse tables.
2024-06-12 14:48:33 +02:00
Maria Matejka
8e240fc44f Table best feed collision fix 2024-06-12 14:48:33 +02:00
Maria Matejka
47e493f228 Dropped net_resolve_index from feeder fast path 2024-06-12 14:48:33 +02:00
Maria Matejka
ab1697d7a0 Next hop update is split by time, not by number of routes 2024-06-12 14:48:33 +02:00
Maria Matejka
0827797e6e Table: pruning is deferred by task time, not by item count 2024-06-12 14:48:33 +02:00
Maria Matejka
d7cf378003 Table: too fast export validity check replaced with just a retry 2024-06-12 14:48:33 +02:00
Maria Matejka
d4733b28d9 Dropping netindex fragile manipulation
Now the netindex doesn't expose its internals and can be converted
to the spinlocked implementation much easier.
2024-06-12 09:23:50 +02:00
Maria Matejka
b15eb4b546 roa_check() uses the auxiliary table 2024-06-12 09:23:50 +02:00
Maria Matejka
499d5e6fb3 ROA tables have now an auxiliary table
There is an IP table for every ROA table, holding special records
combining all known ROAs for every top-prefix.

The ROA digestor is now an IP digestor, running over the auxiliary
table.
2024-06-12 09:23:50 +02:00
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