From 534d0a4b44aa193da785ae180475a448f57805e2 Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Sun, 24 Jul 2022 02:15:20 +0200 Subject: KRT: Scan routing tables separetely on linux to avoid congestion MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove compile-time sysdep option CONFIG_ALL_TABLES_AT_ONCE, replace it with runtime ability to run either separate table scans or shared scan. On Linux, use separate table scans by default when the netlink socket option NETLINK_GET_STRICT_CHK is available, but retreat to shared scan when it fails. Running separate table scans has advantages where some routing tables are managed independently, e.g. when multiple routing daemons are running on the same machine, as kernel routing table modification performance is significantly reduced when the table is modified while it is being scanned. Thanks Daniel Gröber for the original patch and Toke Høiland-Jørgensen for suggestions. --- sysdep/unix/krt.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'sysdep/unix/krt.h') diff --git a/sysdep/unix/krt.h b/sysdep/unix/krt.h index 62228f08..1536e502 100644 --- a/sysdep/unix/krt.h +++ b/sysdep/unix/krt.h @@ -52,10 +52,7 @@ struct krt_proto { struct rtable *krt_table; /* Internal table of inherited routes */ #endif -#ifndef CONFIG_ALL_TABLES_AT_ONCE timer *scan_timer; -#endif - struct bmap sync_map; /* Keeps track which exported routes were successfully written to kernel */ struct bmap seen_map; /* Routes seen during last periodic scan */ node krt_node; /* Node in krt_proto_list */ @@ -76,6 +73,7 @@ extern pool *krt_pool; struct proto_config * kif_init_config(int class); void kif_request_scan(void); +void krt_use_shared_scan(void); void krt_got_route(struct krt_proto *p, struct rte *e); void krt_got_route_async(struct krt_proto *p, struct rte *e, int new); -- cgit v1.2.3