On Mon, Oct 29, 2018 at 10:58:36AM +0100, Claudio Jeker wrote:
> With the last commit the rde_aspath no longer needs to have a list of
> prefixes and also the peer no longer need to have a list of aspaths.
> This diff removes both and replaces the list of prefixes with a refcount.
> The big benefit of this is that struct rde_aspath can now be shared
> between sessions and ribs. This is an important set for Adj-RIB-Out
> support.
>
And here is the bgpctl diff to print out the number of references hold on
the rde_aspath structs.
--
:wq Claudio
Index: bgpctl.c
===================================================================
RCS file: /cvs/src/usr.sbin/bgpctl/bgpctl.c,v
retrieving revision 1.220
diff -u -p -r1.220 bgpctl.c
--- bgpctl.c 26 Oct 2018 16:54:53 -0000 1.220
+++ bgpctl.c 29 Oct 2018 09:43:34 -0000
@@ -1864,6 +1864,8 @@ show_rib_memory_msg(struct imsg *imsg)
printf("%10lld BGP path attribute entries using %s of memory\n",
(long long)stats.path_cnt, fmt_mem(stats.path_cnt *
sizeof(struct rde_aspath)));
+ printf("\t and holding %lld references\n",
+ (long long)stats.path_refs);
printf("%10lld BGP AS-PATH attribute entries using "
"%s of memory,\n\t and holding %lld references\n",
(long long)stats.aspath_cnt, fmt_mem(stats.aspath_size),