diff options
author | Donald Sharp <sharpd@cumulusnetworks.com> | 2015-05-20 02:40:36 +0200 |
---|---|---|
committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2015-05-20 02:40:36 +0200 |
commit | cdabb8b69196648046264f4fa76b77b66ae134a6 (patch) | |
tree | 152257fd69a2d8e01ea8e17bde98bd157e14effb /bgpd/bgp_advertise.c | |
parent | bgpd: bgpd-fix-ipv6-afi-parser-node.patch (diff) | |
download | frr-cdabb8b69196648046264f4fa76b77b66ae134a6.tar.xz frr-cdabb8b69196648046264f4fa76b77b66ae134a6.zip |
bgpd: bgpd-peer-outq.patch
BGP: Show more meaningful outq value in 'show ip bgp summary' output.
'outq' field in 'show ip bgp sum' displays the number of formatted packets
to a peer. Since the route announcement follows an input-buffered pattern
(i.e. adj-rib-out is a separate queue of routes per peer and packets are
formatted from the routes at the time of TCP write), the outq field doesn't
show any interesting data worth watching.
The patch is to display the adj-rib-out queue depth instead.
signed-off-by: pmohapat@cumulusnetworks.com
reviewed-by: dwalton@cumulusnetworks.com
Diffstat (limited to 'bgpd/bgp_advertise.c')
-rw-r--r-- | bgpd/bgp_advertise.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/bgpd/bgp_advertise.c b/bgpd/bgp_advertise.c index e0fa58d46..adf40a0bb 100644 --- a/bgpd/bgp_advertise.c +++ b/bgpd/bgp_advertise.c @@ -185,10 +185,12 @@ bgp_advertise_clean (struct peer *peer, struct bgp_adj_out *adj, struct bgp_advertise *adv; struct bgp_advertise_attr *baa; struct bgp_advertise *next; + struct bgp_advertise_fifo *fhead; adv = adj->adv; baa = adv->baa; next = NULL; + fhead = &peer->sync[afi][safi]->withdraw; if (baa) { @@ -200,10 +202,12 @@ bgp_advertise_clean (struct peer *peer, struct bgp_adj_out *adj, /* Unintern BGP advertise attribute. */ bgp_advertise_unintern (peer->hash[afi][safi], baa); + + fhead = &peer->sync[afi][safi]->update; } /* Unlink myself from advertisement FIFO. */ - FIFO_DEL (adv); + BGP_ADV_FIFO_DEL (fhead, adv); /* Free memory. */ bgp_advertise_free (adj->adv); @@ -263,7 +267,7 @@ bgp_adj_out_set (struct bgp_node *rn, struct peer *peer, struct prefix *p, /* Add new advertisement to advertisement attribute list. */ bgp_advertise_add (adv->baa, adv); - FIFO_ADD (&peer->sync[afi][safi]->update, &adv->fifo); + BGP_ADV_FIFO_ADD (&peer->sync[afi][safi]->update, &adv->fifo); } void @@ -297,7 +301,7 @@ bgp_adj_out_unset (struct bgp_node *rn, struct peer *peer, struct prefix *p, adv->adj = adj; /* Add to synchronization entry for withdraw announcement. */ - FIFO_ADD (&peer->sync[afi][safi]->withdraw, &adv->fifo); + BGP_ADV_FIFO_ADD (&peer->sync[afi][safi]->withdraw, &adv->fifo); /* Schedule packet write. */ BGP_WRITE_ON (peer->t_write, bgp_write, peer->fd); @@ -389,9 +393,9 @@ bgp_sync_init (struct peer *peer) { sync = XCALLOC (MTYPE_BGP_SYNCHRONISE, sizeof (struct bgp_synchronize)); - FIFO_INIT (&sync->update); - FIFO_INIT (&sync->withdraw); - FIFO_INIT (&sync->withdraw_low); + BGP_ADV_FIFO_INIT (&sync->update); + BGP_ADV_FIFO_INIT (&sync->withdraw); + BGP_ADV_FIFO_INIT (&sync->withdraw_low); peer->sync[afi][safi] = sync; peer->hash[afi][safi] = hash_create (baa_hash_key, baa_hash_cmp); } |