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

5255 Commits

Author SHA1 Message Date
Katerina Kubecova
b84460432a lockfree.c: Solution for lfjour_cleanup_hook() too often scheduling. This function was scheduled each time any of the journal recipients
reached end of a block of journal items or read all of journal items. lfjour_cleanup_hook() can clean only journal items every recipient has processed,
so it was often called uselessly.

This commit restricts most of the unusefull scheduling. Only some consumers are given a token alowing them to try to schedule the lfjour_cleanup_hook().
When a consumer wants to schedule the lfjour_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 consumer is allowed do schedule the lfjour_cleanup_hook().

There is a maximum number of tokens a journal can give to its customers (max_tokens). A new customer is given a token in its init, if the maximum number of tokens was not reached.
The rest of tokens is given to customers in lfjour_cleanup_hook(). In lf_jour_cleanup_hook(), it is increased the issued_tokens number in order not to call 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. 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 first
unfinished customer we find or we call the hook again.
2024-12-10 16:32:38 +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
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
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
Maria Matejka
145fcd3180 Merge commit 'c7e843c1' into thread-merge-2.16 2024-11-29 10:28:19 +01:00
Maria Matejka
2e1ff4b230 Merge commit '294d363d' into thread-merge-2.16 2024-11-29 10:26:52 +01:00
Maria Matejka
14bc1fc4c1 Merge commit '1002c35b' into thread-merge-2.16 2024-11-29 10:25:59 +01:00
Maria Matejka
baf963973d Merge commit '80ca0ed2' into thread-merge-2.16
Fixed a nasty merge conflict with bgp_origin serving double duty
as both an attribute and enum name.
2024-11-29 10:20:08 +01:00
Maria Matejka
3ca6e03db7 RPKI: refactored pdu to host byte order conversion
We shouldn't convert bytes 2 and 3 of the PDU blindly, there are several
cases where these are used by bytes. Instead, the conversion is done
only where needed.

This fixes misinterpretation bug of ASPA PDU flags on little endian
architectures.
2024-11-28 14:19:47 +01:00
Maria Matejka
e0b1826b7c Merge commit '072821e5' into thread-merge-2.16 2024-11-28 12:44:04 +01:00
Maria Matejka
2b1e4b0724 Merge commit 'a70ecade' into thread-merge-2.16 2024-11-28 12:43:52 +01:00
Maria Matejka
52a11170fe Merge commit '39e75b87' into thread-merge-2.16 2024-11-28 12:43:43 +01:00
Maria Matejka
ce199382ea Merge commit '163ab313' into thread-merge-2.16 2024-11-28 12:23:27 +01:00
Maria Matejka
c0dfd4dc3b Merge commit '8dc2a36a' into thread-merge-2.16 2024-11-28 12:23:14 +01:00
Maria Matejka
44efc912d5 Merge commit '5daec239' into thread-merge-2.16 2024-11-28 12:19:27 +01:00
Maria Matejka
b4bd406795 Merge commit 'acbdc29d' into thread-merge-2.16 2024-11-28 12:18:44 +01:00
Maria Matejka
ac30445f4f Merge commit 'c9836207' into thread-merge-2.16 2024-11-28 12:08:52 +01:00
Maria Matejka
3bbe0ec251 Merge commit 'df22b314' into thread-merge-2.16 2024-11-28 12:08:43 +01:00
Maria Matejka
eba3a26537 Merge commit '08ff0af8' into thread-merge-2.16 2024-11-28 12:07:30 +01:00
Maria Matejka
281e41026e Merge commit 'f3b6661d' into thread-merge-2.16 2024-11-28 12:00:45 +01:00
Maria Matejka
1ce352ebf5 Merge commit 'a95fff37' into thread-merge-2.16 2024-11-28 10:57:37 +01:00
Maria Matejka
ac0cdf3ad4 Merge commit '09f50f37' into thread-merge-2.16 2024-11-28 10:02:07 +01:00
Maria Matejka
e6242ef948 Merge commit '8a40bccf' into thread-merge-2.16 2024-11-28 09:36:33 +01:00
Maria Matejka
cbd986cd35 Merge commit '00b139bd' into thread-merge-2.16 2024-11-28 09:28:34 +01:00
Maria Matejka
029e6c7e1e Merge commit 'a5b4c21d' into thread-merge-2.16 2024-11-28 09:08:32 +01:00
Maria Matejka
2af438a9bf Merge commit '2d6fb31c' into thread-merge-2.16 2024-11-28 09:07:23 +01:00
Maria Matejka
ce2ecbdcb6 Merge commit 'e29f134a' into thread-merge-2.16 2024-11-28 09:04:31 +01:00
Maria Matejka
402d07bccd Merge commit '280daed5' into thread-merge-2.16 2024-11-28 09:02:59 +01:00
Maria Matejka
b8f7200ee9 Merge commit 'bc10975a' into thread-merge-2.16 2024-11-28 08:56:27 +01:00
Maria Matejka
d73d861f0c Merge commit '08571b20' into thread-merge-2.16 2024-11-28 08:22:06 +01:00