aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/ipip/ipip.c
diff options
context:
space:
mode:
authorMohammed Hawari <mohammed@hawari.fr>2020-11-30 13:50:24 +0100
committerNeale Ranns <nranns@cisco.com>2020-12-09 08:40:50 +0000
commit33c45f56ab391ab13a42eb4ec2ac2b97b9fc546a (patch)
tree999c08ca61c4332e098db89d3bcab455a217ffa5 /src/vnet/ipip/ipip.c
parent027d813a509be0f30e05b48b888007b0094e4faf (diff)
fib: supporting inner flow hash on tunnels
Change-Id: I53011e089bfecb08483792029b534b09b9e33a10 Type: improvement Signed-off-by: Mohammed Hawari <mohammed@hawari.fr>
Diffstat (limited to 'src/vnet/ipip/ipip.c')
-rw-r--r--src/vnet/ipip/ipip.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/vnet/ipip/ipip.c b/src/vnet/ipip/ipip.c
index 87aba12ca89..357eb58f160 100644
--- a/src/vnet/ipip/ipip.c
+++ b/src/vnet/ipip/ipip.c
@@ -288,7 +288,11 @@ ipip_update_adj (vnet_main_t * vnm, u32 sw_if_index, adj_index_t ai)
if (!t)
return;
- af = ADJ_FLAG_MIDCHAIN_IP_STACK;
+ if (t->flags & TUNNEL_ENCAP_DECAP_FLAG_ENCAP_INNER_HASH)
+ af = ADJ_FLAG_MIDCHAIN_FIXUP_FLOW_HASH;
+ else
+ af = ADJ_FLAG_MIDCHAIN_IP_STACK;
+
if (VNET_LINK_ETHERNET == adj_get_link_type (ai))
af |= ADJ_FLAG_MIDCHAIN_NO_COUNT;
@@ -317,14 +321,18 @@ mipip_mk_complete_walk (adj_index_t ai, void *data)
af = ADJ_FLAG_NONE;
fixup = ipip_get_fixup (ctx->t, adj_get_link_type (ai), &af);
+ if (ctx->t->flags & TUNNEL_ENCAP_DECAP_FLAG_ENCAP_INNER_HASH)
+ af = ADJ_FLAG_MIDCHAIN_FIXUP_FLOW_HASH;
+ else
+ af = ADJ_FLAG_MIDCHAIN_IP_STACK;
+
adj_nbr_midchain_update_rewrite
(ai, fixup,
uword_to_pointer (ctx->t->flags, void *),
- ADJ_FLAG_MIDCHAIN_IP_STACK, ipip_build_rewrite (vnet_get_main (),
- ctx->t->sw_if_index,
- adj_get_link_type (ai),
- &teib_entry_get_nh
- (ctx->ne)->fp_addr));
+ af, ipip_build_rewrite (vnet_get_main (),
+ ctx->t->sw_if_index,
+ adj_get_link_type (ai),
+ &teib_entry_get_nh (ctx->ne)->fp_addr));
teib_entry_adj_stack (ctx->ne, ai);