summaryrefslogtreecommitdiffstats
path: root/ospf6d/ospf6_top.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2023-04-19 14:13:18 +0200
committerDonald Sharp <sharpd@nvidia.com>2023-06-26 20:59:21 +0200
commit161972c9fe108ffe3de851a537d9b34efeb09e31 (patch)
tree6de17e2202d18969ee4aae4c85ecaccdc89c4f89 /ospf6d/ospf6_top.c
parentMerge pull request #13804 from LabNConsulting/aceelindem/ospf6d-config-callbacks (diff)
downloadfrr-161972c9fe108ffe3de851a537d9b34efeb09e31.tar.xz
frr-161972c9fe108ffe3de851a537d9b34efeb09e31.zip
*: 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 <sharpd@nvidia.com>
Diffstat (limited to 'ospf6d/ospf6_top.c')
-rw-r--r--ospf6d/ospf6_top.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/ospf6d/ospf6_top.c b/ospf6d/ospf6_top.c
index 01c962194..4c4029879 100644
--- a/ospf6d/ospf6_top.c
+++ b/ospf6d/ospf6_top.c
@@ -140,20 +140,20 @@ static void ospf6_set_redist_vrf_bitmaps(struct ospf6 *ospf6, bool set)
"%s: setting redist vrf %d bitmap for type %d",
__func__, ospf6->vrf_id, type);
if (set)
- vrf_bitmap_set(zclient->redist[AFI_IP6][type],
+ vrf_bitmap_set(&zclient->redist[AFI_IP6][type],
ospf6->vrf_id);
else
- vrf_bitmap_unset(zclient->redist[AFI_IP6][type],
+ vrf_bitmap_unset(&zclient->redist[AFI_IP6][type],
ospf6->vrf_id);
}
red_list = ospf6->redist[DEFAULT_ROUTE];
if (red_list) {
if (set)
- vrf_bitmap_set(zclient->default_information[AFI_IP6],
+ vrf_bitmap_set(&zclient->default_information[AFI_IP6],
ospf6->vrf_id);
else
- vrf_bitmap_unset(zclient->default_information[AFI_IP6],
+ vrf_bitmap_unset(&zclient->default_information[AFI_IP6],
ospf6->vrf_id);
}
}