diff options
author | Jorge Boncompte <jbonor@gmail.com> | 2017-08-05 12:59:05 +0200 |
---|---|---|
committer | Jorge Boncompte <jbonor@gmail.com> | 2017-08-17 17:58:35 +0200 |
commit | aac2483887eddfe782a31f03b5a30643793935f5 (patch) | |
tree | d63f004370dcd3eb2405a40817750291c9c611c1 /bgpd/bgp_table.h | |
parent | bgpd: inline bgp_lock()/bgp_unlock() (diff) | |
download | frr-aac2483887eddfe782a31f03b5a30643793935f5.tar.xz frr-aac2483887eddfe782a31f03b5a30643793935f5.zip |
bgpd: bgp process queue optimization
There are several code paths that dump nodes to the queue for route
processing in a loop. This patch tries to reduce memory allocations/freeing
(work item, list node) and thread scheduling overhead by batching the nodes
in a simple queue list.
In the past when route processing wasn't event driven (bgp_scan()), this used
to have a noticeable impact in table loading, convergence time and memory heap
fragmentation due to reduced alloc's/free's.
Signed-off-by: Jorge Boncompte <jbonor@gmail.com>
Diffstat (limited to 'bgpd/bgp_table.h')
-rw-r--r-- | bgpd/bgp_table.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/bgpd/bgp_table.h b/bgpd/bgp_table.h index 0d5706f7c..a4f3b604c 100644 --- a/bgpd/bgp_table.h +++ b/bgpd/bgp_table.h @@ -23,6 +23,7 @@ #include "mpls.h" #include "table.h" +#include "queue.h" struct bgp_table { /* afi/safi of this table */ @@ -52,6 +53,8 @@ struct bgp_node { struct bgp_node *prn; + STAILQ_ENTRY(bgp_node) pq; + mpls_label_t local_label; uint64_t version; |