summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2016-03-02 15:04:51 -0500
committerDonald Sharp <sharpd@cumulusnetworks.com>2016-03-02 15:10:02 -0500
commit91bce9882c8681746eb09b93f27152a8885d0eaa (patch)
tree420719fbce1cbada175e3f7543b89e5c3546729a
parent747e489cd812f21c9718e24ffe8fde8d62f944c3 (diff)
bgpd: Remove expensive prefix count from json.
'show bgp ipv4 uni summ' is counting each prefix sent to each neighbor. At scale this is an expensive operation. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com> Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
-rw-r--r--bgpd/bgp_vty.c18
1 files changed, 0 insertions, 18 deletions
diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c
index 21a651b6ea..5c233b2cf3 100644
--- a/bgpd/bgp_vty.c
+++ b/bgpd/bgp_vty.c
@@ -8300,23 +8300,6 @@ DEFUN (show_bgp_memory,
return CMD_SUCCESS;
}
-static int
-bgp_adj_out_count (struct peer *peer, int afi, int safi)
-{
- struct bgp_table *table;
- struct bgp_node *rn;
- int count = 0;
-
- if (!peer) return(0);
-
- table = peer->bgp->rib[afi][safi];
- if (!table) return(0);
- for (rn = bgp_table_top(table); rn; rn = bgp_route_next(rn))
- if (bgp_adj_out_lookup(peer, rn, 0))
- count++;
- return (count);
-}
-
/* Show BGP peer's summary information. */
static int
bgp_show_summary (struct vty *vty, struct bgp *bgp, int afi, int safi,
@@ -8528,7 +8511,6 @@ bgp_show_summary (struct vty *vty, struct bgp *bgp, int afi, int safi,
json_object_int_add(json_peer, "inq", 0);
peer_uptime (peer->uptime, timebuf, BGP_UPTIME_LEN, use_json, json_peer);
json_object_int_add(json_peer, "prefixReceivedCount", peer->pcount[afi][safi]);
- json_object_int_add(json_peer, "prefixAdvertisedCount", bgp_adj_out_count(peer, afi, safi));
if (CHECK_FLAG (peer->flags, PEER_FLAG_SHUTDOWN))
json_object_string_add(json_peer, "state", "Idle (Admin)");