X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Ffib%2Ffib_path_list.c;h=ebd2c0e9be146d580a80574688060f0b7a1f80a1;hb=4561d6d251844b504a024d569de8d876203047ac;hp=df08bb2b0d05bb536b36f63b646251174879651b;hpb=da33105973e5f98d9c0daf8e107299d6a278d146;p=vpp.git diff --git a/src/vnet/fib/fib_path_list.c b/src/vnet/fib/fib_path_list.c index df08bb2b0d0..ebd2c0e9be1 100644 --- a/src/vnet/fib/fib_path_list.c +++ b/src/vnet/fib/fib_path_list.c @@ -378,8 +378,10 @@ fib_path_list_mk_lb (fib_path_list_t *path_list, if ((flags & FIB_PATH_LIST_FWD_FLAG_STICKY) || fib_path_is_resolved(*path_index)) { - nhs = fib_path_append_nh_for_multipath_hash(*path_index, - fct, nhs); + nhs = fib_path_append_nh_for_multipath_hash( + *path_index, fct, + fib_forw_chain_type_to_dpo_proto(fct), + nhs); } } @@ -962,8 +964,7 @@ fib_path_list_copy_and_path_add (fib_node_index_t orig_path_list_index, } if (duplicate) { - _vec_len(path_list->fpl_paths) = - vec_len(path_list->fpl_paths) - 1; + vec_set_len(path_list->fpl_paths, vec_len(path_list->fpl_paths) - 1); fib_path_destroy(new_path_index); } else @@ -1297,22 +1298,15 @@ fib_path_list_child_add (fib_node_index_t path_list_index, fib_node_type_t child_type, fib_node_index_t child_index) { - u32 sibling; - - sibling = fib_node_child_add(FIB_NODE_TYPE_PATH_LIST, - path_list_index, - child_type, - child_index); - - if (FIB_PATH_LIST_POPULAR == fib_node_get_n_children(FIB_NODE_TYPE_PATH_LIST, - path_list_index)) + if (FIB_PATH_LIST_POPULAR - 1 == fib_node_get_n_children(FIB_NODE_TYPE_PATH_LIST, + path_list_index)) { /* * Set the popular flag on the path-list once we pass the magic * threshold. then walk children to update. * We don't undo this action. The rational being that the number * of entries using this prefix is large enough such that it is a - * non-trivial amount of effort to converge them. If we get into the + * non-trival amount of effort to converge them. If we get into the * situation where we are adding and removing entries such that we * flip-flop over the threshold, then this non-trivial work is added * to each of those routes adds/deletes - not a situation we want. @@ -1328,7 +1322,10 @@ fib_path_list_child_add (fib_node_index_t path_list_index, fib_walk_sync(FIB_NODE_TYPE_PATH_LIST, path_list_index, &ctx); } - return (sibling); + return (fib_node_child_add(FIB_NODE_TYPE_PATH_LIST, + path_list_index, + child_type, + child_index)); } void