X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Ffib%2Ffib_table.c;h=69746d969120e062ddf4834be5ea436c2b6b9919;hb=28c142e3;hp=d0bc33639b982bdb11e6a314ab0069d10857a47a;hpb=25b049484fcf9161edb2c19250066b893c38c264;p=vpp.git diff --git a/src/vnet/fib/fib_table.c b/src/vnet/fib/fib_table.c index d0bc33639b9..69746d96912 100644 --- a/src/vnet/fib/fib_table.c +++ b/src/vnet/fib/fib_table.c @@ -197,10 +197,18 @@ fib_table_post_insert_actions (fib_table_t *fib_table, /* * inform the covering entry that a new more specific - * has been inserted beneath it + * has been inserted beneath it. + * If the prefix that has been inserted is a host route + * then it is not possible that it will be the cover for any + * other entry, so we can elide the walk. This is particularly + * beneficial since there are often many host entries sharing the + * same cover (i.e. ADJ or RR sourced entries). */ - fib_entry_cover_change_notify(fib_entry_cover_index, - fib_entry_index); + if (!fib_entry_is_host(fib_entry_index)) + { + fib_entry_cover_change_notify(fib_entry_cover_index, + fib_entry_index); + } } } @@ -869,12 +877,20 @@ void fib_table_entry_delete_index (fib_node_index_t fib_entry_index, fib_source_t source) { - fib_prefix_t prefix; + const fib_prefix_t *prefix; - fib_entry_get_prefix(fib_entry_index, &prefix); + prefix = fib_entry_get_prefix(fib_entry_index); fib_table_entry_delete_i(fib_entry_get_fib_index(fib_entry_index), - fib_entry_index, &prefix, source); + fib_entry_index, prefix, source); +} + +u32 +fib_table_entry_get_stats_index (u32 fib_index, + const fib_prefix_t *prefix) +{ + return (fib_entry_get_stats_index( + fib_table_lookup_exact_match(fib_index, prefix))); } fib_node_index_t @@ -1253,6 +1269,9 @@ fib_table_lock (u32 fib_index, fib_table_t *fib_table; fib_table = fib_table_get(fib_index, proto); + + ASSERT(fib_table->ft_locks[source] < (0xffff - 1)); + fib_table->ft_locks[source]++; fib_table->ft_locks[FIB_TABLE_TOTAL_LOCKS]++; }