diff options
| author | Renato Westphal <renato@opensourcerouting.org> | 2017-10-02 22:06:01 -0300 |
|---|---|---|
| committer | Renato Westphal <renato@opensourcerouting.org> | 2017-10-10 09:05:02 -0300 |
| commit | f4e14fdba7de19ca660278a0b8c750140db5868b (patch) | |
| tree | 58eb2d22e84b24672ddff1dd786f18e5bc555b15 /zebra/irdp_main.c | |
| parent | 5d56066e4645ce1104f766cb2a2b767b483c9ce5 (diff) | |
*: use rb-trees to store interfaces instead of sorted linked-lists
This is an important optimization for users running FRR on systems with
a large number of interfaces (e.g. thousands of tunnels). Red-black
trees scale much better than sorted linked-lists and also store the
elements in an ordered way (contrary to hash tables).
This is a big patch but the interesting bits are all in lib/if.[ch].
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'zebra/irdp_main.c')
| -rw-r--r-- | zebra/irdp_main.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/zebra/irdp_main.c b/zebra/irdp_main.c index bc85e983e7..816bc85cec 100644 --- a/zebra/irdp_main.c +++ b/zebra/irdp_main.c @@ -315,7 +315,6 @@ void process_solicit(struct interface *ifp) static int irdp_finish(void) { struct vrf *vrf; - struct listnode *node, *nnode; struct interface *ifp; struct zebra_if *zi; struct irdp_interface *irdp; @@ -323,7 +322,7 @@ static int irdp_finish(void) zlog_info("IRDP: Received shutdown notification."); RB_FOREACH (vrf, vrf_id_head, &vrfs_by_id) - for (ALL_LIST_ELEMENTS(vrf->iflist, node, nnode, ifp)) { + RB_FOREACH (ifp, if_name_head, &vrf->ifaces_by_name) { zi = ifp->info; if (!zi) |
