]> git.puffer.fish Git - mirror/frr.git/commitdiff
zebra: Do not allow same rib_dest_t be queued multiple times to meta queue 1236/head
authorDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 25 Sep 2017 12:10:24 +0000 (08:10 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 25 Sep 2017 12:10:24 +0000 (08:10 -0400)
If we have already scheduled a node to be on the meta_queue, there is no
need to schedule it up again.

On startup we are calling rib_update() multiple times per connected route.
Due to the multiple ways we can get callbacks for adding a connected route
I decided it was best to just improve meta_queue performance as opposed
to trying to figure out all the different ways across all the platforms
that we can decide that a connected route has changed.  This appears
to solve the issue with a very large # of interfaces coming up
at the same time on startup.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
zebra/rib.h
zebra/zebra_rib.c

index 4cc69377d8abc52216e541a147c412926dcfda41..fec5c2aacff6664c5260ffe13a77bd0a17bab0f6 100644 (file)
@@ -135,6 +135,8 @@ typedef struct rib_dest_t_ {
 } rib_dest_t;
 
 #define RIB_ROUTE_QUEUED(x)    (1 << (x))
+// If MQ_SIZE is modified this value needs to be updated.
+#define RIB_ROUTE_ANY_QUEUED    0x1F
 
 /*
  * The maximum qindex that can be used.
index bb496633191a3934b06964ea52a8d8144960c49e..00550fa07db336b6bd86b6418e1f609c654682cc 100644 (file)
@@ -2552,6 +2552,15 @@ static void rib_update_table(struct route_table *table,
         * the trigger event.
         */
        for (rn = route_top(table); rn; rn = srcdest_route_next(rn)) {
+               /*
+                * If we are looking at a route node and the node
+                * has already been queued  we don't
+                * need to queue it up again
+                */
+               if (rn->info
+                   && CHECK_FLAG(rib_dest_from_rnode(rn)->flags,
+                                 RIB_ROUTE_ANY_QUEUED))
+                       continue;
                switch (event) {
                case RIB_UPDATE_IF_CHANGE:
                        /* Examine all routes that won't get processed by the