0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-09-19 11:55:21 +00:00
Commit Graph

5075 Commits

Author SHA1 Message Date
Maria Matejka
5c8179d63a Time accounting must be done by coarse timers
on some ARM, the precise timers are too slow to be actually useful
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
d8c0faaec9 Netindex cleanup now doesn't need to unlock to synchronize RCU 2024-06-12 14:48:33 +02:00
Maria Matejka
a146abc8fd Revert (partial) "Route attributes now use the common lockfree usecount"
This partially reverts commit d617801c31.

The common lockfree doesn't work well for high-volume structures like
eattr cache because it expects the structure to be cleaned up by a
sweeper routine ... which is very ineffective for >1M records.

OTOH, we need the deferred ea_free in all cases ... so keeping that.
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
2e882d4a7d IO Loop: process socket reads only after timers and events are done 2024-06-12 14:48:33 +02:00
Maria Matejka
f45c519039 BGP: splitting TX by time, not number of messages sent 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
464d483af4 Channel: postpone the export event when stopping 2024-06-12 14:48:33 +02:00
Maria Matejka
50d7287741 IO Threads: scheduler debug shows info on next loop to run 2024-06-12 14:48:33 +02:00
Maria Matejka
1180f25123 Threads: smoothening loop pickup and less aggressive dropping 2024-06-12 14:48:33 +02:00
Maria Matejka
8ad9c946e1 IO loop picker fixed
Now if the thread finds out that it actually isn't busy,
it unsets the business status and picks something up right away.
2024-06-12 14:48:33 +02:00
Maria Matejka
4bca3b9f86 Task-in-limit checker hacked for mainloop 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
661193cf98 Thread IO: a little bit faster RX repeat 2024-06-12 14:48:33 +02:00
Maria Matejka
f516d7cfe9 Netindex: fix absurd hash parameters 2024-06-12 14:48:33 +02:00
Maria Matejka
6d79433a44 Converted ea cache to spinhash 2024-06-12 14:48:33 +02:00
Maria Matejka
fece55b810 Netindex: converted to spinlocked hash 2024-06-12 14:48:33 +02:00
Maria Matejka
1032bf2543 Hash: Added a spinlocked variant
The spinlocked hash has a main rw spinlock for the data blocks
and then a rw spinlock for each hash chain. Rehashing is asynchronous,
running from an event, and it happens chain-wise, never blocking more
than one chain at a time.
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
602595fe10 Attributes: cleanup
Dropping EAF_TYPE__MAX and adding a check for forgotten
ea class registration
2024-06-12 09:23:50 +02:00
Maria Matejka
bf961ba405 Threads shouldn't drop stopping loops 2024-06-12 09:23:50 +02:00
Maria Matejka
0fb9177374 Loop scheduler tracing options configurable 2024-06-12 09:23:50 +02:00
Maria Matejka
67e9a37291 Fixed nanoseconds in IO loop time limiter 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
b548ffe197 Fixed non-exporting protocol reload crash 2024-06-12 09:23:50 +02:00
Maria Matejka
9e88fc5b6b Netindex: allow u32 -> netindex without locking 2024-06-12 09:23:50 +02:00
Maria Matejka
dbe246a4bd Proto: fix reimporter crash on shutdown
Channel transition to CS_STOP forgot to postpone the reimporter event,
thus reimport could theoretically run too late and cause trouble.
2024-06-12 09:23:50 +02:00
Maria Matejka
d78448dd7c BGP: Dropping the netindex experiment, prefix hash is faster 2024-06-12 09:23:50 +02:00
Maria Matejka
7c59ef3faa RCU Unwinder can now retry without yielding 2024-06-12 09:23:50 +02:00
Maria Matejka
4104d668d9 Read-write spinlocks 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
6ffab25f01 IO loop: fixed unassigned count 2024-06-04 22:20:18 +02:00
Maria Matejka
a19d0de42f Table: Freeing routes deferred to save rcu synchronization 2024-06-04 22:20:18 +02:00
Maria Matejka
d617801c31 Route attributes now use the common lockfree usecount
Also route attributes are not freed immediately anymore.
2024-06-04 22:20:18 +02:00
Maria Matejka
98fee17456 Hash: dropped relics of hash iterators 2024-06-04 22:20:18 +02:00
Maria Matejka
b033561045 Route attribute hash replaced with the generic one 2024-06-04 22:20:18 +02:00
Maria Matejka
423eaf3438 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-04 22:20:18 +02:00
Maria Matejka
5d6c4ff35a BGP: Freeing prefixes 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
2705c385c0 Never allow more than 300 ms per loop 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
f8e3ea9402 BGP: Prefix table uses a pointer array instead of hash 2024-06-04 10:11:36 +02:00
Maria Matejka
dc416d2de3 RCU: Rewritten to be more straightforward 2024-06-04 10:11:36 +02:00
Maria Matejka
7c41d860af Unit test for RCU 2024-06-04 10:11:36 +02:00