Skip to content

Commit

Permalink
bgpd: backpressure - Add a typesafe list for Zebra Announcement
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Rajasekar Raja <[email protected]>
  • Loading branch information
donaldsharp authored and raja-rajasekar committed Mar 8, 2024
1 parent ffab0d7 commit 3f0ce9c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions bgpd/bgp_table.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ struct bgp_dest {

STAILQ_ENTRY(bgp_dest) pq;

struct zebra_announce_item zai;

uint64_t version;

mpls_label_t local_label;
Expand All @@ -97,6 +99,8 @@ struct bgp_dest {
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
2 changes: 2 additions & 0 deletions bgpd/bgpd.c
Original file line number Diff line number Diff line change
Expand Up @@ -8289,6 +8289,8 @@ void bgp_master_init(struct event_loop *master, const int buffer_size,
memset(&bgp_master, 0, sizeof(bgp_master));

bm = &bgp_master;

zebra_announce_init(&bm->zebra_announce_head);
bm->bgp = list_new();
bm->listen_sockets = list_new();
bm->port = BGP_PORT_DEFAULT;
Expand Down
5 changes: 5 additions & 0 deletions bgpd/bgpd.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
#include "iana_afi.h"
#include "asn.h"

PREDECL_LIST(zebra_announce);

/* For union sockunion. */
#include "queue.h"
#include "sockunion.h"
Expand Down Expand Up @@ -175,6 +177,9 @@ struct bgp_master {

bool v6_with_v4_nexthops;

/* To preserve ordering of installations into zebra across all Vrfs */
struct zebra_announce_head zebra_announce_head;

QOBJ_FIELDS;
};
DECLARE_QOBJ_TYPE(bgp_master);
Expand Down

0 comments on commit 3f0ce9c

Please sign in to comment.