diff options
author | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-05-17 01:24:22 +0200 |
---|---|---|
committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-05-17 14:01:24 +0200 |
commit | 5e1b0650de10973decb57385b02e0a0b7d5045d0 (patch) | |
tree | bd2a636e74b3859b32ca4d971cd1c6cf4d9839e4 /zebra/zebra_vxlan_private.h | |
parent | Merge pull request #2200 from qlyoung/docuser-gettingstarted (diff) | |
download | frr-5e1b0650de10973decb57385b02e0a0b7d5045d0.tar.xz frr-5e1b0650de10973decb57385b02e0a0b7d5045d0.zip |
zebra: Convert zrmac->host_list list to a RB Tree
The host_list when we attempt to use it at scale, ends
up spending a non-trivial amount of time finding and
sorting entries for the host list. Convert to a rb tree.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'zebra/zebra_vxlan_private.h')
-rw-r--r-- | zebra/zebra_vxlan_private.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/zebra/zebra_vxlan_private.h b/zebra/zebra_vxlan_private.h index b4a8b5d48..c5f6b783a 100644 --- a/zebra/zebra_vxlan_private.h +++ b/zebra/zebra_vxlan_private.h @@ -215,6 +215,15 @@ static inline void zl3vni_get_rmac(zebra_l3vni_t *zl3vni, struct ethaddr *rmac) memcpy(rmac->octet, zl3vni->svi_if->hw_addr, ETH_ALEN); } +struct host_rb_entry { + RB_ENTRY(host_rb_entry) hl_entry; + + struct prefix p; +}; + +RB_HEAD(host_rb_entry_rb, host_rb_entry); +RB_PROTOTYPE(host_rb_entry_rb, host_rb_entry, hl_entry, + host_rb_entry_compare); /* * MAC hash table. * @@ -253,7 +262,7 @@ struct zebra_mac_t_ { struct list *neigh_list; /* list of hosts pointing to this remote RMAC */ - struct list *host_list; + struct host_rb_entry_rb host_rb; }; /* |