summaryrefslogtreecommitdiff
path: root/pimd/pim_msdp.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2019-12-20 23:00:31 -0500
committerDonald Sharp <sharpd@cumulusnetworks.com>2020-01-03 08:39:55 -0500
commitdd3364cb1aa265ec0310e8ed8adffac16f6fb24e (patch)
treedb4bb6a717a812aa73361ab9fb55a11fabff3163 /pimd/pim_msdp.c
parent7315ecdabe2e06fb75b860b65c842f0083da730e (diff)
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 'pimd/pim_msdp.c')
-rw-r--r--pimd/pim_msdp.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/pimd/pim_msdp.c b/pimd/pim_msdp.c
index 8a18594fd7..58ebc6ce67 100644
--- a/pimd/pim_msdp.c
+++ b/pimd/pim_msdp.c
@@ -565,11 +565,9 @@ void pim_msdp_sa_local_update(struct pim_upstream *up)
static void pim_msdp_sa_local_setup(struct pim_instance *pim)
{
struct pim_upstream *up;
- struct listnode *up_node;
- for (ALL_LIST_ELEMENTS_RO(pim->upstream_list, up_node, up)) {
+ frr_each (rb_pim_upstream, &pim->upstream_head, up)
pim_msdp_sa_local_update(up);
- }
}
/* whenever the RP changes we need to re-evaluate the "local" SA-cache */