]> git.ipfire.org Git - thirdparty/bird.git/log
thirdparty/bird.git
4 months agoslab: function to assert slab id empty kk-slab-refactoring-2025-03-10
Katerina Kubecova [Fri, 14 Mar 2025 10:48:48 +0000 (11:48 +0100)] 
slab: function to assert slab id empty

4 months agofixup: slab.c: Prevent running sl_free after slab_free
Katerina Kubecova [Thu, 13 Mar 2025 09:57:34 +0000 (10:57 +0100)] 
fixup: slab.c: Prevent running sl_free after slab_free

4 months agofixup! fixup! rt-attr.c: make ea class usecount atomic
Katerina Kubecova [Wed, 12 Mar 2025 16:07:42 +0000 (17:07 +0100)] 
fixup! fixup! rt-attr.c: make ea class usecount atomic

4 months agofixup! rt-attr.c: make ea class usecount atomic
Katerina Kubecova [Wed, 12 Mar 2025 15:37:25 +0000 (16:37 +0100)] 
fixup! rt-attr.c: make ea class usecount atomic

4 months agort-attr.c: make ea class usecount atomic
Katerina Kubecova [Wed, 12 Mar 2025 15:35:06 +0000 (16:35 +0100)] 
rt-attr.c: make ea class usecount atomic

4 months agofixup! fixup: rt-attr.c: (hopefully) solved deadlock in rehash. The solution for...
Katerina Kubecova [Tue, 11 Mar 2025 16:10:18 +0000 (17:10 +0100)] 
fixup! fixup: rt-attr.c: (hopefully) solved deadlock in rehash.  The solution for rehash broke ea_storage_free logic, but now both look repaired.

4 months agofixup: rt-attr.c: (hopefully) solved deadlock in rehash.
Katerina Kubecova [Tue, 11 Mar 2025 15:50:41 +0000 (16:50 +0100)] 
fixup: rt-attr.c: (hopefully) solved deadlock in rehash.
 The solution for rehash broke ea_storage_free logic, but now both look repaired.

4 months agoBGP: Export uses common attribute cache
Maria Matejka [Wed, 29 May 2024 06:18:31 +0000 (08:18 +0200)] 
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.

This was a contention problem though, so this commit got reverted,
but now the attribute cache is actually lockless (yay!) and we can
try it again.

If this becomes a contention problem, we should ... no, please not.
Not again! Please!

(Dug out from the history and updated by Katerina Kubecova.)

4 months agoUnlocking the global attribute cache
Katerina Kubecova [Fri, 31 Jan 2025 10:13:26 +0000 (11:13 +0100)] 
Unlocking the global attribute cache

Now, when we have the unlocked slab, we can also go for a completely
lockless global attribute cache, which has been the major contention
point in BIRD 3.

This is a complicated data structure, basically a lockless hash table
with use-counted items inside, allowing concurrent insertions and
deletions.

Hash tables have to dynamically resize its base array, and the rehash
routine runs from an event if needed.

Also, due to some funny meta-race conditions, it is now possible to
end up with multiple ea_list_storage instances with the same contents,
yet it looks like it happens very rarely. (Prove us wrong, we dare you!)

4 months agoSlab: Allowing concurrent allocations without locking
Katerina Kubecova [Wed, 18 Dec 2024 11:18:17 +0000 (12:18 +0100)] 
Slab: Allowing concurrent allocations without locking

Every active thread now gets its own page from which it allocates
blocks. This enables concurrent allocations without much contention,
alleviating the need for mutex locking over Slab allocations,
effectively making Slab lock-free.

This adds some overhead in case every thread just allocates one item and
finishes, yet these situations should not happen too often and/or have
too large impact, so we don't need to care much. If something like this
happens, though, please cry. We'll cry with you, for sure.

Also there is a cleanup routine now which has to run often enough to
ensure that pages with some freed blocks get available for allocations.

This rework also changes the API of slabs, requiring an event list to
send cleanup events to, to be passed to sl_new().

4 months agoSlab: Remove fake slab
Katerina Kubecova [Tue, 17 Dec 2024 14:34:56 +0000 (15:34 +0100)] 
Slab: Remove fake slab

From the beginning, there is a years-old implementation of a slab
not actually being a slab, just transparently passing all requests
to malloc and free. We don't need that anymore, we have different
methods now to determine whether the problem is the allocator or
something else, and as we are going to change the slab API anyway,
together with some behavioral updates, having a fake slab is just
an anachronism.

4 months agoThreads: assigning IDs from hmap
Katerina Kubecova [Wed, 18 Dec 2024 13:24:25 +0000 (14:24 +0100)] 
Threads: assigning IDs from hmap

For certain upcoming data structures, we actually need to use thread IDs
as a functional information to index things, not just a logging token.
Thus, we need them to be dense, not just flying around as they were until now.

To achieve this, we assign the IDs from a global hmap when the threads
are started, and properly return them when the threads are finished.
This way, the IDs of stopping threads are expected to be recycled,
whereas until now it wasn't expected to happen.

You may need to take care about this in your log reading apparatus.

Also there is now a maximum thread count hard limit because unlimited
thread count is too crazy to handle. But the limit is still ridiculously
high and nobody is ever expected to hit it anyway.

4 months agoThreads: add a callback for thread shutdown
Maria Matejka [Thu, 23 Jan 2025 12:15:43 +0000 (13:15 +0100)] 
Threads: add a callback for thread shutdown

4 months agoRCU: Add split-sync calls
Maria Matejka [Fri, 31 Jan 2025 12:17:11 +0000 (13:17 +0100)] 
RCU: Add split-sync calls

Now, instead of synchronize_rcu(), one can call rcu_begin_sync(),
store the value, and (probably via defer_call()) use it later
to check by rcu_end_sync() that it indeed has ended.

4 months agoDocumentation: show memory decription
Katerina Kubecova [Wed, 15 Jan 2025 12:06:16 +0000 (13:06 +0100)] 
Documentation: show memory decription

4 months agoRevert migration of route attributes and BGP TX cache to Stonehenge
Maria Matejka [Wed, 19 Feb 2025 08:40:27 +0000 (09:40 +0100)] 
Revert migration of route attributes and BGP TX cache to Stonehenge

It collides with the new implementation of lockless Slab and global
attribute cache, and becomes effectively useless.

This reverts commit 4f7899e3cb17ee67875e53512db25ba5aa1dc236.
This reverts commit 240dd41f06ef805f0f45ab8d2f58376fb9e538a6.
This reverts commit 29df992f7f6ad03110240b2e65b498fe97371725.

4 months agoTaming static checker: flow[64]_validate_cf() checks NULL data
Maria Matejka [Thu, 13 Feb 2025 17:25:44 +0000 (18:25 +0100)] 
Taming static checker: flow[64]_validate_cf() checks NULL data

This does not apply for the current code but if somebody chose to use
the flowspec validation functions for something totally broken, it may
unnecessarily crash.

4 months agoTaming static checker: MPLS static label policy requires static handles
Maria Matejka [Thu, 13 Feb 2025 12:10:04 +0000 (13:10 +0100)] 
Taming static checker: MPLS static label policy requires static handles

4 months agoTaming static checker: Do not request bits on negative positions in prefixes
Maria Matejka [Thu, 13 Feb 2025 11:12:20 +0000 (12:12 +0100)] 
Taming static checker: Do not request bits on negative positions in prefixes

The code is actually called. It's harmless, yet confusing.

4 months agoTaming static checker: Fixed hypothetical adata comparator crash
Maria Matejka [Thu, 13 Feb 2025 09:22:08 +0000 (10:22 +0100)] 
Taming static checker: Fixed hypothetical adata comparator crash

4 months agoBFD session handling rework
Maria Matejka [Mon, 3 Feb 2025 14:21:52 +0000 (15:21 +0100)] 
BFD session handling rework

The original implementation for BIRD 3 was rooted in the first
methods how I tried to go for multithreading and it had several flaws,
mostly incomprehensive notification and request pickup routines.
Also converting to a double-loop architecture where one of the
loops (low-latency) solely runs BFD socket communication, whereas
the other one does all the other shenanigans.

4 months agoProper thread group setup
Maria Matejka [Tue, 4 Feb 2025 20:13:26 +0000 (21:13 +0100)] 
Proper thread group setup

Now the thread groups can be explicitly configured with their
latency and timing values.

4 months agoIO loop: converted the thread group to a regular locked structure
Maria Matejka [Wed, 5 Feb 2025 12:08:48 +0000 (13:08 +0100)] 
IO loop: converted the thread group to a regular locked structure

4 months agoIO loop: refactored thread and loop lists to tlists
Maria Matejka [Tue, 4 Feb 2025 20:44:28 +0000 (21:44 +0100)] 
IO loop: refactored thread and loop lists to tlists

4 months agoTlist enlisted allows const pointer argument
Maria Matejka [Wed, 5 Feb 2025 20:41:32 +0000 (21:41 +0100)] 
Tlist enlisted allows const pointer argument

4 months agoMake implicit function declaration an actual error
Maria Matejka [Wed, 5 Feb 2025 17:42:29 +0000 (18:42 +0100)] 
Make implicit function declaration an actual error

4 months agoFixed SAME_TYPE to work with obviously nonzero pointers without warnings
Maria Matejka [Tue, 4 Feb 2025 09:41:05 +0000 (10:41 +0100)] 
Fixed SAME_TYPE to work with obviously nonzero pointers without warnings

4 months agoTaming static checker: rt_notify never sets net_addr to zero
Maria Matejka [Fri, 31 Jan 2025 22:54:29 +0000 (23:54 +0100)] 
Taming static checker: rt_notify never sets net_addr to zero

4 months agoTaming static checker: don't memcpy zero length
Maria Matejka [Fri, 31 Jan 2025 22:51:44 +0000 (23:51 +0100)] 
Taming static checker: don't memcpy zero length

4 months agoMerge commit '99c295e59' into thread-next
Maria Matejka [Mon, 10 Mar 2025 09:51:41 +0000 (10:51 +0100)] 
Merge commit '99c295e59' into thread-next

4 months agoMerge commit '2679de7a3' into thread-next
Maria Matejka [Mon, 10 Mar 2025 09:51:25 +0000 (10:51 +0100)] 
Merge commit '2679de7a3' into thread-next

4 months agoMerge commit 'a8fa3f6b8' into thread-next
Maria Matejka [Mon, 10 Mar 2025 09:35:06 +0000 (10:35 +0100)] 
Merge commit 'a8fa3f6b8' into thread-next

4 months agoMerge commit 'deec84ca3' into thread-next
Maria Matejka [Mon, 10 Mar 2025 09:29:44 +0000 (10:29 +0100)] 
Merge commit 'deec84ca3' into thread-next

4 months agoMerge commit '96ec6b42d' into thread-next
Maria Matejka [Mon, 10 Mar 2025 09:27:19 +0000 (10:27 +0100)] 
Merge commit '96ec6b42d' into thread-next

4 months agoMerge commit '8d062e931' into thread-next
Maria Matejka [Mon, 10 Mar 2025 09:26:33 +0000 (10:26 +0100)] 
Merge commit '8d062e931' into thread-next

4 months agoMerge commit '161aef353' into thread-next
Maria Matejka [Mon, 10 Mar 2025 09:24:16 +0000 (10:24 +0100)] 
Merge commit '161aef353' into thread-next

4 months agoMerge commit '38a422d48' into thread-next
Maria Matejka [Mon, 10 Mar 2025 09:21:03 +0000 (10:21 +0100)] 
Merge commit '38a422d48' into thread-next

4 months agoMerge commit '6a55359b1' into thread-next
Maria Matejka [Mon, 10 Mar 2025 09:16:50 +0000 (10:16 +0100)] 
Merge commit '6a55359b1' into thread-next

4 months agoTable export: Relaxing too strict inconsistency assert
Maria Matejka [Mon, 10 Mar 2025 08:15:53 +0000 (09:15 +0100)] 
Table export: Relaxing too strict inconsistency assert

In case of refeeds, we may get old routes which we have not seen,
the table does not know that and the channel ingress is the right place
to detect it.

Bug introduced in commit 25557fceb08c8db6daead02a2f4b7a99d8a1f922
by Maria Matejka <mq@ucw.cz>, Mon Mar 3 19:48:58 2025 +0100

    Table export: Another inconsistency in refeeds

4 months agoDoc: Replace <m/num/ with <m/number/
Ondrej Zajicek [Sun, 9 Mar 2025 21:58:31 +0000 (22:58 +0100)] 
Doc: Replace <m/num/ with <m/number/

Both variants were used inconsistently, the second one is more frequent
and more expressive.

4 months agoDoc: Add BGP reconfiguration section
Jana Babovakova [Wed, 5 Mar 2025 14:10:02 +0000 (15:10 +0100)] 
Doc: Add BGP reconfiguration section

Some changes by committer.

4 months agoDoc: Minor fixes in BGP options
Jana Babovakova [Wed, 5 Mar 2025 14:08:03 +0000 (15:08 +0100)] 
Doc: Minor fixes in BGP options

4 months agoDoc: Add BGP protocol outline
Jana Babovakova [Wed, 5 Mar 2025 14:05:43 +0000 (15:05 +0100)] 
Doc: Add BGP protocol outline

4 months agoFixed refeed seqmap inconsistency
Maria Matejka [Sat, 8 Mar 2025 16:09:35 +0000 (17:09 +0100)] 
Fixed refeed seqmap inconsistency

For some weird reason (probably oversight, as always), regular exports
were not marked in seq_map, leading to sus reexports and confusing
refeeds.

5 months agoBGP: Fix reconfiguration of hostname option
Ondrej Zajicek [Thu, 6 Mar 2025 15:09:36 +0000 (16:09 +0100)] 
BGP: Fix reconfiguration of hostname option

The old code did not properly compare and update hostname strings,
causing BGP restarts during reconfigurations.

5 months agoNest: Fix locking of tables by channels
Ondrej Zajicek [Thu, 6 Mar 2025 02:43:15 +0000 (03:43 +0100)] 
Nest: Fix locking of tables by channels

Channels that are down keep ptr on routing tables but do not keep them
locked. It is safe because the existence of tables depend on being
configured. But when a table is removed during reconfiguration, the
channel kept a dangling pointer since it fell down until it was removed.
This could be triggered by 'show protocols all' and other similar.

Change locking so that a channel kept a table locked for its whole
existence. The same change is already in BIRD 3.

Note that this is somewhat conceptually problematic as downed channels
do not keep resources. Also, other objects in specialized channels
(igp_table, base_table in bgp_channel, mpls_domain / mpls_range in
mpls_channel) are still locked only when channel is active, but for
them it is easier to keep track that they are not accessed when
they are deconfigured.

5 months agoTable best export: asserting seqmap consistency
Maria Matejka [Tue, 4 Mar 2025 12:04:20 +0000 (13:04 +0100)] 
Table best export: asserting seqmap consistency

In case of some exports have been seen and others not, it makes no sense
for the second one to be seen if the first one was not seen.

5 months agoRCU Unwinder stores where it came from last time
Maria Matejka [Tue, 4 Mar 2025 12:02:01 +0000 (13:02 +0100)] 
RCU Unwinder stores where it came from last time

This information is vital for stuck situations where the
RCU Unwinder keeps longjumping away.

5 months agoTable export: Another inconsistency in refeeds
Maria Matejka [Mon, 3 Mar 2025 18:48:58 +0000 (19:48 +0100)] 
Table export: Another inconsistency in refeeds

When a route has been already sent to the channel and the refeed
runs because of a filter change or just because requested, the
old and new routes are the same which was actually not anticipated
by rt_notify_basic().

5 months agoFilters: don't rewrite gw explicitly set by filters
Maria Matejka [Wed, 26 Feb 2025 13:45:24 +0000 (14:45 +0100)] 
Filters: don't rewrite gw explicitly set by filters

If the originating protocol sets hostentry, it should be
overridden by filters and not rewrite gw.

This fixes #156. Issue #154 may need a similar fix.

Thanks to Peter Hutchinson for reporting.

Signed-Off-By: Katerina Kubecova <katerina.kubecova@nic.cz>
5 months agoFix source-specific routing in Bird 3
Toke Høiland-Jørgensen via Bird-users [Tue, 25 Feb 2025 15:05:10 +0000 (16:05 +0100)] 
Fix source-specific routing in Bird 3

Commit 69d1ffde4c72 ("Split route data structure to storage (ro) /
manipulation (rw) structures.") changed rte->net from a pointer to a
'struct network' to a 'struct net_addr', but kept the address-of (&)
operator before casting to 'net_addr_ip6_sadr *' when sending a
source-specific route to the kernel.

Because 'struct network' had an embedded struct member (struct
fib_node), the address-of was needed to get back to a pointer to the
data, but with the change in the commit mentioned above, e->net is now a
straight pointer to the address.

The bug meant that the source prefixes passed to the kernel were
essentially garbage, leading to routes in the kernel like:

default from b74:9e05:0:1:d8cf:c000::/86 via fe80::1 dev eth0 proto bird metric 32 pref medium

Fix this by getting rid of the address-of operator.

Note by commiter: used our TYPE_CAST macro instead of plain typecast
to avoid this kind of problem in future.

Fixes: 69d1ffde4c72 ("Split route data structure to storage (ro) / manipulation (rw) structures.")
Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk>
Signed-off-by: Maria Matejka <mq@jmq.cz>
5 months agoCI: Add hostname test to CI
Ondrej Zajicek [Tue, 25 Feb 2025 15:52:00 +0000 (16:52 +0100)] 
CI: Add hostname test to CI

5 months agoAdd option hostname for each protocol
Jana Babovakova [Wed, 12 Feb 2025 16:06:39 +0000 (17:06 +0100)] 
Add option hostname for each protocol

5 months agoInstall comment updated by Maria
Jana Babovakova [Tue, 11 Feb 2025 11:01:59 +0000 (12:01 +0100)] 
Install comment updated by Maria

5 months agoUpdated router id docs to 4-byte integer.
Jana Babovakova [Mon, 24 Feb 2025 13:39:29 +0000 (14:39 +0100)] 
Updated router id docs to 4-byte integer.

5 months agoTable export: fixed inconsistency in export_rejected_map
Katerina Kubecova [Tue, 25 Feb 2025 11:46:06 +0000 (12:46 +0100)] 
Table export: fixed inconsistency in export_rejected_map

When updates arrived in such an order that the first one was rejected and
the second one got accepted, the export_rejected_map flag mistakenly
stayed set, leaking the route ID.

In the RA_OPTIMAL channel mode, there are consistency checks that at
most one route for a net has been accepted or rejected. After some time,
the leaked ID and bit in export_rejected_map caused spurious crashes in
asserts later in channel_notify_basic().

Thanks to NIX-CZ and Maiyun Zhang for reporting this.

5 months agoFixing a refeed inconsistency
Maria Matejka [Mon, 17 Feb 2025 20:37:46 +0000 (21:37 +0100)] 
Fixing a refeed inconsistency

On refeed, the table should not resend any obsolete routes
which have already been seen by the recipient, nor the appropriate
journal items.

5 months agoAdded build for Debian 12
Maria Matejka [Wed, 12 Feb 2025 20:30:55 +0000 (21:30 +0100)] 
Added build for Debian 12

Needed right now for a customer. There is a better fix pending.

5 months agoBGP export table src fix
Maria Matejka [Wed, 12 Feb 2025 20:29:10 +0000 (21:29 +0100)] 
BGP export table src fix

When exchanging routes in BGP export table, we forgot to update
the src in cases of add path off. This led to falsely claiming another
origin of that route in export table dump and also holding protocols
in the flush state because of their srcs being kept in the export tables.

5 months agoFlowspec: allowed TES_PARTIAL in validator link state
Maria Matejka [Tue, 11 Feb 2025 18:57:46 +0000 (19:57 +0100)] 
Flowspec: allowed TES_PARTIAL in validator link state

This probably slipped through some refactoring, TES_PARTIAL
is definitely a valid state for a flowspec link export.

5 months agoFix channel restart sequence
Maria Matejka [Mon, 10 Feb 2025 11:29:51 +0000 (12:29 +0100)] 
Fix channel restart sequence

If channel goes start -> pause -> start, the original code crashed
but it's a valid sequence for protocol half-restart, going from UP
to START and then back UP.

5 months agoOld config should not be freed early when reconfiguring in fast succession
Maria Matejka [Mon, 10 Feb 2025 13:18:19 +0000 (14:18 +0100)] 
Old config should not be freed early when reconfiguring in fast succession

5 months agoKernel: pause exports also on restart until scan is done
Maria Matejka [Wed, 12 Feb 2025 11:38:20 +0000 (12:38 +0100)] 
Kernel: pause exports also on restart until scan is done

To save some time, exports are disabled to kernel when the initial scan
is running. The same should happen when kernel protocol is restarting.

5 months agolib: Unify alignment of allocators
Ondrej Zajicek [Thu, 9 Jan 2025 15:44:51 +0000 (16:44 +0100)] 
lib: Unify alignment of allocators

Different internal allocators (memory blocks, linpools, and slabs) used
different way to compute alignment. Unify it to use alignment based on
standard max_align_t type.

On x86_64, this does not change alignment of memory blocks and linpools
(both old and new is 16), but it increases alignment of slabs from 8 to
16.

5 months agoUpdate obsolete RFC 5575 to newer RFCs 8955 / 8956
Ondrej Zajicek [Tue, 4 Feb 2025 15:07:09 +0000 (16:07 +0100)] 
Update obsolete RFC 5575 to newer RFCs 8955 / 8956

6 months agoUpdate the obsoleted RFC 5575 by newer RFCs 8955 (ipv4) and 8956 (ipv6)
David Petera [Fri, 10 Jan 2025 12:22:47 +0000 (13:22 +0100)] 
Update the obsoleted RFC 5575 by newer RFCs 8955 (ipv4) and 8956 (ipv6)

6 months agoFix the flow6 label description and example
David Petera [Fri, 10 Jan 2025 12:16:34 +0000 (13:16 +0100)] 
Fix the flow6 label description and example

6 months agoFix error in example of direct protocol
David Petera [Thu, 30 Jan 2025 13:24:34 +0000 (14:24 +0100)] 
Fix error in example of direct protocol

6 months agoFix typo in docs
David Petera [Thu, 16 Jan 2025 10:15:26 +0000 (11:15 +0100)] 
Fix typo in docs

6 months agoBGP: fix shutdown crash when dynamic peer is just connected
Maria Matejka [Mon, 13 Jan 2025 21:15:52 +0000 (22:15 +0100)] 
BGP: fix shutdown crash when dynamic peer is just connected

In some edge cases, the dynamic BGP starts but doesn't yet pick up
the socket from the peer, when it gets shut down, typically on
a complete shutdown. Fixing this to just close the socket, not assert
it being already picked up.

6 months agoNEWS and version update v3.0.1
Maria Matejka [Thu, 9 Jan 2025 20:54:53 +0000 (21:54 +0100)] 
NEWS and version update

6 months agoMerge remote-tracking branch 'origin/stable-v2.16' into HEAD
Maria Matejka [Thu, 9 Jan 2025 20:54:15 +0000 (21:54 +0100)] 
Merge remote-tracking branch 'origin/stable-v2.16' into HEAD

6 months agoNEWS and version update v2.16.1
Maria Matejka [Thu, 9 Jan 2025 20:51:15 +0000 (21:51 +0100)] 
NEWS and version update

6 months agoMerge commit 'abecb5bb408f253cd24345ba94940ea0f7b59f4f' into HEAD
Maria Matejka [Thu, 9 Jan 2025 17:55:26 +0000 (18:55 +0100)] 
Merge commit 'abecb5bb408f253cd24345ba94940ea0f7b59f4f' into HEAD

6 months agoMerge commit '85aa283071ed75059fd8c889bc4ee33be1f901af' into HEAD
Maria Matejka [Thu, 9 Jan 2025 17:46:04 +0000 (18:46 +0100)] 
Merge commit '85aa283071ed75059fd8c889bc4ee33be1f901af' into HEAD

6 months agoMerge commit 'd221f39731be40ed3821f8db09d590edb849cb0c' into HEAD
Maria Matejka [Thu, 9 Jan 2025 17:45:50 +0000 (18:45 +0100)] 
Merge commit 'd221f39731be40ed3821f8db09d590edb849cb0c' into HEAD

6 months agoMerge commit 'e063365590b9b857a5bd0acfa519783eba639bbf' into stable-v3.0
Maria Matejka [Thu, 9 Jan 2025 17:30:33 +0000 (18:30 +0100)] 
Merge commit 'e063365590b9b857a5bd0acfa519783eba639bbf' into stable-v3.0

6 months agolib: Unify alignment of allocators
Ondrej Zajicek [Thu, 9 Jan 2025 15:44:51 +0000 (16:44 +0100)] 
lib: Unify alignment of allocators

Different internal allocators (memory blocks, linpools, and slabs) used
different way to compute alignment. Unify it to use alignment based on
standard max_align_t type.

On x86_64, this does not change alignment of memory blocks and linpools
(both old and new is 16), but it increases alignment of slabs from 8 to
16.

Minor changes by commiter.

6 months agoTable: Fixed table debug settings reconfiguration
Maria Matejka [Wed, 8 Jan 2025 19:59:03 +0000 (20:59 +0100)] 
Table: Fixed table debug settings reconfiguration

6 months agoTable: more best route refeed fixes
Maria Matejka [Wed, 8 Jan 2025 19:22:21 +0000 (20:22 +0100)] 
Table: more best route refeed fixes

Best route refeed is tricky. The journal may include repeatedly the same
route in the old and/or in the new position in case of flaps. We don't
like checking that fully in the RCU critical section which is already
way too long, thus we filter out the repeated occurence of the current
best route while keeping possibly more old routes.

We also don't want to send spurious withdraws, and we need to check that
only one notification per net is sent for RA_OPTIMAL.

There was also missing a rejected map update in case of idempotent
squashed update, and last but not least, the best route journal should
not include invalid routes (import keep filtered).

6 months agoTable: old best route refeed fix
Maria Matejka [Tue, 7 Jan 2025 11:13:57 +0000 (12:13 +0100)] 
Table: old best route refeed fix

When refeeding with RA_OPTIMAL, the old best routes weren't announced,
leading to weird behavior of protocols, mostly kernel. Fixed.

6 months agoBGP: fixed deterministic med crashes
Maria Matejka [Tue, 7 Jan 2025 10:08:04 +0000 (11:08 +0100)] 
BGP: fixed deterministic med crashes

There were several places of forgotten NULL checks.

Thanks to Alarig Le Lay <alarig@swordarmor.fr> for reporting:
https://trubka.network.cz/pipermail/bird-users/2024-December/017990.html

6 months agoBGP: fix display name of bgp_otc attribute
Maria Matejka [Fri, 27 Dec 2024 15:22:59 +0000 (16:22 +0100)] 
BGP: fix display name of bgp_otc attribute

6 months agoAllocate the normalization buckets on stack
Maria Matejka [Tue, 24 Dec 2024 15:16:55 +0000 (16:16 +0100)] 
Allocate the normalization buckets on stack

Even though allocating from tmp_linpool is quite cheap,
it isn't cheap when the block is larger than a page, which is the case here.
Instead, we now allocate just the result which typically fits in a page,
avoiding a necessity of a malloc().

6 months agoBGP: TX bucket storage moved to Stonehenge
Maria Matejka [Tue, 24 Dec 2024 12:22:56 +0000 (13:22 +0100)] 
BGP: TX bucket storage moved to Stonehenge

6 months agoRoute attribute storage moved to Stonehenge
Maria Matejka [Tue, 24 Dec 2024 12:12:58 +0000 (13:12 +0100)] 
Route attribute storage moved to Stonehenge

6 months agoStonehenge: multi-slab allocator
Maria Matejka [Tue, 24 Dec 2024 11:18:39 +0000 (12:18 +0100)] 
Stonehenge: multi-slab allocator

To mid-term allocate and free lots of small blocks in a fast pace,
mb_alloc is too slow and causes heap bloating. We can already allocate
blocks from slabs, and if we allow for a little bit of inefficiency,
we can just use multiple slabs with stepped sizes.

This technique is already used in ea_list allocation which is gonna be
converted to Stonehenge.

6 months agoGraceful recovery: converted to obstacles
Maria Matejka [Mon, 23 Dec 2024 20:06:26 +0000 (21:06 +0100)] 
Graceful recovery: converted to obstacles

Yet another refcounting mechanism had a locking collision.

6 months agoKernel: feed only once during startup
Maria Matejka [Mon, 23 Dec 2024 10:58:05 +0000 (11:58 +0100)] 
Kernel: feed only once during startup

There was an inefficiency in the initial scan state machine,
causing routes to be fed several times instead of just once.
Now the export startup is postponed until first krt_scan()
finishes and we actually can do the pruning with full information.

6 months agoCLI: Flushing tmp_linpool after every shown net.
Maria Matejka [Sun, 22 Dec 2024 21:26:44 +0000 (22:26 +0100)] 
CLI: Flushing tmp_linpool after every shown net.

There is no reason to keep the allocated objects through multiple nets.

6 months agoCLI: allocate TX buffers as pages, not by malloc
Maria Matejka [Sun, 22 Dec 2024 21:10:38 +0000 (22:10 +0100)] 
CLI: allocate TX buffers as pages, not by malloc

Every malloc risks heap bloating and these blocks are already
the same size as pages.

6 months agoDebian: Depend on libssh's default flavor pkg-v2
Jakub Ružička [Mon, 16 Dec 2024 13:33:26 +0000 (14:33 +0100)] 
Debian: Depend on libssh's default flavor

This mirrors Debian bird2 change, gcrypt flavor is deprecated.

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1074257

6 months agoDebian: Update Standards-Version to latest 4.7.0
Jakub Ružička [Mon, 16 Dec 2024 13:28:59 +0000 (14:28 +0100)] 
Debian: Update Standards-Version to latest 4.7.0

6 months agoDebian: Reformat with wrap-and-sort -bast
Jakub Ružička [Mon, 16 Dec 2024 13:28:12 +0000 (14:28 +0100)] 
Debian: Reformat with wrap-and-sort -bast

6 months agoDebian: Add BuildDepends: ca-certificates
Jakub Ružička [Wed, 4 Dec 2024 18:24:38 +0000 (19:24 +0100)] 
Debian: Add BuildDepends: ca-certificates

This should reportedly fix test issues on ARM.

6 months agoDebian: Add Rules-Requires-Root: no to d/control
Jakub Ružička [Tue, 10 Oct 2023 11:04:08 +0000 (13:04 +0200)] 
Debian: Add Rules-Requires-Root: no to d/control

6 months agoStatic: fixed ASPA reconfiguration mq-fix-static-aspa
Maria Matejka [Thu, 26 Dec 2024 10:34:02 +0000 (11:34 +0100)] 
Static: fixed ASPA reconfiguration

Due to an oversight, the provider lists weren't compared on reconfiguration.

Reported-By: Ralph Covelli <rcovelli@he.net>
6 months agoCI: Cleanup tests for single protocol builds
Ondrej Zajicek [Wed, 8 Jan 2025 23:49:19 +0000 (00:49 +0100)] 
CI: Cleanup tests for single protocol builds

BFD and MRT can be built independently, only BMP requires BGP.

6 months agoBMP: Cleanup keyword declarations
Ondrej Zajicek [Wed, 8 Jan 2025 23:46:37 +0000 (00:46 +0100)] 
BMP: Cleanup keyword declarations

6 months agoBFD: Fix missing keyword declarations
Ondrej Zajicek [Wed, 8 Jan 2025 23:30:37 +0000 (00:30 +0100)] 
BFD: Fix missing keyword declarations

Some keywords were missing for BFD-only build.