]> git.ipfire.org Git - thirdparty/bird.git/log
thirdparty/bird.git
3 years agoMerge commit '0e1e632f70b74cf111f08175ab3634db2f962579' into haugesund
Maria Matejka [Mon, 30 May 2022 13:43:45 +0000 (15:43 +0200)] 
Merge commit '0e1e632f70b74cf111f08175ab3634db2f962579' into haugesund

3 years agoMerge commit '0d0f6554a5c233bf2bf830ae319191c4b1808d49' into haugesund
Maria Matejka [Mon, 30 May 2022 13:43:13 +0000 (15:43 +0200)] 
Merge commit '0d0f6554a5c233bf2bf830ae319191c4b1808d49' into haugesund

3 years agoMerge commit '80272d4b64a38ee6f04a1c4e8566cac3a2293176' into haugesund
Maria Matejka [Mon, 30 May 2022 13:39:32 +0000 (15:39 +0200)] 
Merge commit '80272d4b64a38ee6f04a1c4e8566cac3a2293176' into haugesund

3 years agoMerge commit 'cd9550b24487ac7327b0234fd825f4214fdf7b16' into haugesund
Maria Matejka [Mon, 30 May 2022 13:38:24 +0000 (15:38 +0200)] 
Merge commit 'cd9550b24487ac7327b0234fd825f4214fdf7b16' into haugesund

3 years agoMerge commit '652be92a21f5575e5f74f6abe98eb4200b86776c' into haugesund
Maria Matejka [Mon, 30 May 2022 13:36:54 +0000 (15:36 +0200)] 
Merge commit '652be92a21f5575e5f74f6abe98eb4200b86776c' into haugesund

3 years agoMerge commit '98fd158e28d89f10ee7a41b4f6a14fbd0021ef35' into haugesund
Maria Matejka [Mon, 30 May 2022 13:35:29 +0000 (15:35 +0200)] 
Merge commit '98fd158e28d89f10ee7a41b4f6a14fbd0021ef35' into haugesund

3 years agoMerge commit 'd39ef961d1dde230c55fcc931b53f44cb34a1e63' into haugesund
Maria Matejka [Mon, 30 May 2022 13:32:11 +0000 (15:32 +0200)] 
Merge commit 'd39ef961d1dde230c55fcc931b53f44cb34a1e63' into haugesund

3 years agoMerge commit '4a23ede2b056a41456790cc20a0c3d92a7137693' into haugesund
Maria Matejka [Mon, 30 May 2022 13:31:19 +0000 (15:31 +0200)] 
Merge commit '4a23ede2b056a41456790cc20a0c3d92a7137693' into haugesund

3 years agoMerge commit 'ebd807c0b8eb0b7a3dc3371cd4c87ae886c00885' into haugesund
Maria Matejka [Mon, 30 May 2022 13:27:46 +0000 (15:27 +0200)] 
Merge commit 'ebd807c0b8eb0b7a3dc3371cd4c87ae886c00885' into haugesund

3 years agoMerge remote-tracking branch 'origin/master' into haugesund-to-2.0
Maria Matejka [Mon, 30 May 2022 13:20:21 +0000 (15:20 +0200)] 
Merge remote-tracking branch 'origin/master' into haugesund-to-2.0

3 years agoMerge commit '9eec503b251c3388579032b300d32640403d8612' into haugesund-to-2.0
Maria Matejka [Mon, 30 May 2022 13:20:05 +0000 (15:20 +0200)] 
Merge commit '9eec503b251c3388579032b300d32640403d8612' into haugesund-to-2.0

3 years agoMerge commit '692055e3df6cc9f0d428d3b0dd8cdd8e825eb6f4' into haugesund-to-2.0
Maria Matejka [Mon, 30 May 2022 13:17:52 +0000 (15:17 +0200)] 
Merge commit '692055e3df6cc9f0d428d3b0dd8cdd8e825eb6f4' into haugesund-to-2.0

3 years agoMerge commit '3a6eda995ecfcebff3130d86ee3baeab12a41335' into haugesund
Maria Matejka [Mon, 30 May 2022 13:15:19 +0000 (15:15 +0200)] 
Merge commit '3a6eda995ecfcebff3130d86ee3baeab12a41335' into haugesund

3 years agoCI: Remove broken FreeBSD builds
Ondrej Zajicek [Fri, 27 May 2022 14:07:24 +0000 (16:07 +0200)] 
CI: Remove broken FreeBSD builds

We currently do not have FreeBSD CI workers.

3 years agoBGP: Display neighbor port on show protocol
Ondrej Zajicek [Sat, 21 May 2022 14:21:34 +0000 (16:21 +0200)] 
BGP: Display neighbor port on show protocol

3 years agoRPKI: Display cache server port on show protocol
Ondrej Zajicek [Sat, 21 May 2022 14:03:08 +0000 (16:03 +0200)] 
RPKI: Display cache server port on show protocol

Thanks to Luiz Amaral for the idea.

3 years agoRPKI: Implement VRF support
Luiz Amaral [Thu, 19 May 2022 17:43:59 +0000 (19:43 +0200)] 
RPKI: Implement VRF support

3 years agoBGP: Improve tx performance during feed/flush
Ondrej Zajicek [Sun, 15 May 2022 13:05:13 +0000 (15:05 +0200)] 
BGP: Improve tx performance during feed/flush

The prefix hash table in BGP used the same hash function as the rtable.
When a batch of routes are exported during feed/flush to the BGP, they
all have similar hash values, so they are all crowded in a few slots in
the BGP prefix table (which is much smaller - around the size of the
batch - and uses higher bits from hash values), making it much slower due
to excessive collisions. Use a different hash function to avoid this.

Also, increase the batch size to fill 4k BGP packets and increase minimum
BGP bucket and prefix hash sizes to avoid back and forth resizing during
flushes.

This leads to order of magnitude faster flushes (on my test data).

3 years agoFIB is a data structure generic enough to be in lib
Maria Matejka [Thu, 31 Mar 2022 17:00:00 +0000 (19:00 +0200)] 
FIB is a data structure generic enough to be in lib

3 years agoUnified attribute and filter types
Maria Matejka [Sat, 26 Mar 2022 10:56:02 +0000 (11:56 +0100)] 
Unified attribute and filter types

This commit removes the EAF_TYPE_* namespace completely and also for
route attributes, filter-based types T_* are used. This simplifies
fetching and setting route attributes from filters.

Also, there is now union bval which serves as an universal value holder
instead of private unions held separately by eattr and filter code.

3 years agoOpaque types are named opaque also in filters
Maria Matejka [Sat, 26 Mar 2022 11:40:46 +0000 (12:40 +0100)] 
Opaque types are named opaque also in filters

3 years agoImplicit ROA check converted to explicit filter instruction sequence
Maria Matejka [Sat, 19 Mar 2022 15:38:32 +0000 (16:38 +0100)] 
Implicit ROA check converted to explicit filter instruction sequence

3 years agoFilters: removing adata_empty() duplicating lp_alloc_adata()
Maria Matejka [Sat, 26 Mar 2022 14:05:03 +0000 (15:05 +0100)] 
Filters: removing adata_empty() duplicating lp_alloc_adata()

3 years agoSpecial attribute types for enums
Maria Matejka [Sat, 26 Mar 2022 11:37:41 +0000 (12:37 +0100)] 
Special attribute types for enums

3 years agoDropping EAF_VAR_LENGTH as the attribute data is either embedded or adata
Maria Matejka [Thu, 14 Apr 2022 10:06:17 +0000 (12:06 +0200)] 
Dropping EAF_VAR_LENGTH as the attribute data is either embedded or adata

3 years agoFilter: Bitfield eattrs reading / writing moved to filter code
Maria Matejka [Fri, 25 Mar 2022 18:51:35 +0000 (19:51 +0100)] 
Filter: Bitfield eattrs reading / writing moved to filter code

Before this change, fetch-update-write and bitmasking was hardcoded in
attribute access code cased by the attribute type. Several filter
instructions are used to do it instead.

As this is certainly going to be a little bit slower than before, the
switch block in attribute access code should be completely removed in
near future, helping with both performance and code cleanliness.

The user interface should have stayed intact.

3 years agoFilter operations: bitwise AND and OR
Maria Matejka [Fri, 25 Mar 2022 18:15:11 +0000 (19:15 +0100)] 
Filter operations: bitwise AND and OR

3 years agoFixed spurious undef of route attributes
Alexander Zubkov [Wed, 4 May 2022 13:37:23 +0000 (15:37 +0200)] 
Fixed spurious undef of route attributes

3 years agoDoc: fix mating -> matching in flowspec section
Vincent Bernat [Fri, 22 Apr 2022 15:06:27 +0000 (17:06 +0200)] 
Doc: fix mating -> matching in flowspec section

3 years agoBabel: Fix compilation when LOCAL_DEBUG is set in packets.c
Toke Høiland-Jørgensen [Fri, 22 Apr 2022 15:04:56 +0000 (17:04 +0200)] 
Babel: Fix compilation when LOCAL_DEBUG is set in packets.c

The debug output was not updated with the rest of the code, so packets.c
fails to compile if LOCAL_DEBUG is set.

3 years agoBabel: Send out low-interval hello on shutdown
Toke Høiland-Jørgensen [Fri, 22 Apr 2022 14:41:52 +0000 (16:41 +0200)] 
Babel: Send out low-interval hello on shutdown

When shutting down a Babel instance we send a wildcard retraction to make
sure all peers can quickly switch to other route origins. Add another small
optimisation borrowed from babeld: sending a Hello message (along with the
retraction) with a very low interval.

This will cause neighbours to modify their expiry timers for the node's
state to quickly time it out, thus conserving resources in the network.

3 years agoRIP: fixed the EA_RIP_FROM attribute
Maria Matejka [Wed, 13 Apr 2022 15:05:12 +0000 (17:05 +0200)] 
RIP: fixed the EA_RIP_FROM attribute

The interface pointer was improperly converted to u32 and back. Fixing
this by explicitly allocating an adata structure for it. It's not so
memory efficient, we'll optimize this later.

3 years agoFixed a munmap abort bug
Maria Matejka [Wed, 13 Apr 2022 09:28:15 +0000 (11:28 +0200)] 
Fixed a munmap abort bug

When BIRD was munmapping too many pages, it sometimes aborted, saying
that munmap failed with "Not enough memory" as the address space was
getting more and more fragmented.

There is a workaround in place, simply keeping that page for future use,
yet it has never been compiled in because I somehow forgot to include
errno.h. And because I also thought that somebody may have ENOMEM not
defined (why?!), there was a check which quietly omitted that
workaround.

Anyway, ENOMEM is POSIX. It's an utter nonsense to check for its
existence. If it doesn't exist, something is broken.

3 years agoBFD: Add 'strict bind' option
Ondrej Zajicek (work) [Thu, 7 Apr 2022 17:33:40 +0000 (19:33 +0200)] 
BFD: Add 'strict bind' option

Add BFD protocol option 'strict bind' to use separate listening socket
for each BFD interface bound to its address instead of using shared
listening sockets.

3 years agoBGP uses lp_save / lp_restore instead of linpool flushing
Maria Matejka [Tue, 5 Apr 2022 13:09:56 +0000 (15:09 +0200)] 
BGP uses lp_save / lp_restore instead of linpool flushing

It is too cryptic to flush tmp_linpool in these cases and we don't want
anybody in the future to break this code by adding an allocation
somewhere which should persist over that flush.

Saving and restoring linpool state is safer.

3 years agoProtocols have their own explicit init routines
Maria Matejka [Fri, 18 Mar 2022 21:05:50 +0000 (22:05 +0100)] 
Protocols have their own explicit init routines

3 years agoSlab allocator can free the blocks without knowing the parent structure
Maria Matejka [Mon, 4 Apr 2022 18:31:14 +0000 (20:31 +0200)] 
Slab allocator can free the blocks without knowing the parent structure

3 years agoTyped lists for easier walking and stronger type checking
Maria Matejka [Mon, 4 Apr 2022 18:28:23 +0000 (20:28 +0200)] 
Typed lists for easier walking and stronger type checking

3 years agoAll linpools use pages to allocate regular blocks
Maria Matejka [Mon, 4 Apr 2022 20:34:14 +0000 (22:34 +0200)] 
All linpools use pages to allocate regular blocks

3 years agoUnsetting route attributes without messing with type system
Maria Matejka [Mon, 14 Mar 2022 10:13:48 +0000 (11:13 +0100)] 
Unsetting route attributes without messing with type system

3 years agoBGP: Fixed LLGR depreferencing in bgp_rte_mergable
Maria Matejka [Tue, 22 Mar 2022 13:39:32 +0000 (14:39 +0100)] 
BGP: Fixed LLGR depreferencing in bgp_rte_mergable

3 years agoEattr flags (originated and fresh) get their own struct fields
Maria Matejka [Mon, 14 Mar 2022 09:06:44 +0000 (10:06 +0100)] 
Eattr flags (originated and fresh) get their own struct fields

3 years agoMinor fix: f_val literals should always have named struct fields
Maria Matejka [Wed, 16 Mar 2022 09:22:49 +0000 (10:22 +0100)] 
Minor fix: f_val literals should always have named struct fields

3 years agoConverted Slab allocator to typed lists
Maria Matejka [Mon, 4 Apr 2022 18:31:25 +0000 (20:31 +0200)] 
Converted Slab allocator to typed lists

3 years agoNetlink: Remove superfluous sysdep/linux/netlink.c.orig
Ondrej Zajicek (work) [Wed, 16 Mar 2022 22:16:26 +0000 (23:16 +0100)] 
Netlink: Remove superfluous sysdep/linux/netlink.c.orig

Thanks to Vincent Bernat for notice.

3 years agoLib: Allow use of 240.0.0.0/4 as a private range
Ondrej Zajicek (work) [Wed, 16 Mar 2022 18:50:16 +0000 (19:50 +0100)] 
Lib: Allow use of 240.0.0.0/4 as a private range

There were several requests to allow use of 240.0.0.0/4 as a private
range, and Linux kernel already allows such routes, so perhaps we can
allow that too.

Thanks to Vincent Bernat and others for suggestion and patches.

3 years agoPrintf variant with a result allocated inside a pool / linpool
Maria Matejka [Tue, 15 Mar 2022 10:21:46 +0000 (11:21 +0100)] 
Printf variant with a result allocated inside a pool / linpool

3 years agoMerge branch 'haugesund-to-2.0' into HEAD
Maria Matejka [Mon, 14 Mar 2022 16:38:25 +0000 (17:38 +0100)] 
Merge branch 'haugesund-to-2.0' into HEAD

3 years agoSlab memory allocator unit test
Maria Matejka [Mon, 14 Mar 2022 16:29:39 +0000 (17:29 +0100)] 
Slab memory allocator unit test

3 years agoPkg: Improve RPM package unit file
Vincent Bernat [Fri, 11 Mar 2022 14:47:00 +0000 (15:47 +0100)] 
Pkg: Improve RPM package unit file

Update the RPM package unit file to check configuration before start and
to use "birdc configure" instead of "kill -HUP".

3 years agoClient: Use exit status to report errors
Ondrej Zajicek (work) [Fri, 11 Mar 2022 02:40:03 +0000 (03:40 +0100)] 
Client: Use exit status to report errors

When birdc is called with a command as an argument, it should set exit
status to non-zero when BIRD replied with an error reply code.

Thanks to Vincent Bernat and others for suggestion.

3 years agoMerge commit 'f81702b7' into haugesund
Maria Matejka [Wed, 9 Mar 2022 14:03:48 +0000 (15:03 +0100)] 
Merge commit 'f81702b7' into haugesund

3 years agoMerge commit '0767a0c2' into haugesund
Maria Matejka [Wed, 9 Mar 2022 13:39:55 +0000 (14:39 +0100)] 
Merge commit '0767a0c2' into haugesund

Conflicts:
nest/rt-table.c

3 years agoMerge commit '8f3942a9' into haugesund
Maria Matejka [Wed, 9 Mar 2022 13:09:34 +0000 (14:09 +0100)] 
Merge commit '8f3942a9' into haugesund

Conflicts:
nest/rt-table.c

3 years agoMerge commit '56c8f2f0' into haugesund
Maria Matejka [Wed, 9 Mar 2022 12:49:31 +0000 (13:49 +0100)] 
Merge commit '56c8f2f0' into haugesund

Conflicts:
nest/route.h
nest/rt-table.c

3 years agoMerge commit '575da88f' into haugesund
Maria Matejka [Wed, 9 Mar 2022 12:37:12 +0000 (13:37 +0100)] 
Merge commit '575da88f' into haugesund

Conflicts:
nest/rt-table.c

3 years agoFixed a static assert in page allocator
Maria Matejka [Wed, 9 Mar 2022 12:27:49 +0000 (13:27 +0100)] 
Fixed a static assert in page allocator

3 years agoFixed a static assert in page allocator
Maria Matejka [Wed, 9 Mar 2022 12:27:49 +0000 (13:27 +0100)] 
Fixed a static assert in page allocator

3 years agoMerge commit '1b9189d5' into haugesund
Maria Matejka [Wed, 9 Mar 2022 12:13:05 +0000 (13:13 +0100)] 
Merge commit '1b9189d5' into haugesund

3 years agoRoute validity check converted to generic macro dispatch
Maria Matejka [Wed, 9 Mar 2022 11:30:05 +0000 (12:30 +0100)] 
Route validity check converted to generic macro dispatch

3 years agoMerge remote-tracking branch 'origin/master' into haugesund
Maria Matejka [Wed, 9 Mar 2022 10:51:00 +0000 (11:51 +0100)] 
Merge remote-tracking branch 'origin/master' into haugesund

3 years agoMerge commit '60880b539b8886f76961125d89a265c6e1112b7a' into haugesund
Maria Matejka [Wed, 9 Mar 2022 10:28:34 +0000 (11:28 +0100)] 
Merge commit '60880b539b8886f76961125d89a265c6e1112b7a' into haugesund

3 years agoBGP Flowspec validation: Removed in-route optimization for multithreading compatibility
Maria Matejka [Fri, 11 Feb 2022 21:29:13 +0000 (22:29 +0100)] 
BGP Flowspec validation: Removed in-route optimization for multithreading compatibility

3 years agoMerge commit 'e42eedb9' into haugesund
Maria Matejka [Wed, 9 Mar 2022 10:01:44 +0000 (11:01 +0100)] 
Merge commit 'e42eedb9' into haugesund

3 years agoMerge commit '5cff1d5f' into haugesund
Maria Matejka [Wed, 9 Mar 2022 09:56:06 +0000 (10:56 +0100)] 
Merge commit '5cff1d5f' into haugesund

Conflicts:
      proto/bgp/attrs.c
      proto/pipe/pipe.c

3 years agoMerge commit 'd5a32563' into haugesund
Maria Matejka [Wed, 9 Mar 2022 09:50:38 +0000 (10:50 +0100)] 
Merge commit 'd5a32563' into haugesund

3 years agoFixed resource initialization in unit tests
Maria Matejka [Wed, 9 Mar 2022 09:30:03 +0000 (10:30 +0100)] 
Fixed resource initialization in unit tests

3 years agoLinpools with pages fixed to the final page allocator version
Maria Matejka [Wed, 9 Mar 2022 09:30:33 +0000 (10:30 +0100)] 
Linpools with pages fixed to the final page allocator version

3 years agoMerge commit '0c59f7ff' into haugesund
Maria Matejka [Wed, 9 Mar 2022 08:13:55 +0000 (09:13 +0100)] 
Merge commit '0c59f7ff' into haugesund

3 years agoRevert "Bound allocated pages to resource pools with page caches to avoid unnecessary...
Maria Matejka [Wed, 9 Mar 2022 08:13:31 +0000 (09:13 +0100)] 
Revert "Bound allocated pages to resource pools with page caches to avoid unnecessary syscalls"

This reverts commit 7f0e59820899c30a243c18556ce2e3fb72d6d221.

3 years agoRevert "fixup! Bound allocated pages to resource pools with page caches to avoid...
Maria Matejka [Wed, 9 Mar 2022 08:13:21 +0000 (09:13 +0100)] 
Revert "fixup! Bound allocated pages to resource pools with page caches to avoid unnecessary syscalls"

This reverts commit bea582cbb53e30dd32a5b6829c7443e0e5558d11.

3 years agoRevert "Multipage allocation"
Maria Matejka [Wed, 9 Mar 2022 08:13:20 +0000 (09:13 +0100)] 
Revert "Multipage allocation"

This reverts commit 6cd37713781a3092f8166b2178fae35cbfec1e28.

3 years agoRevert "fixup! Multipage allocation"
Maria Matejka [Wed, 9 Mar 2022 08:13:18 +0000 (09:13 +0100)] 
Revert "fixup! Multipage allocation"

This reverts commit a54f75f454b7ed8c8ff2c1787a506528f22cbae7.

3 years agoSingle-threaded version of sark-branch memory page management
Maria Matejka [Wed, 9 Mar 2022 08:10:44 +0000 (09:10 +0100)] 
Single-threaded version of sark-branch memory page management

3 years agoReplacing BGP temporary linpools by the common temporary linpool
Maria Matejka [Wed, 2 Mar 2022 10:22:32 +0000 (11:22 +0100)] 
Replacing BGP temporary linpools by the common temporary linpool

3 years agoReplaced custom linpools in tests for the common tmp_linpool
Maria Matejka [Wed, 2 Mar 2022 09:59:52 +0000 (10:59 +0100)] 
Replaced custom linpools in tests for the common tmp_linpool

3 years agoIntroducing an universal temporary linpool flushed after every task
Maria Matejka [Wed, 2 Mar 2022 09:35:21 +0000 (10:35 +0100)] 
Introducing an universal temporary linpool flushed after every task

3 years agoStatic list initializer
Maria Matejka [Wed, 2 Mar 2022 10:22:01 +0000 (11:22 +0100)] 
Static list initializer

3 years agoSmall improvement in directory test
Ondrej Filip [Wed, 2 Mar 2022 09:52:09 +0000 (10:52 +0100)] 
Small improvement in directory test

3 years agoMerge commit '2c13759136951ef0e70a3e3c2b2d3c9a387f7ed9' into haugesund
Maria Matejka [Wed, 2 Mar 2022 09:01:44 +0000 (10:01 +0100)] 
Merge commit '2c13759136951ef0e70a3e3c2b2d3c9a387f7ed9' into haugesund

3 years agoBabel: Fix bug in iface reconfiguration
Ondrej Zajicek (work) [Sun, 27 Feb 2022 02:10:38 +0000 (03:10 +0100)] 
Babel: Fix bug in iface reconfiguration

A recent change in Babel causes ifaces to disappear after
reconfiguration. The patch fixes that.

Thanks to Johannes Kimmel for an insightful bugreport.

3 years agoSmall change to fix doc building on Debian v2.0.9
Ondrej Filip [Sun, 20 Feb 2022 14:30:47 +0000 (15:30 +0100)] 
Small change to fix doc building on Debian

3 years agoSmall changes related to the new release
Ondrej Filip [Sun, 20 Feb 2022 13:28:06 +0000 (14:28 +0100)] 
Small changes related to the new release

3 years agoNEWS: Fix formatting and add some notes
Ondrej Zajicek (work) [Sun, 13 Feb 2022 15:45:49 +0000 (16:45 +0100)] 
NEWS: Fix formatting and add some notes

3 years agoNEWS and version update
Ondrej Zajicek (work) [Wed, 9 Feb 2022 02:47:49 +0000 (03:47 +0100)] 
NEWS and version update

3 years agoAlloc: Use posix_memalign() instead of aligned_alloc()
Ondrej Zajicek (work) [Tue, 8 Feb 2022 21:42:00 +0000 (22:42 +0100)] 
Alloc: Use posix_memalign() instead of aligned_alloc()

For compatibility with older systems use posix_memalign(). We can
switch to aligned_alloc() when we commit to C11 for multithreading.

3 years agoNetlink: Minor cleanup
Ondrej Zajicek (work) [Tue, 8 Feb 2022 21:21:08 +0000 (22:21 +0100)] 
Netlink: Minor cleanup

3 years agoLib: Update alignment of slabs
Ondrej Zajicek (work) [Mon, 7 Feb 2022 03:39:49 +0000 (04:39 +0100)] 
Lib: Update alignment of slabs

Alignment of slabs should be at least sizeof(ptr) to avoid unaligned
pointers in slab structures. Fixme: Use proper way to choose alignment
for internal allocators.

3 years agoMerge branch 'oz-trie-table'
Ondrej Zajicek (work) [Sun, 6 Feb 2022 22:32:15 +0000 (23:32 +0100)] 
Merge branch 'oz-trie-table'

3 years agoTrie: Fix trie format
Ondrej Zajicek (work) [Sun, 6 Feb 2022 21:53:55 +0000 (22:53 +0100)] 
Trie: Fix trie format

After switching to 16-way tries, trie format ignored unaligned / internal
prefixes and only reported the primary prefix of a trie node.

Fix trie format by showing internal prefixes based on the 'local' bitmask
of a node. Also do basic (intra-node) reconstruction of prefix patterns
by finding common subtrees in 'local' bitmask.

In future, we could improve that by doing inter-node reconstruction, so
prefixes entered as one pattern for a subtree (e.g. 192.168.0.0/18+)
would be reported as such, like with aligned prefixes.

3 years agoNest: Implement locking of prefix tries during walks
Ondrej Zajicek (work) [Fri, 4 Feb 2022 04:34:02 +0000 (05:34 +0100)] 
Nest: Implement locking of prefix tries during walks

The prune loop may may rebuild the prefix trie and therefore invalidate
walk state for asynchronous walks (used in 'show route in' cmd). Fix it
by adding locking that keeps the old trie in memory until current walks
are done.

In future this could be improved by rebuilding trie walk states (by
lookup for last found prefix) after the prefix trie rebuild.

3 years agoNest: Implement prefix trie pruning
Ondrej Zajicek (work) [Thu, 3 Feb 2022 05:08:51 +0000 (06:08 +0100)] 
Nest: Implement prefix trie pruning

When rtable is pruned and network fib nodes are removed, we also need to
prune prefix trie. Unfortunately, rebuilding prefix trie takes long time
(got about 400 ms for 1M networks), so must not be atomic, we have to
rebuild a new trie while current one is still active. That may require
some considerable amount of temporary memory, so we do that only if
we expect significant trie size reduction.

3 years agoTrie: Add prefix counter
Ondrej Zajicek (work) [Wed, 2 Feb 2022 04:06:49 +0000 (05:06 +0100)] 
Trie: Add prefix counter

Add counter of prefixes stored in trie. Works only for 'restricted' tries
composed of explicit prefixes (pxlen == l == h), like ones used in rtables.

3 years agoDoc: Describe routing table options
Ondrej Zajicek (work) [Fri, 31 Dec 2021 17:42:50 +0000 (18:42 +0100)] 
Doc: Describe routing table options

3 years agoBGP: Implement flowspec validation procedure
Ondrej Zajicek (work) [Mon, 20 Dec 2021 19:25:35 +0000 (20:25 +0100)] 
BGP: Implement flowspec validation procedure

Implement flowspec validation procedure as described in RFC 8955 sec. 6
and RFC 9117. The Validation procedure enforces that only routers in the
forwarding path for a network can originate flowspec rules for that
network.

The patch adds new mechanism for tracking inter-table dependencies, which
is necessary as the flowspec validation depends on IP routes, and flowspec
rules must be revalidated when best IP routes change.

The validation procedure is disabled by default and requires that
relevant IP table uses trie, as it uses interval queries for subnets.

3 years agoNest: Add routing table configuration blocks
Ondrej Zajicek (work) [Wed, 22 Dec 2021 03:32:26 +0000 (04:32 +0100)] 
Nest: Add routing table configuration blocks

Allow to specify sorted flag, trie fla, and min/max settle time.

Also do not enable trie by default, it must be explicitly enabled.

3 years agoNest: Add convenience functions to check rtable net type
Ondrej Zajicek (work) [Mon, 20 Dec 2021 19:44:36 +0000 (20:44 +0100)] 
Nest: Add convenience functions to check rtable net type

3 years agoNest: Avoid unnecessary net_format() in 'show route' command
Ondrej Zajicek (work) [Thu, 2 Dec 2021 03:05:17 +0000 (04:05 +0100)] 
Nest: Avoid unnecessary net_format() in 'show route' command

When output of 'show route' command was generated, the net_format() was
called for each network prematurely, even if the result was not needed.

Fix the code to call net_format() only when needed. This makes queries
that process many networks but show only few (e.g. 'show route where ..',
or 'show route count') much faster (like 5x - 10x faster).

3 years agoNest: Add trie iteration code to 'show route'
Ondrej Zajicek (work) [Thu, 2 Dec 2021 02:30:39 +0000 (03:30 +0100)] 
Nest: Add trie iteration code to 'show route'

Add trie iteration code to rt_show_cont() CLI hook and use it to
accelerate 'show route in <addr>' commands using interval queries.

3 years agoNest: Implement 'show route in <addr>' command
Ondrej Zajicek (work) [Thu, 2 Dec 2021 01:22:30 +0000 (02:22 +0100)] 
Nest: Implement 'show route in <addr>' command

Implement 'show route in <addr>' command, which shows all routes in
networks that are subnets of given network. Currently limited to IP
network types.