X-Git-Url: https://gerrit.fd.io/r/gitweb?p=vpp.git;a=blobdiff_plain;f=src%2Fvnet%2Ffib%2Ffib_test.c;h=2658eb2781153ce3ee5ccec03e2760c41108432d;hp=66a38236216de558ba8a2453edd18e7c9bf5a750;hb=d792d9c01e60656cbfe1b0f1fd6a9b125f5dab0c;hpb=a2ff7b8cfc829ffbb6d5de7534efb51f7cba9cf3 diff --git a/src/vnet/fib/fib_test.c b/src/vnet/fib/fib_test.c index 66a38236216..2658eb27811 100644 --- a/src/vnet/fib/fib_test.c +++ b/src/vnet/fib/fib_test.c @@ -13,6 +13,7 @@ * limitations under the License. */ +#include #include #include #include @@ -544,21 +545,60 @@ fib_test_validate_lb_v (const load_balance_t *lb, dpo->dpoi_index, exp->lb.lb); break; - case FT_LB_SPECIAL: - FIB_TEST_I((DPO_DROP == dpo->dpoi_type), - "bucket %d stacks on %U", - bucket, - format_dpo_type, dpo->dpoi_type); - FIB_TEST_LB((exp->special.adj == dpo->dpoi_index), - "bucket %d stacks on drop %d", + case FT_LB_BIER_TABLE: + FIB_TEST_LB((DPO_BIER_TABLE == dpo->dpoi_type), + "bucket %d stacks on %U", + bucket, + format_dpo_type, dpo->dpoi_type); + FIB_TEST_LB((exp->bier.table == dpo->dpoi_index), + "bucket %d stacks on lb %d", + bucket, + exp->bier.table); + break; + case FT_LB_BIER_FMASK: + FIB_TEST_LB((DPO_BIER_FMASK == dpo->dpoi_type), + "bucket %d stacks on %U", + bucket, + format_dpo_type, dpo->dpoi_type); + FIB_TEST_LB((exp->bier.fmask == dpo->dpoi_index), + "bucket %d stacks on lb %d", bucket, - exp->special.adj); + exp->bier.fmask); + break; + case FT_LB_DROP: + FIB_TEST_LB((DPO_DROP == dpo->dpoi_type), + "bucket %d stacks on %U", + bucket, + format_dpo_type, dpo->dpoi_type); break; } } return (!0); } +int +fib_test_validate_lb (const dpo_id_t *dpo, + u16 n_buckets, + ...) +{ + const load_balance_t *lb; + va_list ap; + int res; + + va_start(ap, n_buckets); + + FIB_TEST_LB((DPO_LOAD_BALANCE == dpo->dpoi_type), + "Entry links to %U", + format_dpo_type, dpo->dpoi_type); + lb = load_balance_get(dpo->dpoi_index); + + res = fib_test_validate_lb_v(lb, n_buckets, &ap); + + va_end(ap); + + return (res); +} + int fib_test_validate_entry (fib_node_index_t fei, fib_forward_chain_type_t fct, @@ -6678,13 +6718,10 @@ fib_test_label (void) * remove the other path with a valid label */ fib_test_lb_bucket_t bucket_drop = { - .type = FT_LB_SPECIAL, - .special = { - .adj = DPO_PROTO_IP4, - }, + .type = FT_LB_DROP, }; fib_test_lb_bucket_t mpls_bucket_drop = { - .type = FT_LB_SPECIAL, + .type = FT_LB_DROP, .special = { .adj = DPO_PROTO_MPLS, }, @@ -8497,13 +8534,13 @@ lfib_test (void) * A recursive via a label that does not exist */ fib_test_lb_bucket_t bucket_drop = { - .type = FT_LB_SPECIAL, + .type = FT_LB_DROP, .special = { .adj = DPO_PROTO_IP4, }, }; fib_test_lb_bucket_t mpls_bucket_drop = { - .type = FT_LB_SPECIAL, + .type = FT_LB_DROP, .special = { .adj = DPO_PROTO_MPLS, },