summaryrefslogtreecommitdiff
path: root/bgpd/bgp_aspath.h
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2024-10-24 11:27:24 -0400
committerDonald Sharp <sharpd@nvidia.com>2024-10-24 21:01:26 -0400
commited94fbfe5b1ec2d2d191d30b169e8f40ce48ecdb (patch)
treee482ed212e2dbf27590f5174e2dfc6032ad038f5 /bgpd/bgp_aspath.h
parent4954d9d17cd324ebe40aae4842362c0d16e8c35a (diff)
bgpd: Store aspath count after aspath has changed
When running bestpath on a very large number of ecmp. BGP ends up calling aspath_count a very very large number of times, which results in ~15% cpu runtime in aspath_count_hops. Modify the aspath to keep track of it's own count. This results in the function now taking up ~1.5% of the cpu runtime. Enough for the moment to be ignored. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'bgpd/bgp_aspath.h')
-rw-r--r--bgpd/bgp_aspath.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/bgpd/bgp_aspath.h b/bgpd/bgp_aspath.h
index f7e57fd66d..46202fd34a 100644
--- a/bgpd/bgp_aspath.h
+++ b/bgpd/bgp_aspath.h
@@ -59,6 +59,7 @@ struct aspath {
and AS path regular expression match. */
char *str;
unsigned short str_len;
+ uint32_t count;
/* AS notation used by string expression of AS path */
enum asnotation_mode asnotation;