Skip to content

Commit

Permalink
Merge pull request #15524 from raja-rajasekar/rajasekarr/backpressure…
Browse files Browse the repository at this point in the history
…_bgp_zebra_client

backpressure bgp zebra client
  • Loading branch information
riw777 authored Mar 26, 2024
2 parents 4828e85 + ccfe452 commit 94e6a0f
Show file tree
Hide file tree
Showing 8 changed files with 239 additions and 73 deletions.
2 changes: 2 additions & 0 deletions bgpd/bgp_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,8 @@ static __attribute__((__noreturn__)) void bgp_exit(int status)
bgp_evpn_mh_finish();
bgp_nhg_finish();

zebra_announce_fini(&bm->zebra_announce_head);

/* reverse bgp_dump_init */
bgp_dump_finish();

Expand Down
19 changes: 9 additions & 10 deletions bgpd/bgp_route.c
Original file line number Diff line number Diff line change
Expand Up @@ -3403,8 +3403,8 @@ static void bgp_process_main_one(struct bgp *bgp, struct bgp_dest *dest,
|| new_select->sub_type
== BGP_ROUTE_IMPORTED))

bgp_zebra_announce(dest, p, old_select,
bgp, afi, safi);
bgp_zebra_route_install(dest, old_select,
bgp, true);
}
}

Expand Down Expand Up @@ -3521,19 +3521,19 @@ static void bgp_process_main_one(struct bgp *bgp, struct bgp_dest *dest,
*/
if (old_select &&
is_route_parent_evpn(old_select))
bgp_zebra_withdraw(p, old_select, bgp, afi,
safi);
bgp_zebra_route_install(dest, old_select, bgp,
false);

bgp_zebra_announce(dest, p, new_select, bgp, afi, safi);
bgp_zebra_route_install(dest, new_select, bgp, true);
} else {
/* Withdraw the route from the kernel. */
if (old_select && old_select->type == ZEBRA_ROUTE_BGP
&& (old_select->sub_type == BGP_ROUTE_NORMAL
|| old_select->sub_type == BGP_ROUTE_AGGREGATE
|| old_select->sub_type == BGP_ROUTE_IMPORTED))

bgp_zebra_withdraw(p, old_select, bgp, afi,
safi);
bgp_zebra_route_install(dest, old_select, bgp,
false);
}
}

Expand Down Expand Up @@ -4430,7 +4430,7 @@ void bgp_update(struct peer *peer, const struct prefix *p, uint32_t addpath_id,
if (pi && pi->attr->rmap_table_id != new_attr.rmap_table_id) {
if (CHECK_FLAG(pi->flags, BGP_PATH_SELECTED))
/* remove from RIB previous entry */
bgp_zebra_withdraw(p, pi, bgp, afi, safi);
bgp_zebra_route_install(dest, pi, bgp, false);
}

if (peer->sort == BGP_PEER_EBGP) {
Expand Down Expand Up @@ -6056,8 +6056,7 @@ static void bgp_cleanup_table(struct bgp *bgp, struct bgp_table *table,
|| pi->sub_type == BGP_ROUTE_IMPORTED)) {

if (bgp_fibupd_safi(safi))
bgp_zebra_withdraw(p, pi, bgp, afi,
safi);
bgp_zebra_withdraw_actual(dest, pi, bgp);
}

dest = bgp_path_info_reap(dest, pi);
Expand Down
7 changes: 7 additions & 0 deletions bgpd/bgp_table.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ struct bgp_dest {

STAILQ_ENTRY(bgp_dest) pq;

struct zebra_announce_item zai;
struct bgp_path_info *za_bgp_pi;

uint64_t version;

mpls_label_t local_label;
Expand All @@ -91,12 +94,16 @@ struct bgp_dest {
#define BGP_NODE_LABEL_REQUESTED (1 << 7)
#define BGP_NODE_SOFT_RECONFIG (1 << 8)
#define BGP_NODE_PROCESS_CLEAR (1 << 9)
#define BGP_NODE_SCHEDULE_FOR_INSTALL (1 << 10)
#define BGP_NODE_SCHEDULE_FOR_DELETE (1 << 11)

struct bgp_addpath_node_data tx_addpath;

enum bgp_path_selection_reason reason;
};

DECLARE_LIST(zebra_announce, struct bgp_dest, zai);

extern void bgp_delete_listnode(struct bgp_dest *dest);
/*
* bgp_table_iter_t
Expand Down
Loading

0 comments on commit 94e6a0f

Please sign in to comment.