0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-12-22 09:41:54 +00:00
Commit Graph

5281 Commits

Author SHA1 Message Date
Maria Matejka
731593685b Merge commit 'd85fa48e' into thread-next
The resource dumping routines needed to be updated in v3 to use the new
API introduced in v2.

Conflicts:
	filter/f-util.c
	filter/filter.c
	lib/birdlib.h
	lib/event.c
	lib/mempool.c
	lib/resource.c
	lib/resource.h
	lib/slab.c
	lib/timer.c
	nest/config.Y
	nest/iface.c
	nest/iface.h
	nest/locks.c
	nest/neighbor.c
	nest/proto.c
	nest/route.h
	nest/rt-attr.c
	nest/rt-table.c
	proto/bfd/bfd.c
	proto/bmp/bmp.c
	sysdep/unix/io.c
	sysdep/unix/krt.c
	sysdep/unix/main.c
	sysdep/unix/unix.h
2024-12-13 15:58:10 +01:00
Maria Matejka
a9c1966f08 Merge remote-tracking branch 'origin/apkg-v3' into thread-next 2024-12-12 21:07:53 +01:00
Katerina Kubecova
4af3ee1f2f EAttr normalization rewritten to use bucket sort
The EAttr ID space is dense so we can just walk once, sweep the whole
input and go home.

There is a little bit of memory inefficiency in allocating always the
largest possible block, yet it isn't too bad.

There are also unit tests for this.
2024-12-12 21:02:34 +01:00
Maria Matejka
6e940c259d CLI: show threads all crash fixed
When socket dropped before finished, it failed to cleanup.
2024-12-12 15:00:26 +01:00
Maria Matejka
28b0adc15f Fix alignment requirements to include atomic u64.
Not having this led to bus errors on unaligned atomic u64 access
on architectures with 4B pointers.
2024-12-11 17:51:46 +01:00
Maria Matejka
73ace6acad Proto show: show creation and last autorestart time 2024-12-11 10:05:05 +01:00
Maria Matejka
fa5923289e Merge commit '4dd5b3d9' into thread-next 2024-12-10 23:57:59 +01:00
Maria Matejka
fa0bda2278 Merge commit '145830bd' into thread-next 2024-12-10 23:55:42 +01:00
Maria Matejka
1f8eb20710 Merge commit '946386f2' into thread-next 2024-12-10 23:55:05 +01:00
Maria Matejka
1fc569e32b Merge commit '7ee27418' into thread-next 2024-12-10 23:50:13 +01:00
Maria Matejka
cc0c8ce992 BMP: Fixing corner cases
Protocol state propagation collision, shutdown collision.
2024-12-10 23:41:48 +01:00
Maria Matejka
cde582977f BMP: Never touching the BGP directly
Dropped hopefully last remnants of BMP directly accessing BGP structures.
2024-12-10 23:41:48 +01:00
Maria Matejka
dc692ae06a Nest: proto/channel state table naming convention cleanup 2024-12-10 23:41:48 +01:00
Katerina Kubecova
d503204aa0 Lockfree journal: Cleanup hook runs only when needed.
The function lfjour_cleanup_hook() was scheduled each time any of the
journal recipients reached end of a block of journal items or read all
of journal items. Because lfjour_cleanup_hook() can clean only journal
items every recipient has processed, it was often called uselessly.

This commit restricts most of the unuseful scheduling. Only some
recipients are given a token alowing them to try to schedule the
cleanup hook. When a recipient wants to schedule the cleanup hook, it
checks whether it has a token. If yes, it decrements number of tokens
the journal has given (issued_tokens) and discards its own token. If
issued_tokens reaches zero, the recipient is allowed to schedule the
cleanup hook.

There is a maximum number of tokens a journal can give to its recipients
(max_tokens). A new recipient is given a token in its init, unless the
maximum number of tokens is reached. The rest of tokens is given to
customers in lfjour_cleanup_hook().

In the cleanup hook, the issued_tokens number is increased in order to
avoid calling the hook before it finishes. Then, tokens are given to the
slowest recipients (but never to more than max_token recipients). Before
leaving lfjour_cleanup_hook(), the issued_tokens number is decreased back.
If no other tokens are given, we have to make sure the
lfjour_cleanup_hook will be called again. If every item in journal was
read by every recipient, tokens are given to random recipients. If all
recipients with tokens managed to finish until now, we give the token to
the first unfinished customer we find, or we just call the hook again.
2024-12-10 23:37:20 +01:00
Maria Matejka
bc15f0b9c7 Nest: fixed a race-condition between import and export
There was a leaking stack pointer to the global memory.
Fixed by making that temporary structure thread local static.
2024-12-10 10:59:30 +01:00
Jakub Ružička
eaadf3af3a Fix typos found by lintian
I: bird3: spelling-error-in-binary "an other" "another" [usr/sbin/bird]
I: bird3: spelling-error-in-binary Reseting Resetting [usr/sbin/bird]
I: bird3: spelling-error-in-binary authenication authentication [usr/sbin/bird]

I was unable to fix the following:

I: bird3: spelling-error-in-binary upto up to [usr/sbin/bird]
2024-12-06 16:09:31 +01:00
Jakub Ružička
0f0a8d5027 Debian: Remove unneeded Pre-Depends: init-system-helpers
Lintian proclaims this is an essential package.
2024-12-06 16:09:31 +01:00
Jakub Ružička
2eba82fcda Debian: Add upstream lintian-overrides 2024-12-06 16:09:31 +01:00
Jakub Ružička
5e3fcd60f3 Debian: Add BuildDepends: ca-certificates
This should reportedly fix test issues on ARM.
2024-12-06 16:09:31 +01:00
Jakub Ružička
ce51b84df3 Debian: Add Rules-Requires-Root: no to d/control 2024-12-06 16:06:44 +01:00
Jakub Ružička
c7b6d8b436 Debian: Rename package to bird3
Also reformat using

    wrap-and-sort -bast
2024-12-06 16:05:00 +01:00
Maria Matejka
77a4b21365 BMP: Dropped remnants of unused channels 2024-12-05 15:10:15 +01:00
Maria Matejka
f1a04ce190 BMP: refactored lists and table locks to tlists 2024-12-05 14:59:54 +01:00
Maria Matejka
d5f01efbe6 BMP: protocol state ingestion refactoring 2024-12-05 12:12:34 +01:00
Maria Matejka
2128c648e0 BMP: Tamed a TX buffer warning 2024-12-04 10:16:42 +01:00
Ondrej Zajicek
63221eba2e Merge commit 'a47704a53db4f088e52e43f8b24785e5777ce147' into thread-next 2024-12-03 19:40:21 +01:00
Ondrej Zajicek
723a0fe424 Merge commit '73e7d3f5cede2e72eb9e77d61424a8c443672c09' into thread-next 2024-12-03 19:00:05 +01:00
Ondrej Zajicek
abc43c097a Merge commit '5205ff97448cc34cf7334e90172c28eb48f227f2' into thread-next 2024-12-03 18:48:20 +01:00
Ondrej Zajicek
7cbcb7b230 Merge commit 'e6a100b31a7637ee739338e4b933367707ec931f' into thread-next 2024-12-03 18:22:14 +01:00
Ondrej Zajicek
6aea356b2a Merge commit '460321cfe979459e3b78ba87694f29865d321612' into thread-next 2024-12-03 15:45:25 +01:00
Maria Matejka
d85fa48e3a Slab: Write out all block pointers when asked for dump 2024-12-02 06:54:54 +01:00
Maria Matejka
ceab028326 Linpool: Write out all block pointers when asked for dump 2024-12-02 06:54:54 +01:00
Maria Matejka
da8a23277e CLI: Dumping internal data structures to files, not to debug output
All the 'dump something' CLI commands now have a new mandatory
argument -- name of the file where to dump the data. This allows
for more flexible dumping even for production deployments where
the debug output is by default off.

Also the dump commands are now restricted (they weren't before)
to assure that only the appropriate users can run these time consuming
commands.
2024-12-02 06:54:54 +01:00
Maria Matejka
4dd5b3d90e Logging: exposing vlog() to log va_lists 2024-12-02 04:27:30 +01:00
Maria Matejka
145830bdc8 CLI: adding cli_vprintf() 2024-12-02 04:27:30 +01:00
Maria Matejka
946386f2dd MRT: instead of crashing, ignore non-BGP attributes 2024-12-02 04:27:30 +01:00
Maria Matejka
7ee27418a7 Printf: impossible buffer overflow fix
When printing near the end of the buffer, there was an overflow in two cases:

(1) %c and size is zero
(2) %1N, %1I, %1I4, %1I6 (auto-fill field_width for Net or IP), size is
    more than actual length of the net/ip but less than the auto-filled
    field width.

Manual code examination showed that nothing could have ever triggered
this behavior. All older versions of BIRD, including BIRD 3 development
versions, are totally safe. This exact overflow has been found while
implementing a new feature in later commits.
2024-12-02 04:27:30 +01:00
Ondrej Zajicek
a47704a53d BMP: Refactor route monitor message serialization
Instead of several levels of functions, just have two functions
(one for routes, the other for end-of-rib), this allows to create
messages in a simple linear fashion.

Also reduce three duplicite functions to construct BGP header for
BMP messages to just one.
2024-12-02 03:38:17 +01:00
Ondrej Zajicek
73e7d3f5ce BMP: Refactor computation of message length
Fill message length after the message is created instead of computing
it beforehand. Also rename some functions to fit common pattern.
2024-12-02 03:38:17 +01:00
Ondrej Zajicek
5205ff9744 BMP: Refactor per-peer header arguments
Put all arguments for per-peer header into one structure instead of
passing them around as a lump of arguments. Also simplify code for
peer flags.
2024-12-02 03:38:17 +01:00
Maria Matejka
e6a100b31a BMP: simplified update queuing and better memory performance
This commit is quite a substantial rework of the underlying layers in
BMP TX:

- several unnecessary layers of indirection dropped, including most of
  the original BMP's buffer machinery
- all messages are now written directly into one protocol's buffer
  allocated for the whole time big enough to fit every possible message
- output blocks are allocated by pages and immediately returned when
  used, improving the overall memory footprint
- no intermediary allocation is done from the heap altogether
- there is a documented and configurable limit on the TX queue size
2024-12-02 03:38:17 +01:00
Maria Matejka
460321cfe9 Formatting numbers with order prefixes
Unit tests by Ondrej Zajicek.
2024-11-29 16:06:07 +01:00
Maria Matejka
c48a7ac0cc BMP: drop an unused mempool 2024-11-29 16:06:07 +01:00
Maria Matejka
bda81c62bf Merge commit '3ca6e03d' into thread-merge-2.16 2024-11-29 12:07:10 +01:00
Maria Matejka
ffba45657e Merge commit 'fc2b4b26' into thread-merge-2.16
Actually, completely rewritten the original patch as in v3, the logging
initialization is much more complex and requires allocation.

This way, to bootstrap properly, the logger has a pre-defined log target
to stderr.
2024-11-29 12:05:40 +01:00
Maria Matejka
cd63810e4e Merge commit '997d2f57' into thread-merge-2.16 2024-11-29 11:43:49 +01:00
Maria Matejka
2936e15b28 Merge commit '49be4a03' into thread-merge-2.16 2024-11-29 11:30:59 +01:00
Maria Matejka
caa5e7907a Conf: build fix for older bisons
Typed blocks are probably a too new extension to rely on.
2024-11-29 11:27:30 +01:00
Maria Matejka
1b0ffdf80e Merge commit '82d57fb7' into thread-merge-2.16 2024-11-29 11:26:18 +01:00
Maria Matejka
c1ad3e58c0 Merge commit '38195ac6' into thread-merge-2.16 2024-11-29 10:49:53 +01:00