diff options
author | Neale Ranns <neale@graphiant.com> | 2021-08-06 13:12:00 +0000 |
---|---|---|
committer | Ole Tr�an <otroan@employees.org> | 2021-08-11 08:48:42 +0000 |
commit | 7244a706430746facf20a5f047666b74d440cef8 (patch) | |
tree | b6fe66ee36220d55639bdb81262daefadd323fc5 /src/vnet/fib | |
parent | 6bb2db0ea860812d9c366935312e7849deca9c93 (diff) |
ip: [re]introduce the 8-8-8-8 stride MTRIE
Type: improvement
there's a time-space trade-off between the 16-8-8 and 8-8-8-8 stride.
FIB continues to use the 16-8-8. Other features are now free to make the
choice.
Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: I6691a163486ce62e75e629f6ef0c990f253df8e5
Diffstat (limited to 'src/vnet/fib')
-rw-r--r-- | src/vnet/fib/ip4_fib.h | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/vnet/fib/ip4_fib.h b/src/vnet/fib/ip4_fib.h index 1f0c168eff3..46bfcaf85f1 100644 --- a/src/vnet/fib/ip4_fib.h +++ b/src/vnet/fib/ip4_fib.h @@ -166,8 +166,8 @@ ip4_fib_forwarding_lookup (u32 fib_index, mtrie = &ip4_fib_get(fib_index)->mtrie; leaf = ip4_mtrie_16_lookup_step_one (mtrie, addr); - leaf = ip4_mtrie_16_lookup_step (mtrie, leaf, addr, 2); - leaf = ip4_mtrie_16_lookup_step (mtrie, leaf, addr, 3); + leaf = ip4_mtrie_16_lookup_step (leaf, addr, 2); + leaf = ip4_mtrie_16_lookup_step (leaf, addr, 3); return (ip4_mtrie_leaf_get_adj_index(leaf)); } @@ -188,10 +188,10 @@ ip4_fib_forwarding_lookup_x2 (u32 fib_index0, leaf[0] = ip4_mtrie_16_lookup_step_one (mtrie[0], addr0); leaf[1] = ip4_mtrie_16_lookup_step_one (mtrie[1], addr1); - leaf[0] = ip4_mtrie_16_lookup_step (mtrie[0], leaf[0], addr0, 2); - leaf[1] = ip4_mtrie_16_lookup_step (mtrie[1], leaf[1], addr1, 2); - leaf[0] = ip4_mtrie_16_lookup_step (mtrie[0], leaf[0], addr0, 3); - leaf[1] = ip4_mtrie_16_lookup_step (mtrie[1], leaf[1], addr1, 3); + leaf[0] = ip4_mtrie_16_lookup_step (leaf[0], addr0, 2); + leaf[1] = ip4_mtrie_16_lookup_step (leaf[1], addr1, 2); + leaf[0] = ip4_mtrie_16_lookup_step (leaf[0], addr0, 3); + leaf[1] = ip4_mtrie_16_lookup_step (leaf[1], addr1, 3); *lb0 = ip4_mtrie_leaf_get_adj_index(leaf[0]); *lb1 = ip4_mtrie_leaf_get_adj_index(leaf[1]); @@ -224,15 +224,15 @@ ip4_fib_forwarding_lookup_x4 (u32 fib_index0, leaf[2] = ip4_mtrie_16_lookup_step_one (mtrie[2], addr2); leaf[3] = ip4_mtrie_16_lookup_step_one (mtrie[3], addr3); - leaf[0] = ip4_mtrie_16_lookup_step (mtrie[0], leaf[0], addr0, 2); - leaf[1] = ip4_mtrie_16_lookup_step (mtrie[1], leaf[1], addr1, 2); - leaf[2] = ip4_mtrie_16_lookup_step (mtrie[2], leaf[2], addr2, 2); - leaf[3] = ip4_mtrie_16_lookup_step (mtrie[3], leaf[3], addr3, 2); + leaf[0] = ip4_mtrie_16_lookup_step (leaf[0], addr0, 2); + leaf[1] = ip4_mtrie_16_lookup_step (leaf[1], addr1, 2); + leaf[2] = ip4_mtrie_16_lookup_step (leaf[2], addr2, 2); + leaf[3] = ip4_mtrie_16_lookup_step (leaf[3], addr3, 2); - leaf[0] = ip4_mtrie_16_lookup_step (mtrie[0], leaf[0], addr0, 3); - leaf[1] = ip4_mtrie_16_lookup_step (mtrie[1], leaf[1], addr1, 3); - leaf[2] = ip4_mtrie_16_lookup_step (mtrie[2], leaf[2], addr2, 3); - leaf[3] = ip4_mtrie_16_lookup_step (mtrie[3], leaf[3], addr3, 3); + leaf[0] = ip4_mtrie_16_lookup_step (leaf[0], addr0, 3); + leaf[1] = ip4_mtrie_16_lookup_step (leaf[1], addr1, 3); + leaf[2] = ip4_mtrie_16_lookup_step (leaf[2], addr2, 3); + leaf[3] = ip4_mtrie_16_lookup_step (leaf[3], addr3, 3); *lb0 = ip4_mtrie_leaf_get_adj_index(leaf[0]); *lb1 = ip4_mtrie_leaf_get_adj_index(leaf[1]); |