summaryrefslogtreecommitdiff
path: root/pimd/pim_vty.c
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2017-10-02 22:06:01 -0300
committerRenato Westphal <renato@opensourcerouting.org>2017-10-10 09:05:02 -0300
commitf4e14fdba7de19ca660278a0b8c750140db5868b (patch)
tree58eb2d22e84b24672ddff1dd786f18e5bc555b15 /pimd/pim_vty.c
parent5d56066e4645ce1104f766cb2a2b767b483c9ce5 (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 'pimd/pim_vty.c')
-rw-r--r--pimd/pim_vty.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/pimd/pim_vty.c b/pimd/pim_vty.c
index fc377b5a52..9b60e284e8 100644
--- a/pimd/pim_vty.c
+++ b/pimd/pim_vty.c
@@ -240,7 +240,6 @@ int pim_global_config_write(struct vty *vty)
int pim_interface_config_write(struct vty *vty)
{
struct pim_instance *pim;
- struct listnode *node;
struct interface *ifp;
struct vrf *vrf;
int writes = 0;
@@ -250,8 +249,7 @@ int pim_interface_config_write(struct vty *vty)
if (!pim)
continue;
- for (ALL_LIST_ELEMENTS_RO(vrf_iflist(pim->vrf_id), node, ifp)) {
-
+ RB_FOREACH (ifp, if_name_head, &pim->vrf->ifaces_by_name) {
/* IF name */
if (vrf->vrf_id == VRF_DEFAULT)
vty_frame(vty, "interface %s\n", ifp->name);