diff options
| author | Donald Sharp <sharpd@nvidia.com> | 2023-04-19 08:13:18 -0400 | 
|---|---|---|
| committer | Donald Sharp <sharpd@nvidia.com> | 2023-06-26 14:59:21 -0400 | 
| commit | 161972c9fe108ffe3de851a537d9b34efeb09e31 (patch) | |
| tree | 6de17e2202d18969ee4aae4c85ecaccdc89c4f89 /babeld | |
| parent | dee79c33a425d264e53e0e5d0ad51b1bc13945d0 (diff) | |
*: 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 'babeld')
| -rw-r--r-- | babeld/babeld.c | 16 | 
1 files changed, 8 insertions, 8 deletions
diff --git a/babeld/babeld.c b/babeld/babeld.c index f4c932971e..ebf8474f4c 100644 --- a/babeld/babeld.c +++ b/babeld/babeld.c @@ -108,14 +108,14 @@ babel_config_write (struct vty *vty)      /* list redistributed protocols */      for (afi = AFI_IP; afi <= AFI_IP6; afi++) {          for (i = 0; i < ZEBRA_ROUTE_MAX; i++) { -            if (i != zclient->redist_default && -                vrf_bitmap_check (zclient->redist[afi][i], VRF_DEFAULT)) { -                vty_out (vty, " redistribute %s %s\n", -                         (afi == AFI_IP) ? "ipv4" : "ipv6", -                         zebra_route_string(i)); -                lines++; -            } -        } +		if (i != zclient->redist_default && +		    vrf_bitmap_check(&zclient->redist[afi][i], VRF_DEFAULT)) { +			vty_out(vty, " redistribute %s %s\n", +				(afi == AFI_IP) ? "ipv4" : "ipv6", +				zebra_route_string(i)); +			lines++; +		} +	}      }      lines += config_write_distribute (vty, babel_routing_process->distribute_ctx);  | 
