summaryrefslogtreecommitdiffstats
path: root/src/plugins/unittest/fib_test.c
diff options
context:
space:
mode:
authorNeale Ranns <neale@graphiant.com>2020-12-21 08:29:34 +0000
committerOle Tr�an <otroan@employees.org>2021-02-15 17:27:48 +0000
commit8f5fef2c78b95de1a636ce27111722b71702212a (patch)
treea0ebd0189969ccae1f0bdd7c1a9c18dd7a066f2e /src/plugins/unittest/fib_test.c
parent54be0cc044f445853fae7b8995c477605250af16 (diff)
ip: Path MTU
Type: feature Support setting the MTU for a peer on an interface. The minimum value of the path and interface MTU is used at forwarding time. the path MTU is specified for a given peer, by address and table-ID. In the forwarding plane the MTU is enfored either: 1 - if the peer is attached, then the MTU is set on the peer's adjacency 2 - if the peer is not attached, it is remote, then a DPO is added to the peer's FIB entry to perform the necessary fragmentation. Signed-off-by: Neale Ranns <neale@graphiant.com> Change-Id: I8b9ea6a07868b50e97e2561f18d9335407dea7ae
Diffstat (limited to 'src/plugins/unittest/fib_test.c')
-rw-r--r--src/plugins/unittest/fib_test.c30
1 files changed, 26 insertions, 4 deletions
diff --git a/src/plugins/unittest/fib_test.c b/src/plugins/unittest/fib_test.c
index b9b77ba479f..c6291fb2658 100644
--- a/src/plugins/unittest/fib_test.c
+++ b/src/plugins/unittest/fib_test.c
@@ -5869,10 +5869,14 @@ fib_test_ae (void)
static int
fib_test_pref (void)
{
- test_main_t *tm = &test_main;
- int res;
+ test_main_t *tm;
+ ip4_main_t *im;
+ int res, i;
+ tm = &test_main;
+ im = &ip4_main;
res = 0;
+
const fib_prefix_t pfx_1_1_1_1_s_32 = {
.fp_len = 32,
.fp_proto = FIB_PROTOCOL_IP4,
@@ -5883,6 +5887,11 @@ fib_test_pref (void)
},
};
+ vec_validate(im->fib_index_by_sw_if_index, tm->hw[2]->sw_if_index);
+
+ for (i = 0; i <= 2; i++)
+ im->fib_index_by_sw_if_index[tm->hw[i]->sw_if_index] = 0;
+
/*
* 2 high, 2 medium and 2 low preference non-recursive paths
*/
@@ -9049,12 +9058,25 @@ static int
fib_test_inherit (void)
{
fib_node_index_t fei;
+ int n_feis, res, i;
test_main_t *tm;
- int n_feis, res;
+ ip4_main_t *im4;
+ ip6_main_t *im6;
+ tm = &test_main;
+ im4 = &ip4_main;
+ im6 = &ip6_main;
res = 0;
+
+ vec_validate(im4->fib_index_by_sw_if_index, tm->hw[2]->sw_if_index);
+ vec_validate(im6->fib_index_by_sw_if_index, tm->hw[2]->sw_if_index);
+
+ for (i = 0; i <= 2; i++)
+ {
+ im4->fib_index_by_sw_if_index[tm->hw[i]->sw_if_index] = 0;
+ im6->fib_index_by_sw_if_index[tm->hw[i]->sw_if_index] = 0;
+ }
n_feis = fib_entry_pool_size();
- tm = &test_main;
const ip46_address_t nh_10_10_10_1 = {
.ip4.as_u32 = clib_host_to_net_u32(0x0a0a0a01),