X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Ffib%2Ffib_table.c;h=324a35fe1e8c5291d1a62a2cdfa8aa12ef01953d;hb=31ed744;hp=d5625d836739e79022231801d8d0b5d9d726a87f;hpb=6f6311560380d0e992f710558e213df1b098ef94;p=vpp.git diff --git a/src/vnet/fib/fib_table.c b/src/vnet/fib/fib_table.c index d5625d83673..324a35fe1e8 100644 --- a/src/vnet/fib/fib_table.c +++ b/src/vnet/fib/fib_table.c @@ -181,8 +181,7 @@ fib_table_post_insert_actions (fib_table_t *fib_table, return; /* - * find and inform the covering entry that a new more specific - * has been inserted beneath it + * find the covering entry */ fib_entry_cover_index = fib_table_get_less_specific_i(fib_table, prefix); /* @@ -190,6 +189,16 @@ fib_table_post_insert_actions (fib_table_t *fib_table, */ if (fib_entry_cover_index != fib_entry_index) { + /* + * push any inherting sources from the cover onto the covered + */ + fib_entry_inherit(fib_entry_cover_index, + fib_entry_index); + + /* + * inform the covering entry that a new more specific + * has been inserted beneath it + */ fib_entry_cover_change_notify(fib_entry_cover_index, fib_entry_index); } @@ -511,7 +520,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 = { @@ -761,7 +770,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; @@ -953,6 +962,7 @@ fib_table_get_flow_hash_config (u32 fib_index, return (fib->ft_flow_hash_config); } + flow_hash_config_t fib_table_get_default_flow_hash_config (fib_protocol_t proto) { @@ -981,7 +991,7 @@ typedef struct fib_table_set_flow_hash_config_ctx_t_ flow_hash_config_t hash_config; } fib_table_set_flow_hash_config_ctx_t; -static int +static fib_table_walk_rc_t fib_table_set_flow_hash_config_cb (fib_node_index_t fib_entry_index, void *arg) { @@ -989,7 +999,7 @@ fib_table_set_flow_hash_config_cb (fib_node_index_t fib_entry_index, fib_entry_set_flow_hash_config(fib_entry_index, ctx->hash_config); - return (1); + return (FIB_TABLE_WALK_CONTINUE); } void @@ -1119,7 +1129,7 @@ fib_table_create_and_lock (fib_protocol_t proto, fi = ip4_fib_table_create_and_lock(src); break; case FIB_PROTOCOL_IP6: - fi = ip6_fib_table_create_and_lock(src); + fi = ip6_fib_table_create_and_lock(src, FIB_TABLE_FLAG_NONE, NULL); break; case FIB_PROTOCOL_MPLS: fi = mpls_fib_table_create_and_lock(src); @@ -1175,6 +1185,26 @@ fib_table_walk (u32 fib_index, } } +void +fib_table_sub_tree_walk (u32 fib_index, + fib_protocol_t proto, + const fib_prefix_t *root, + fib_table_walk_fn_t fn, + void *ctx) +{ + switch (proto) + { + case FIB_PROTOCOL_IP4: + ip4_fib_table_sub_tree_walk(ip4_fib_get(fib_index), root, fn, ctx); + break; + case FIB_PROTOCOL_IP6: + ip6_fib_table_sub_tree_walk(fib_index, root, fn, ctx); + break; + case FIB_PROTOCOL_MPLS: + break; + } +} + void fib_table_unlock (u32 fib_index, fib_protocol_t proto, @@ -1259,7 +1289,7 @@ typedef struct fib_table_flush_ctx_t_ fib_source_t ftf_source; } fib_table_flush_ctx_t; -static int +static fib_table_walk_rc_t fib_table_flush_cb (fib_node_index_t fib_entry_index, void *arg) { @@ -1269,7 +1299,7 @@ fib_table_flush_cb (fib_node_index_t fib_entry_index, { vec_add1(ctx->ftf_entries, fib_entry_index); } - return (1); + return (FIB_TABLE_WALK_CONTINUE); } @@ -1295,3 +1325,13 @@ fib_table_flush (u32 fib_index, vec_free(ctx.ftf_entries); } + +u8 * +format_fib_table_memory (u8 *s, va_list *args) +{ + s = format(s, "%U", format_ip4_fib_table_memory); + s = format(s, "%U", format_ip6_fib_table_memory); + s = format(s, "%U", format_mpls_fib_table_memory); + + return (s); +}