diff options
author | Renato Westphal <renato@opensourcerouting.org> | 2017-10-03 03:06:04 +0200 |
---|---|---|
committer | Renato Westphal <renato@opensourcerouting.org> | 2017-10-10 14:05:02 +0200 |
commit | ff880b78ef2d480b381d29487812279d57c0bbac (patch) | |
tree | 6c3996876d32ec10973145aba99aecf514a017ba /ripd | |
parent | *: eliminate IFINDEX_DELETED in favor of IFINDEX_INTERNAL (diff) | |
download | frr-ff880b78ef2d480b381d29487812279d57c0bbac.tar.xz frr-ff880b78ef2d480b381d29487812279d57c0bbac.zip |
*: 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>
Diffstat (limited to 'ripd')
-rw-r--r-- | ripd/rip_interface.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ripd/rip_interface.c b/ripd/rip_interface.c index 6fba0512e..21950c9f2 100644 --- a/ripd/rip_interface.c +++ b/ripd/rip_interface.c @@ -471,7 +471,7 @@ int rip_interface_delete(int command, struct zclient *zclient, /* To support pseudo interface do not free interface structure. */ /* if_delete(ifp); */ - ifp->ifindex = IFINDEX_INTERNAL; + if_set_index(ifp, IFINDEX_INTERNAL); return 0; } |