Skip to content

Commit 705fed7

Browse files
donaldsharpraja-rajasekar
authored andcommitted
bgpd: backpressure - Add a typesafe list for Zebra Announcement
Modify the bgp master to hold a type safe list for bgp_dests that need to be passed to zebra. Future commits will use this. Ticket: #3390099 Signed-off-by: Donald Sharp <sharpd@nvidia.com> Signed-off-by: Rajasekar Raja <rajasekarr@nvidia.com>
1 parent ffab0d7 commit 705fed7

File tree

4 files changed

+13
-0
lines changed

4 files changed

+13
-0
lines changed

bgpd/bgp_main.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,8 @@ static __attribute__((__noreturn__)) void bgp_exit(int status)
207207
bgp_evpn_mh_finish();
208208
bgp_nhg_finish();
209209

210+
zebra_announce_fini(&bm->zebra_announce_head);
211+
210212
/* reverse bgp_dump_init */
211213
bgp_dump_finish();
212214

bgpd/bgp_table.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ struct bgp_dest {
7676

7777
STAILQ_ENTRY(bgp_dest) pq;
7878

79+
struct zebra_announce_item zai;
80+
7981
uint64_t version;
8082

8183
mpls_label_t local_label;
@@ -97,6 +99,8 @@ struct bgp_dest {
9799
enum bgp_path_selection_reason reason;
98100
};
99101

102+
DECLARE_LIST(zebra_announce, struct bgp_dest, zai);
103+
100104
extern void bgp_delete_listnode(struct bgp_dest *dest);
101105
/*
102106
* bgp_table_iter_t

bgpd/bgpd.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8289,6 +8289,8 @@ void bgp_master_init(struct event_loop *master, const int buffer_size,
82898289
memset(&bgp_master, 0, sizeof(bgp_master));
82908290

82918291
bm = &bgp_master;
8292+
8293+
zebra_announce_init(&bm->zebra_announce_head);
82928294
bm->bgp = list_new();
82938295
bm->listen_sockets = list_new();
82948296
bm->port = BGP_PORT_DEFAULT;

bgpd/bgpd.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
#include "iana_afi.h"
1919
#include "asn.h"
2020

21+
PREDECL_LIST(zebra_announce);
22+
2123
/* For union sockunion. */
2224
#include "queue.h"
2325
#include "sockunion.h"
@@ -175,6 +177,9 @@ struct bgp_master {
175177

176178
bool v6_with_v4_nexthops;
177179

180+
/* To preserve ordering of installations into zebra across all Vrfs */
181+
struct zebra_announce_head zebra_announce_head;
182+
178183
QOBJ_FIELDS;
179184
};
180185
DECLARE_QOBJ_TYPE(bgp_master);

0 commit comments

Comments
 (0)