diff options
author | Mohammed Hawari <mohammed@hawari.fr> | 2020-11-30 13:50:24 +0100 |
---|---|---|
committer | Neale Ranns <nranns@cisco.com> | 2020-12-09 08:40:50 +0000 |
commit | 33c45f56ab391ab13a42eb4ec2ac2b97b9fc546a (patch) | |
tree | 999c08ca61c4332e098db89d3bcab455a217ffa5 /src/vnet/ipip | |
parent | 027d813a509be0f30e05b48b888007b0094e4faf (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')
-rw-r--r-- | src/vnet/ipip/ipip.api | 2 | ||||
-rw-r--r-- | src/vnet/ipip/ipip.c | 20 |
2 files changed, 15 insertions, 7 deletions
diff --git a/src/vnet/ipip/ipip.api b/src/vnet/ipip/ipip.api index 4fbfa1d584e..2740a51aae1 100644 --- a/src/vnet/ipip/ipip.api +++ b/src/vnet/ipip/ipip.api @@ -49,7 +49,7 @@ * */ -option version = "2.0.1"; +option version = "2.0.2"; import "vnet/interface_types.api"; import "vnet/ip/ip_types.api"; 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); |