X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Ffib%2Ffib_test.c;h=b74ec337c1f8fa6133a8307047c1c75e57f05fc6;hb=62fe07c8e30a6ac718fe65528592fe6964d753fa;hp=2658eb2781153ce3ee5ccec03e2760c41108432d;hpb=bfe470c04a58bceed5ba1892dd97e1708b700685;p=vpp.git diff --git a/src/vnet/fib/fib_test.c b/src/vnet/fib/fib_test.c index 2658eb27811..b74ec337c1f 100644 --- a/src/vnet/fib/fib_test.c +++ b/src/vnet/fib/fib_test.c @@ -29,6 +29,7 @@ #include #include #include +#include #include @@ -514,6 +515,30 @@ fib_test_validate_lb_v (const load_balance_t *lb, bucket, exp->adj.adj); break; + case FT_LB_MPLS_DISP_O_ADJ: + { + const mpls_disp_dpo_t *mdd; + + FIB_TEST_I((DPO_MPLS_DISPOSITION == dpo->dpoi_type), + "bucket %d stacks on %U", + bucket, + format_dpo_type, dpo->dpoi_type); + + mdd = mpls_disp_dpo_get(dpo->dpoi_index); + + dpo = &mdd->mdd_dpo; + + FIB_TEST_I(((DPO_ADJACENCY == dpo->dpoi_type) || + (DPO_ADJACENCY_INCOMPLETE == dpo->dpoi_type)), + "bucket %d stacks on %U", + bucket, + format_dpo_type, dpo->dpoi_type); + FIB_TEST_LB((exp->adj.adj == dpo->dpoi_index), + "bucket %d stacks on adj %d", + bucket, + exp->adj.adj); + break; + } case FT_LB_INTF: FIB_TEST_I((DPO_INTERFACE_RX == dpo->dpoi_type), "bucket %d stacks on %U", @@ -6380,6 +6405,12 @@ fib_test_label (void) .fp_label = 24001, .fp_eos = MPLS_NON_EOS, }; + fib_test_lb_bucket_t disp_o_10_10_11_1 = { + .type = FT_LB_MPLS_DISP_O_ADJ, + .adj = { + .adj = ai_v4_10_10_11_1, + }, + }; /* * The EOS entry should link to both the paths, @@ -6393,10 +6424,10 @@ fib_test_label (void) FIB_FORW_CHAIN_TYPE_MPLS_EOS, 2, &l99_eos_o_10_10_10_1, - &a_o_10_10_11_1), + &disp_o_10_10_11_1), "24001/eos LB 2 buckets via: " "label 99 over 10.10.10.1, " - "adj over 10.10.11.1"); + "mpls disp adj over 10.10.11.1"); fei = fib_table_lookup(MPLS_FIB_DEFAULT_TABLE_ID, @@ -6419,6 +6450,13 @@ fib_test_label (void) .adj = ai_v4_10_10_11_2, }, }; + fib_test_lb_bucket_t disp_o_10_10_11_2 = { + .type = FT_LB_MPLS_DISP_O_ADJ, + .adj = { + .adj = ai_v4_10_10_11_2, + }, + }; + fei = fib_table_entry_path_add(fib_index, &pfx_1_1_1_1_s_32, @@ -6567,11 +6605,11 @@ fib_test_label (void) FIB_TEST(fib_test_validate_entry(fei, FIB_FORW_CHAIN_TYPE_MPLS_EOS, 2, - &a_o_10_10_11_1, - &adj_o_10_10_11_2), + &disp_o_10_10_11_1, + &disp_o_10_10_11_2), "24001/eos LB 2 buckets via: " - "adj over 10.10.11.1, ", - "adj-v4 over 10.10.11.2"); + "mpls-disp adj over 10.10.11.1, ", + "mpls-disp adj-v4 over 10.10.11.2"); fei = fib_table_lookup(MPLS_FIB_DEFAULT_TABLE_ID, &pfx_24001_neos); @@ -6644,20 +6682,20 @@ fib_test_label (void) &l99_eos_o_10_10_10_1, &l99_eos_o_10_10_10_1, &l99_eos_o_10_10_10_1, - &a_o_10_10_11_1, - &a_o_10_10_11_1, - &a_o_10_10_11_1, - &a_o_10_10_11_1, - &a_o_10_10_11_1, - &adj_o_10_10_11_2, - &adj_o_10_10_11_2, - &adj_o_10_10_11_2, - &adj_o_10_10_11_2, - &adj_o_10_10_11_2), + &disp_o_10_10_11_1, + &disp_o_10_10_11_1, + &disp_o_10_10_11_1, + &disp_o_10_10_11_1, + &disp_o_10_10_11_1, + &disp_o_10_10_11_2, + &disp_o_10_10_11_2, + &disp_o_10_10_11_2, + &disp_o_10_10_11_2, + &disp_o_10_10_11_2), "24001/eos LB 16 buckets via: " "label 99 over 10.10.10.1, " - "adj over 10.10.11.1", - "adj-v4 over 10.10.11.2"); + "MPLS disp adj over 10.10.11.1", + "MPLS disp adj-v4 over 10.10.11.2"); fei = fib_table_lookup(MPLS_FIB_DEFAULT_TABLE_ID, &pfx_24001_neos); @@ -6698,11 +6736,11 @@ fib_test_label (void) FIB_TEST(fib_test_validate_entry(fei, FIB_FORW_CHAIN_TYPE_MPLS_EOS, 2, - &a_o_10_10_11_1, - &adj_o_10_10_11_2), + &disp_o_10_10_11_1, + &disp_o_10_10_11_2), "24001/eos LB 2 buckets via: " - "adj over 10.10.11.1, " - "adj-v4 over 10.10.11.2"); + "MPLS disp adj over 10.10.11.1, " + "MPLS disp adj-v4 over 10.10.11.2"); fei = fib_table_lookup(MPLS_FIB_DEFAULT_TABLE_ID, &pfx_24001_neos); @@ -6750,9 +6788,9 @@ fib_test_label (void) FIB_TEST(fib_test_validate_entry(fei, FIB_FORW_CHAIN_TYPE_MPLS_EOS, 1, - &adj_o_10_10_11_2), + &disp_o_10_10_11_2), "24001/eos LB 1 buckets via: " - "adj over 10.10.11.2"); + "MPLS disp adj over 10.10.11.2"); fei = fib_table_lookup(MPLS_FIB_DEFAULT_TABLE_ID, &pfx_24001_neos); @@ -6796,10 +6834,10 @@ fib_test_label (void) FIB_FORW_CHAIN_TYPE_MPLS_EOS, 2, &l99_eos_o_10_10_10_1, - &adj_o_10_10_11_2), + &disp_o_10_10_11_2), "24001/eos LB 2 buckets via: " "label 99 over 10.10.10.1, " - "adj over 10.10.11.2"); + "MPLS disp adj over 10.10.11.2"); fei = fib_table_lookup(MPLS_FIB_DEFAULT_TABLE_ID, &pfx_24001_neos); @@ -6841,10 +6879,10 @@ fib_test_label (void) FIB_FORW_CHAIN_TYPE_MPLS_EOS, 2, &l99_eos_o_10_10_10_1, - &adj_o_10_10_11_2), + &disp_o_10_10_11_2), "25005/eos LB 2 buckets via: " "label 99 over 10.10.10.1, " - "adj over 10.10.11.2"); + "MPLS disp adj over 10.10.11.2"); fei = fib_table_lookup(MPLS_FIB_DEFAULT_TABLE_ID, &pfx_25005_neos);