diff options
author | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2022-02-03 06:08:51 +0100 |
---|---|---|
committer | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2022-02-06 23:27:13 +0100 |
commit | de6318f70a06854a324b436b3a4cca0b3d60024b (patch) | |
tree | 680bbcdeaa2ade01e09254579aa0dea3dbdaef28 /nest/route.h | |
parent | ba5aec94cdf643350677f6b0ac4d335039c22396 (diff) |
Nest: Implement prefix trie pruning
When rtable is pruned and network fib nodes are removed, we also need to
prune prefix trie. Unfortunately, rebuilding prefix trie takes long time
(got about 400 ms for 1M networks), so must not be atomic, we have to
rebuild a new trie while current one is still active. That may require
some considerable amount of temporary memory, so we do that only if
we expect significant trie size reduction.
Diffstat (limited to 'nest/route.h')
-rw-r--r-- | nest/route.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/nest/route.h b/nest/route.h index 102ea0ea..c4e0d2c6 100644 --- a/nest/route.h +++ b/nest/route.h @@ -185,10 +185,12 @@ typedef struct rtable { btime gc_time; /* Time of last GC */ int gc_counter; /* Number of operations since last GC */ byte prune_state; /* Table prune state, 1 -> scheduled, 2-> running */ + byte prune_trie; /* Prune prefix trie during next table prune */ byte hcu_scheduled; /* Hostcache update is scheduled */ byte nhu_state; /* Next Hop Update state */ struct fib_iterator prune_fit; /* Rtable prune FIB iterator */ struct fib_iterator nhu_fit; /* Next Hop Update FIB iterator */ + struct f_trie *trie_new; /* New prefix trie defined during pruning */ list subscribers; /* Subscribers for notifications */ struct timer *settle_timer; /* Settle time for notifications */ |