]> git.proxmox.com Git - mirror_frr.git/commit - lib/zclient.c
*: introduce new rb-tree to optimize interface lookup by ifindex
authorRenato Westphal <renato@opensourcerouting.org>
Tue, 3 Oct 2017 01:06:04 +0000 (22:06 -0300)
committerRenato Westphal <renato@opensourcerouting.org>
Tue, 10 Oct 2017 12:05:02 +0000 (09:05 -0300)
commitff880b78ef2d480b381d29487812279d57c0bbac
tree6c3996876d32ec10973145aba99aecf514a017ba
parent8928a08f657948c5d04807de399b89051ae54d88
*: introduce new rb-tree to optimize interface lookup by ifindex

Performance tests showed that, when running on a system with a large
number of interfaces, some daemons would spend a considerable amount
of time in the if_lookup_by_index() function. Introduce a new rb-tree
to solve this problem.

With this change, we need to use the if_set_index() function whenever
we want to change the ifindex of an interface. This is necessary to
ensure that the 'ifaces_by_index' rb-tree is updated accordingly. The
return value of all insert/remove operations in the interface rb-trees
is checked to ensure that an error is logged if a corruption is
detected.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
20 files changed:
babeld/babel_interface.c
bgpd/bgp_zebra.c
eigrpd/eigrp_zebra.c
isisd/isis_zebra.c
ldpd/ldp_zebra.c
lib/if.c
lib/if.h
lib/vrf.c
lib/vrf.h
lib/zclient.c
nhrpd/nhrp_interface.c
ospf6d/ospf6_zebra.c
ospfd/ospf_zebra.c
ripd/rip_interface.c
ripngd/ripng_interface.c
zebra/if_ioctl.c
zebra/if_ioctl_solaris.c
zebra/if_netlink.c
zebra/interface.c
zebra/kernel_socket.c