diff options
author | Renato Westphal <renato@opensourcerouting.org> | 2017-10-03 03:06:01 +0200 |
---|---|---|
committer | Renato Westphal <renato@opensourcerouting.org> | 2017-10-10 14:05:02 +0200 |
commit | f4e14fdba7de19ca660278a0b8c750140db5868b (patch) | |
tree | 58eb2d22e84b24672ddff1dd786f18e5bc555b15 /lib/vrf.h | |
parent | lib: register 'if_var_handlers' only once (diff) | |
download | frr-f4e14fdba7de19ca660278a0b8c750140db5868b.tar.xz frr-f4e14fdba7de19ca660278a0b8c750140db5868b.zip |
*: 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 'lib/vrf.h')
-rw-r--r-- | lib/vrf.h | 13 |
1 files changed, 2 insertions, 11 deletions
@@ -77,8 +77,8 @@ struct vrf { u_char status; #define VRF_ACTIVE (1 << 0) - /* Master list of interfaces belonging to this VRF */ - struct list *iflist; + /* Interfaces belonging to this VRF */ + struct if_name_head ifaces_by_name; /* User data */ void *info; @@ -127,15 +127,6 @@ extern void *vrf_info_get(vrf_id_t); extern void *vrf_info_lookup(vrf_id_t); /* - * Utilities to obtain the interface list - */ - -/* Look up the interface list of the specified VRF. */ -extern struct list *vrf_iflist(vrf_id_t); -/* Get the interface list of the specified VRF. Create one if not find. */ -extern struct list *vrf_iflist_get(vrf_id_t); - -/* * VRF bit-map: maintaining flags, one bit per VRF ID */ |