0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-12-23 18:21:54 +00:00
Commit Graph

1368 Commits

Author SHA1 Message Date
Katerina Kubecova
b3e13eddb9 proto.c: show protocol uses only proto id and attr table 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
a04f5c7524 Route attribute hash replaced with the generic one 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
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
178ae9ba9e Netindex: consistency checks and deletion of whole hash 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
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
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
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
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
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
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
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
a66be7641e Fixed all implicit seq_cst warnings caused by the previous commit 2024-06-24 09:42:03 +02:00
Maria Matejka
53e3bf9063 Fixed announcement inconsistency between feeds and regular exports 2024-06-24 09:42:03 +02:00
Maria Matejka
51ebbda95c 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-06-24 09:42:03 +02:00
Maria Matejka
35ff820a3b Route flag REF_OBSOLETE
Marking routes obsolete when being removed from table, just to be sure.
2024-06-24 09:42:03 +02:00
Maria Matejka
929df85f1e 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-06-24 09:42:03 +02:00
Maria Matejka
feb16991ee Simplified table deletion (one less step) 2024-06-24 09:42:03 +02:00
Maria Matejka
7c4db11b9f Hostentry usecount converted to lfuc 2024-06-24 09:42:03 +02:00
Maria Matejka
a3b125e223 Lockfree usecount: deferring unlocks to the metaloop
This allows us for easy temporary locks without additional burden of explicit cleanup.
2024-06-24 09:42:03 +02:00
Maria Matejka
08f67979ce Route table export journal converted to the generic structure 2024-06-24 09:42:03 +02:00
Maria Matejka
cb6e7123c4 Replacing the NHU table loop flag with a proper event 2024-06-24 09:42:03 +02:00
Maria Matejka
90127cb2d2 Flowspec links don't peruse the all-hooks list for lookup 2024-06-24 09:42:03 +02:00
Maria Matejka
22f58ac316 Refactoring: back-merged export data structures
Table-specific structures inheriting commons are too crazy.
2024-06-24 09:42:03 +02:00
Maria Matejka
dea78a5c51 Export table dump temporarily switched off 2024-06-24 09:42:03 +02:00
Maria Matejka
561116f6fb Added and explicit target table to the ROA subscription object 2024-06-24 09:42:03 +02:00
Maria Matejka
35fe916155 Refactoring of struct rt_pending_export
Now it stores const rte * instead of struct rte_storage * to allow for
different storage backends.
2024-06-24 09:42:03 +02:00
Maria Matejka
95748b6c55 Static: Unlock IGP tables on cleanup to avoid problems with hostentry unlocking 2024-06-24 09:42:03 +02:00
Maria Matejka
aee44d1ef0 Fixed in-table route refresh counter to not randomly add 256 2024-06-24 09:42:03 +02:00
Maria Matejka
8408d5c4e1 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-06-24 09:42:03 +02:00
Maria Matejka
cdadd2b53d Fixed reporting about exported routes 2024-06-24 09:42:03 +02:00
Maria Matejka
4a2dc1dc8b Undefined behavior fix 2024-06-24 09:42:03 +02:00
Maria Matejka
683b59bba0 CLang compilation fix 2024-06-24 09:42:03 +02:00
Ondrej Zajicek
0883ce66bf Merge commit '1b064355f752b9bfe4644f775697bbd9b711f762' into thread-next 2024-04-01 18:20:18 +02:00
Ondrej Zajicek
4036da3732 Nest: Fix bitfield attributes
Fix missing route lookup, causing crash when accessing route attribute.

Also fix additional space in bitfield formatting.
2024-03-28 19:46:24 +01:00
Ondrej Zajicek
c195c7a0d5 Merge commit '224a152c53f304881f8616a1c9255b467062a069' into thread-next 2024-03-28 16:22:23 +01:00
Ondrej Zajicek
62c9f12dfc Merge commit '574d7eb241a60622b0573ab1460cb23d968ba1cc' into thread-next 2024-03-28 15:00:40 +01:00
Ondrej Zajicek
468f1d6547 Nest: Improve printing of hostentries with MPLS labels
MPLS labels in hostentry should be printed with 'mpls' keyword instead of
'labels' to be consistent with the rest of the 'show route' output.
2024-03-27 23:26:25 +01:00
Ondrej Zajicek
eadebc287b Nest: Fix printing of hostentry table
When hostentry is printed, it should show the table in which the nexthop
is resolved, not the dependend one.
2024-03-27 23:16:51 +01:00
Ondrej Zajicek
1b064355f7 Client: Add support for completion of command options
We can easily extend command completion to handle also keywords for
command options. Help for command options is not yet supported.
2024-03-05 19:04:10 +01:00