summaryrefslogtreecommitdiff
path: root/lib/zclient.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2024-01-26 14:48:53 -0500
committerRajasekar Raja <rajasekarr@nvidia.com>2024-03-25 17:49:35 -0700
commitccfe452763d16c432fa81fd20e805bec819b345e (patch)
treed03fb5ee7e6ffcec190e4e2b112ede504847b8d4 /lib/zclient.c
parent5f379bebe82591c0665c29419fd3ab8758258e4e (diff)
bgpd : backpressure - Handle BGP-Zebra Install evt Creation
BGP is now keeping a list of dests with the dest having a pointer to the bgp_path_info that it will be working on. 1) When bgp receives a prefix, process it, add the bgp_dest of the prefix into the new Fifo list if not present, update the flags (Ex: earlier if the prefix was advertised and now it is a withdrawn), increment the ref_count and DO NOT advertise the install/withdraw to zebra yet. 2) Schedule an event to wake up to invoke the new function which will walk the list one by one and installs/withdraws the routes into zebra. a) if BUFFER_EMPTY, process the next item on the list b) if BUFFER_PENDING, bail out and the callback in zclient_flush_data() will invoke the same function when BUFFER_EMPTY Changes - rename old bgp_zebra_announce to bgp_zebra_announce_actual - rename old bgp_zebra_withdrw to bgp_zebra_withdraw_actual - Handle new fifo list cleanup in bgp_exit() - New funcs: bgp_handle_route_announcements_to_zebra() and bgp_zebra_route_install() - Define a callback function to invoke bgp_handle_route_announcements_to_zebra() when BUFFER_EMPTY in zclient_flush_data() The current change deals with bgp installing routes via bgp_process_main_one() Ticket: #3390099 Signed-off-by: Donald Sharp <sharpd@nvidia.com> Signed-off-by: Rajasekar Raja <rajasekarr@nvidia.com>
Diffstat (limited to 'lib/zclient.c')
-rw-r--r--lib/zclient.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/zclient.c b/lib/zclient.c
index 51ebb56275..4cbd04c116 100644
--- a/lib/zclient.c
+++ b/lib/zclient.c
@@ -282,6 +282,7 @@ static void zclient_flush_data(struct event *thread)
zclient->sock, &zclient->t_write);
break;
case BUFFER_EMPTY:
+ /* Currently only Sharpd and Bgpd has callbacks defined */
if (zclient->zebra_buffer_write_ready)
(*zclient->zebra_buffer_write_ready)();
break;