aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/fib/fib_test.c
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2017-10-31 12:28:22 -0700
committerDamjan Marion <dmarion.lists@gmail.com>2017-11-11 14:23:45 +0000
commit62fe07c8e30a6ac718fe65528592fe6964d753fa (patch)
tree21da6b42dbcc372d54c016f8e7cfaf9a0f6a2f70 /src/vnet/fib/fib_test.c
parentbfe470c04a58bceed5ba1892dd97e1708b700685 (diff)
MPLS disposition actions at the tail of unicast LSPs
Change-Id: I8c42e26152f2ed1246f91b789887bfc923418bdf Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src/vnet/fib/fib_test.c')
-rw-r--r--src/vnet/fib/fib_test.c94
1 files changed, 66 insertions, 28 deletions
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 <vnet/dpo/interface_rx_dpo.h>
#include <vnet/dpo/replicate_dpo.h>
#include <vnet/dpo/l2_bridge_dpo.h>
+#include <vnet/dpo/mpls_disposition.h>
#include <vnet/mpls/mpls.h>
@@ -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);