0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2025-01-23 09:21:53 +00:00
Commit Graph

1489 Commits

Author SHA1 Message Date
Maria Matejka
0c32f6218f CLI: fix channel stats display
The overall number of updates/withdrawals received, as well as
the number of routes limited, were not updated.
2025-01-13 21:51:14 +01:00
Maria Matejka
c94d7dae27 CLI: v2 compatibility mode for attribute name display
Also fixed display of bgp_otc (was just "otc" before).
2025-01-13 21:51:14 +01:00
Maria Matejka
d0a328bfa9 Merge commit 'd221f39731be40ed3821f8db09d590edb849cb0c' into HEAD 2025-01-09 18:45:50 +01:00
Maria Matejka
b2de140d1a Table: Fixed table debug settings reconfiguration 2025-01-09 10:35:00 +01:00
Maria Matejka
a24ec59d24 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).
2025-01-09 10:35:00 +01:00
Maria Matejka
9381f8f2d8 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.
2025-01-09 10:34:49 +01:00
Maria Matejka
d43538acbd 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
2025-01-09 10:08:27 +01:00
Maria Matejka
ffa57a4303 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().
2025-01-09 10:08:27 +01:00
Maria Matejka
240dd41f06 Route attribute storage moved to Stonehenge 2025-01-09 10:08:27 +01:00
Maria Matejka
5edac7403e Graceful recovery: converted to obstacles
Yet another refcounting mechanism had a locking collision.
2025-01-09 10:08:27 +01:00
Maria Matejka
91c98efe57 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.
2025-01-09 10:08:27 +01:00
Maria Matejka
56be89911a CLI: Flushing tmp_linpool after every shown net.
There is no reason to keep the allocated objects through multiple nets.
2025-01-09 10:08:27 +01:00
Maria Matejka
ccff887e50 CLI: allocate TX buffers as pages, not by malloc
Every malloc risks heap bloating and these blocks are already
the same size as pages.
2025-01-09 10:08:27 +01:00
Ondrej Zajicek
d221f39731 Nest: Fix handling of 64-bit rte_src.private_id
The commit 21213be523 expanded private_id
in route source to u64, but forgot to modify function arguments, so it
was still cropped at 32-bit, which may cause some collisions for L3VPN.
This patch fixes that.
2025-01-07 20:40:17 +01:00
Maria Matejka
8349536278 BFD: Fix session reconfiguration locking order
The sessions have to be updated asynchronously to avoid
cross-locking between protocols.

Testsuite: cf-ibgp-bfd-switch, cf-ibgp-multi-bfd-auth
Fixes: #139

Thanks to Daniel Suchy <danny@danysek.cz> for reporting:
https://trubka.network.cz/pipermail/bird-users/2024-December/017984.html
2024-12-21 19:12:54 +01:00
Maria Matejka
6779e5da69 BGP: fix locking order error on dynamic protocol spawn
We missed that the protocol spawner violates the prescribed
locking order. When the rtable level is locked, no new protocol can be
started, thus we need to:

* create the protocol from a clean mainloop context
* in protocol start hook, take the socket

Testsuite: cf-bgp-autopeer
Fixes: #136

Thanks to Job Snijders <job@fastly.com> for reporting:
https://trubka.network.cz/pipermail/bird-users/2024-December/017980.html
2024-12-20 11:40:10 +01:00
Maria Matejka
0a2f92ad20 Table: not feeding twice, once is enough
If there is no feed pending, the requested one should be
activated immediately, otherwise it is activated only after
the full run, effectively running first a full feed and
then the requested one.
2024-12-19 11:54:05 +01:00
Maria Matejka
b6caccfd45 Kernel: Fix crash for merge paths on if no route is in BIRD
There was a missing check for a NULL return value.
Also fixed an indenting error.

Thanks to Radu Anghel for reporting it:
https://bird.network.cz/pipermail/bird-users/2024-December/017977.html
2024-12-19 11:38:27 +01:00
Maria Matejka
c6b778794e Table exporter journal dumping and memsize
The show-memory command wasn't showing the consumed memory
properly because it ignored the journal size. Now it does.
2024-12-16 12:31:26 +01:00
Maria Matejka
d373d48377 Table cork compromise
The original values were way too low but what was set
later was too high and caused memory buildup upon startup.
2024-12-16 09:34:08 +01:00
Maria Matejka
d69d804679 Table prune inhibited during reconfiguration
When many changes are done during reconfiguration, the table may
start pruning old routes before everything is settled down, slowing
down not only the reconfiguration, but also the shutdown process.
2024-12-15 22:21:34 +01:00
Katerina Kubecova
ef63946d2e Allow allocating cold pages inside RCU critical section
We have quite large critical sections and we need to allocate inside
them. This is something to revise properly later on, yet for now,
instead of slowly but surely growing the virtual memory address space,
it's better to optimize the cold page cache pickup and count situations
where this happened inside the critical section.
2024-12-13 20:15:37 +01:00
Maria Matejka
af89c43413 Fixed a subtle memory leak in protocol restart routine 2024-12-13 19:10:55 +01:00
Maria Matejka
93621ed9f4 Merge commit '707cad61' into thread-next 2024-12-13 19:10:28 +01:00
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
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
73ace6acad Proto show: show creation and last autorestart time 2024-12-11 10:05:05 +01:00
Maria Matejka
fa0bda2278 Merge commit '145830bd' into thread-next 2024-12-10 23:55:42 +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
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
2ab3f22e4a CLI: show memory also displays cold pages
Minor changes by committer.
2024-12-03 04:07:53 +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
145830bdc8 CLI: adding cli_vprintf() 2024-12-02 04:27:30 +01:00
Maria Matejka
cd63810e4e Merge commit '997d2f57' into thread-merge-2.16 2024-11-29 11:43:49 +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
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
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
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
Maria Matejka
997d2f578e ASPA: Unified the ASPA_INVALID into one result
The _EMPTY and _CONFED variants are easy to spot bare-eyed from the AS path.
2024-11-26 20:33:28 +01:00
Katerina Kubecova
99fa1f01a4 rt-show.c: fixed OBSREF_SET after cf_error(), changed message when 'show route export' called on static protocol 2024-11-25 17:06:24 +01:00
Maria Matejka
3f4332f0bd Protocol restart timer reworked.
The restart timer was racy and didn't allow for immediate restarts
from limits. Now the protocols stores the last restart time and in case
of too frequent autorestarts caused by exceeded limits, the protocol
gets disabled with an error message.

Also now there is a configuration knob for this.
2024-11-25 17:06:24 +01:00