From 161972c9fe108ffe3de851a537d9b34efeb09e31 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Wed, 19 Apr 2023 08:13:18 -0400 Subject: *: Rearrange vrf_bitmap_X api to reduce memory footprint When running all daemons with config for most of them, FRR has sharpd@janelle:~/frr$ vtysh -c "show debug hashtable" | grep "VRF BIT HASH" | wc -l 3570 3570 hashes for bitmaps associated with the vrf. This is a very large number of hashes. Let's do two things: a) Reduce the created size of the actually created hashes to 2 instead of 32. b) Delay generation of the hash *until* a set operation happens. As that no hash directly implies a unset value if/when checked. This reduces the number of hashes to 61 in my setup for normal operation. Signed-off-by: Donald Sharp --- ospf6d/ospf6_zebra.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ospf6d/ospf6_zebra.h') diff --git a/ospf6d/ospf6_zebra.h b/ospf6d/ospf6_zebra.h index 9f41dfca9..7669b5e2c 100644 --- a/ospf6d/ospf6_zebra.h +++ b/ospf6d/ospf6_zebra.h @@ -38,7 +38,7 @@ extern void ospf6_zebra_route_update_remove(struct ospf6_route *request, extern void ospf6_zebra_redistribute(int, vrf_id_t vrf_id); extern void ospf6_zebra_no_redistribute(int, vrf_id_t vrf_id); #define ospf6_zebra_is_redistribute(type, vrf_id) \ - vrf_bitmap_check(zclient->redist[AFI_IP6][type], vrf_id) + vrf_bitmap_check(&zclient->redist[AFI_IP6][type], vrf_id) extern void ospf6_zebra_init(struct event_loop *tm); extern void ospf6_zebra_import_default_route(struct ospf6 *ospf6, bool unreg); extern void ospf6_zebra_add_discard(struct ospf6_route *request, -- cgit v1.2.3