aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/gre
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/gre
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/gre')
-rw-r--r--src/vnet/gre/gre.api2
-rw-r--r--src/vnet/gre/gre.c14
2 files changed, 13 insertions, 3 deletions
diff --git a/src/vnet/gre/gre.api b/src/vnet/gre/gre.api
index f4e025394b3..9c69ba4007d 100644
--- a/src/vnet/gre/gre.api
+++ b/src/vnet/gre/gre.api
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-option version = "2.1.0";
+option version = "2.1.1";
import "vnet/interface_types.api";
import "vnet/tunnel/tunnel_types.api";
diff --git a/src/vnet/gre/gre.c b/src/vnet/gre/gre.c
index 5b102ae3992..d842d688603 100644
--- a/src/vnet/gre/gre.c
+++ b/src/vnet/gre/gre.c
@@ -410,7 +410,11 @@ gre_update_adj (vnet_main_t * vnm, u32 sw_if_index, adj_index_t ai)
ti = gm->tunnel_index_by_sw_if_index[sw_if_index];
t = pool_elt_at_index (gm->tunnels, ti);
- 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;
@@ -429,12 +433,18 @@ adj_walk_rc_t
mgre_mk_complete_walk (adj_index_t ai, void *data)
{
mgre_walk_ctx_t *ctx = data;
+ adj_flags_t 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, gre_get_fixup (ctx->t->tunnel_dst.fp_proto,
adj_get_link_type (ai)),
uword_to_pointer (ctx->t->flags, void *),
- ADJ_FLAG_MIDCHAIN_IP_STACK,
+ af,
gre_build_rewrite (vnet_get_main (),
ctx->t->sw_if_index,
adj_get_link_type (ai),