diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2019-12-20 23:00:31 -0500 |
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2020-01-03 08:39:55 -0500 |
| commit | dd3364cb1aa265ec0310e8ed8adffac16f6fb24e (patch) | |
| tree | db4bb6a717a812aa73361ab9fb55a11fabff3163 /pimd/pim_nht.c | |
| parent | 7315ecdabe2e06fb75b860b65c842f0083da730e (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_nht.c')
| -rw-r--r-- | pimd/pim_nht.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/pimd/pim_nht.c b/pimd/pim_nht.c index bd8424b3e4..5cb9492ec3 100644 --- a/pimd/pim_nht.c +++ b/pimd/pim_nht.c @@ -177,7 +177,6 @@ void pim_delete_tracked_nexthop(struct pim_instance *pim, struct prefix *addr, struct pim_nexthop_cache *pnc = NULL; struct pim_nexthop_cache lookup; struct zclient *zclient = NULL; - struct listnode *upnode = NULL; struct pim_upstream *upstream = NULL; zclient = pim_zebra_zclient_get(); @@ -190,8 +189,8 @@ void pim_delete_tracked_nexthop(struct pim_instance *pim, struct prefix *addr, /* Release the (*, G)upstream from pnc->upstream_hash, * whose Group belongs to the RP getting deleted */ - for (ALL_LIST_ELEMENTS_RO(pim->upstream_list, upnode, - upstream)) { + frr_each (rb_pim_upstream, &pim->upstream_head, + upstream) { struct prefix grp; struct rp_info *trp_info; |
