summaryrefslogtreecommitdiffstats
path: root/pimd/pim_upstream.h
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2019-12-21 05:00:31 +0100
committerDonald Sharp <sharpd@cumulusnetworks.com>2020-01-03 14:39:55 +0100
commitdd3364cb1aa265ec0310e8ed8adffac16f6fb24e (patch)
treedb4bb6a717a812aa73361ab9fb55a11fabff3163 /pimd/pim_upstream.h
parentpimd: Convert the channel_oil_list|hash to a rb_tree (diff)
downloadfrr-dd3364cb1aa265ec0310e8ed8adffac16f6fb24e.tar.xz
frr-dd3364cb1aa265ec0310e8ed8adffac16f6fb24e.zip
pimd: Convert the upstream_list and hash to a rb tree
Convert the upstream_list and hash to a rb tree, Significant time was being spent in the listnode_add_sort. This reduces this time greatly. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to '')
-rw-r--r--pimd/pim_upstream.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/pimd/pim_upstream.h b/pimd/pim_upstream.h
index ab5082051..1eb2052bb 100644
--- a/pimd/pim_upstream.h
+++ b/pimd/pim_upstream.h
@@ -169,6 +169,7 @@ enum pim_upstream_sptbit {
PIM_UPSTREAM_SPTBIT_TRUE
};
+PREDECL_RBTREE_UNIQ(rb_pim_upstream);
/*
Upstream (S,G) channel in Joined state
(S,G) in the "Not Joined" state is not represented
@@ -198,6 +199,7 @@ enum pim_upstream_sptbit {
*/
struct pim_upstream {
struct pim_instance *pim;
+ struct rb_pim_upstream_item upstream_rb;
struct pim_upstream *parent;
struct in_addr upstream_addr; /* Who we are talking to */
struct in_addr upstream_register; /*Who we received a register from*/
@@ -326,7 +328,11 @@ void pim_upstream_init(struct pim_instance *pim);
void pim_upstream_terminate(struct pim_instance *pim);
void join_timer_start(struct pim_upstream *up);
-int pim_upstream_compare(void *arg1, void *arg2);
+int pim_upstream_compare(const struct pim_upstream *up1,
+ const struct pim_upstream *up2);
+DECLARE_RBTREE_UNIQ(rb_pim_upstream, struct pim_upstream, upstream_rb,
+ pim_upstream_compare)
+
void pim_upstream_register_reevaluate(struct pim_instance *pim);
void pim_upstream_add_lhr_star_pimreg(struct pim_instance *pim);