X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Ffib%2Ffib_table.c;h=f63edaa76f06dd8fef05b3b26848e9cb519f998e;hb=c5d4317ad0425d01893dbb4afad9f16c2cde077d;hp=e9173484dec8638484bf540b804af104177f36a9;hpb=53da221b13225695516ec7469ca29d82bb10e594;p=vpp.git diff --git a/src/vnet/fib/fib_table.c b/src/vnet/fib/fib_table.c index e9173484dec..f63edaa76f0 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); + } } } @@ -520,7 +528,7 @@ fib_table_entry_path_add (u32 fib_index, u32 next_hop_sw_if_index, u32 next_hop_fib_index, u32 next_hop_weight, - mpls_label_t *next_hop_labels, + fib_mpls_label_t *next_hop_labels, fib_route_path_flags_t path_flags) { fib_route_path_t path = { @@ -770,7 +778,7 @@ fib_table_entry_update_one_path (u32 fib_index, u32 next_hop_sw_if_index, u32 next_hop_fib_index, u32 next_hop_weight, - mpls_label_t *next_hop_labels, + fib_mpls_label_t *next_hop_labels, fib_route_path_flags_t path_flags) { fib_node_index_t fib_entry_index; @@ -869,12 +877,12 @@ 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); } fib_node_index_t @@ -1033,6 +1041,17 @@ fib_table_get_table_id_for_sw_if_index (fib_protocol_t proto, return ((NULL != fib_table ? fib_table->ft_table_id : ~0)); } +u32 +fib_table_get_table_id (u32 fib_index, + fib_protocol_t proto) +{ + fib_table_t *fib_table; + + fib_table = fib_table_get(fib_index, proto); + + return ((NULL != fib_table ? fib_table->ft_table_id : ~0)); +} + u32 fib_table_find (fib_protocol_t proto, u32 table_id)