]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: backpressure - Add a typesafe list for Zebra Announcement
authorDonald Sharp <sharpd@nvidia.com>
Thu, 25 Jan 2024 17:53:24 +0000 (12:53 -0500)
committerRajasekar Raja <rajasekarr@nvidia.com>
Mon, 25 Mar 2024 21:23:53 +0000 (14:23 -0700)
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>
bgpd/bgp_main.c
bgpd/bgp_table.h
bgpd/bgpd.c
bgpd/bgpd.h

index 851c4880c37f2ee95e9c54e233292e324d9307ad..44d5ee68cce6d26aa2a631e0f5340d654bf5c094 100644 (file)
@@ -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();
 
index 5b4c3be212244e8778b75e61fbaba984bc4c2cc2..94bd816f55bf83ec0bbc35e4b38ef19c3f3bc797 100644 (file)
@@ -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;
@@ -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
index e7712f0f3e0c06d46e398cf6921f1379a127cde6..650148859eb382f7bd4cc50e2f21522a21f8dc48 100644 (file)
@@ -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;
index 94bb10725354a3c3ea72284ea64e92339de1649f..a1c7791c35e1040f3c9e2a639784de0fa6b21a1c 100644 (file)
@@ -18,6 +18,8 @@
 #include "iana_afi.h"
 #include "asn.h"
 
+PREDECL_LIST(zebra_announce);
+
 /* For union sockunion.  */
 #include "queue.h"
 #include "sockunion.h"
@@ -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);