summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_updgrp_adv.c
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@cumulusnetworks.com>2017-06-12 22:20:50 +0200
committerQuentin Young <qlyoung@cumulusnetworks.com>2017-11-30 22:18:03 +0100
commit2fc102e16bc2e430bf56198ca9ff73666b483693 (patch)
treeed25d95387935f2007ff3ade0be3f536b8fc5c8d /bgpd/bgp_updgrp_adv.c
parenttests: update tests for bgp_packet changes (diff)
downloadfrr-2fc102e16bc2e430bf56198ca9ff73666b483693.tar.xz
frr-2fc102e16bc2e430bf56198ca9ff73666b483693.zip
bgpd: re-add update-group write triggers
Removed in earlier version where the I/O pthread busy-waited for packets to be posted to an output queue. Now that it's poll()-based, it's necessary once again. Although this time we can say what we're actually doing instead of a side effect of a write job. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'bgpd/bgp_updgrp_adv.c')
-rw-r--r--bgpd/bgp_updgrp_adv.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/bgpd/bgp_updgrp_adv.c b/bgpd/bgp_updgrp_adv.c
index 1ec9915ee..705cb152f 100644
--- a/bgpd/bgp_updgrp_adv.c
+++ b/bgpd/bgp_updgrp_adv.c
@@ -483,6 +483,7 @@ void bgp_adj_out_unset_subgroup(struct bgp_node *rn,
{
struct bgp_adj_out *adj;
struct bgp_advertise *adv;
+ bool trigger_write;
if (DISABLE_BGP_ANNOUNCE)
return;
@@ -500,9 +501,16 @@ void bgp_adj_out_unset_subgroup(struct bgp_node *rn,
adv->rn = rn;
adv->adj = adj;
+ /* Note if we need to trigger a packet write */
+ trigger_write =
+ BGP_ADV_FIFO_EMPTY(&subgrp->sync->withdraw);
+
/* Add to synchronization entry for withdraw
* announcement. */
BGP_ADV_FIFO_ADD(&subgrp->sync->withdraw, &adv->fifo);
+
+ if (trigger_write)
+ subgroup_trigger_write(subgrp);
} else {
/* Remove myself from adjacency. */
BGP_ADJ_OUT_DEL(rn, adj);