summaryrefslogtreecommitdiff
path: root/sysdep
AgeCommit message (Collapse)Author
2022-02-07NEWS and version updateMaria Matejka
2022-02-04Tamed harmless i368 warningsMaria Matejka
2022-02-04Merge commit 'a9646efd40569f3a1d749bc1bd13219876b33a00' into sark-bgp-rebasedMaria Matejka
2022-02-04Merge commit 'bcb25084d31fdb90fcf1666f10e73fe0f863afc0' into sark-bgp-rebasedMaria Matejka
2022-02-04Merge commit '75aceadaf746f8ed0acce0424f89903283dacf16' into sark-bgp-rebasedMaria Matejka
2022-02-03IO loop duration fixupMaria Matejka
2022-02-03Socket cork fixesMaria Matejka
2022-02-03Asynchronous neighbor notifications fixesMaria Matejka
2022-02-03Explicitly storing and checking loop information in socketsMaria Matejka
2022-02-03Neighbors: Locking and asynchronous notificationsMaria Matejka
2022-02-03Global interface list renamed to not clash with local listsMaria Matejka
2022-02-03Page cleanup routines updated to allow nested birdloopsMaria Matejka
2022-02-03Removing periodic wakeup of mainloop in debug version to search for ↵Maria Matejka
notification issues
2022-01-17Netlink: Add option to specify netlink socket receive buffer sizeOndrej Zajicek (work)
Add option 'netlink rx buffer' to specify netlink socket receive buffer size. Uses SO_RCVBUFFORCE, so it can override rmem_max limit. Thanks to Trisha Biswas and Michal for the original patches.
2022-01-15Netlink: Add another workaround for older kernel headersOndrej Zajicek (work)
Unfortunately, SOL_NETLINK is both recently added and arch-dependent, so we cannot just define it.
2022-01-14Netlink: Add workaround for older kernel headersOndrej Zajicek (work)
2022-01-14Netlink: Enable strict checking for KRT dumpsOndrej Zajicek (work)
Add strict checking for netlink KRT dumps to avoid PMTU cache records from FNHE table dump along with KRT. Linux Kernel added FNHE table dump to the netlink API in patch: https://patchwork.ozlabs.org/project/netdev/patch/8d3b68cd37fb5fddc470904cdd6793fcf480c6c1.1561131177.git.sbrivio@redhat.com/ Therefore, since Linux 5.3 these route cache entries are dumped together with regular routes during periodic KRT scans, which in some cases may be huge amount of useless data. This can be avoided by using strict checking for netlink dumps: https://lore.kernel.org/netdev/20181008031644.15989-1-dsahern@kernel.org/ The patch mitigates the risk of receiving unknown and potentially large number of FNHE records that would block BIRD I/O in each sync. There is a known issue caused by the GRE tunnels on Linux that seems to be creating one FNHE record for each destination IP address that is routed through the tunnel, even when the PMTU equals to GRE interface MTU. Thanks to Tomas Hlavacek for the original patch.
2022-01-14Netlink: Explicitly skip received cloned routesOndrej Zajicek (work)
Kernel uses cloned routes to keep route cache entries, but reports them together with regular routes. They were skipped implicitly as they do not have rtm_protocol filled. Add explicit check for cloned flag and skip such routes explicitly. Also, improve debug logs of skipped routes.
2022-01-08IO: Support nonlocal bind in socket interfaceAlexander Zubkov
Add option to socket interface for nonlocal binding, i.e. binding to an IP address that is not present on interfaces. This behaviour is enabled when SKF_FREEBIND socket flag is set. For Linux systems, it is implemented by IP_FREEBIND socket flag. Minor changes done by commiter.
2022-01-05Netlink: Do not ignore dead routes from BIRDOndrej Zajicek (work)
Currently, BIRD ignores dead routes to consider them absent. But it also ignores its own routes and thus it can not correctly manage such routes in some cases. This patch makes an exception for routes with proto bird when ignoring dead routes, so they can be properly updated or removed. Thanks to Alexander Zubkov for the original patch.
2022-01-05Netlink: Improve multipath parsing errorsOndrej Zajicek (work)
Function nl_parse_multipath() should handle errors internally.
2021-12-27BSD: Assume onlink flag on ifaces with only host addressesOndrej Zajicek (work)
The BSD kernel does not support the onlink flag and BIRD does not use direct routes for next hop validation, instead depends on interface address ranges. We would like to handle PtMP cases with only host addresses configured, like: ifconfig wg0 192.168.0.10/32 route add 192.168.0.4 -iface wg0 route add 192.168.0.8 -iface wg0 To accept BIRD routes with onlink next-hop, like: route 192.168.42.0/24 via 192.168.0.4%wg0 onlink BIRD would dismiss the route when receiving from the kernel, as the next-hop 192.168.0.4 is not part of any interface subnet and onlink flag is not kept by the BSD kernel. The commit fixes this by assuming that for routes received from the kernel, any next-hop is onlink on ifaces with only host addresses. Thanks to Stefan Haller for the original patch.
2021-12-07Fixed build errors for OpenBSDMaria Jan Matejka
2021-12-07Fixed standby memory page counters on shutdownMaria Matejka
Bug introduced by commit 38278d94ba0a179d5eeb061a59850a4e1c150e5b.
2021-12-07Main IO loop shouldn't skip sockets when ping is receivedMaria Matejka
2021-12-02Standby memory pages are accounted for as overhead in show memory commandMaria Matejka
2021-12-01No memory unmapping when shutting downMaria Matejka
All the memory is just freed implicitly on exit, no need for page-by-page unmapping.
2021-12-01Faster shutdown and cleanups by freeing route attributes strictly from main loopMaria Matejka
2021-12-01Merge branch 'master' into HEADMaria Matejka
2021-12-01Fix of shutdown: premature log cleanup led to use-after-freeMaria Matejka
2021-12-01Page allocator moved from pools to IO loops.Maria Matejka
The resource pool system is highly hierarchical and keeping spare pages in pools leads to unnecessarily complex memory management. Loops have a flat hiearchy, at least for now, and it is therefore much easier to keep care of pages, especially in cases of excessive virtual memory fragmentation.
2021-11-30For safer memory allocations, resources are bound to loops.Maria Matejka
Also all loops have their basic resource pool for allocations which are auto-freed when the loop is stopping.
2021-11-24Directly mapped pages are kept for future use if temporarily not neededMaria Matejka
2021-11-23Stored pages release routineMaria Matejka
2021-11-22Introducing basic RCU primitives for lock-less shared data structuresMaria Matejka
2021-11-22Keeping un-unmmappable pages until they can be reusedMaria Matejka
On Linux, munmap() may fail with ENOMEM when virtual memory is too fragmented. Working this around by just keeping such blocks for future use.
2021-11-22Routing tables now have their own loops.Maria Matejka
This basically means that: * there are some more levels of indirection and asynchronicity, mostly in cleanup procedures, requiring correct lock ordering * all the internal table operations (prune, next hop update) are done without blocking the other parts of BIRD * the protocols may get their own loops very soon
2021-11-22Route sources have an explicit ownerMaria Matejka
This commit prevents use-after-free of routes belonging to protocols which have been already destroyed, delaying also all the protocols' shutdown until all of their routes have been finally propagated through all the pipes down to the appropriate exports. The use-after-free was somehow hypothetic yet theoretically possible in rare conditions, when one BGP protocol authors a lot of routes and the user deletes that protocol by reconfiguring in the same time as next hop update is requested, causing rte_better() to be called on a not-yet-pruned network prefix while the owner protocol has been already freed. In parallel execution environments, this would happen an inter-thread use-after-free, causing possible heisenbugs or other nasty problems.
2021-11-22Adding a generic cork mechanism for eventsMaria Matejka
2021-11-22Converting the former BFD loop to a universal IO loop and protocol loop.Maria Matejka
There is a simple universal IO loop, taking care of events, timers and sockets. Primarily, one instance of a protocol should use exactly one IO loop to do all its work, as is now done in BFD. Contrary to previous versions, the loop is now launched and cleaned by the nest/proto.c code, allowing for a protocol to just request its own loop by setting the loop's lock order in config higher than the_bird. It is not supported nor checked if any protocol changed the requested lock order in reconfigure. No protocol should do it at all.
2021-11-22Moved BFD IO loop out of BFD as we want to use it as socket-io coroutineMaria Matejka
2021-11-22Unified time for whole BIRDMaria Matejka
In previous versions, every thread used its own time structures, effectively leading to different time in every thread and strange logging messages. The time processing code now uses global atomic variables to keep current time available for fast concurrent reading and safe updates.
2021-11-22Debug messages with timestamps.Maria Matejka
On most of current hardware, getting monotonic clock is fast enough to get it and write for each debug message.
2021-11-22Lock position checking allows for safe lock unionsMaria Matejka
2021-11-22Coroutines: A simple and lightweight parallel execution framework.Maria Matejka
2021-11-22Locking subsystem: Just a global BIRD lock to begin with.Maria Matejka
2021-11-22POSIX threads and thread-local storage is needed for concurrent executionMaria Matejka
2021-11-22Special table hooks rectified.Maria Matejka
* internal tables are now more standalone, having their own import and export hooks * route refresh/reload uses stale counter instead of stale flag, allowing to drop walking the table at the beginning * route modify (by BGP LLGR) is now done by a special refeed hook, reimporting the modified routes directly without filters
2021-11-22Table import and export are now explicit hooks.Maria Matejka
Channels have now included rt_import_req and rt_export_req to hook into the table instead of just one list node. This will (in future) allow for: * channel import and export bound to different tables * more efficient pipe code (dropping most of the channel code) * conversion of 'show route' to a special kind of export * temporary static routes from CLI The import / export states are also updated to the new algorithms.
2021-11-09Kernel routes are flushed on shutdown by kernel scan, not by table scanMaria Matejka