Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

backpressure bgp zebra client #15524

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -3399,8 +3399,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 @@ -3517,19 +3517,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 @@ -4426,7 +4426,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 @@ -6052,8 +6052,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
Loading