summaryrefslogtreecommitdiffstats
path: root/src/vnet/gre
diff options
context:
space:
mode:
authorNeale Ranns <neale@graphiant.com>2021-02-08 15:24:56 +0000
committerNeale Ranns <neale@graphiant.com>2021-02-15 11:16:22 +0000
commit65d789e4baa0be3086b9dd97e3fdfea35b5f7857 (patch)
tree890f8576c1e89421d67ef801490b6b10414c6432 /src/vnet/gre
parentb00c49ca67bb9ea6290943eb2208cb9e17eb67e0 (diff)
fib: Always honour flow hash flag
Type: fix Signed-off-by: Neale Ranns <neale@graphiant.com> Change-Id: Id7b27edf3712aaa3c277e752b9ca78bb91d184a1
Diffstat (limited to 'src/vnet/gre')
-rw-r--r--src/vnet/gre/gre.c25
1 files changed, 17 insertions, 8 deletions
diff --git a/src/vnet/gre/gre.c b/src/vnet/gre/gre.c
index a355a224ee1..0669c676bf5 100644
--- a/src/vnet/gre/gre.c
+++ b/src/vnet/gre/gre.c
@@ -410,11 +410,15 @@ 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_NONE;
- if (t->flags & TUNNEL_ENCAP_DECAP_FLAG_ENCAP_INNER_HASH)
- af = ADJ_FLAG_MIDCHAIN_FIXUP_FLOW_HASH;
- else
- af = ADJ_FLAG_MIDCHAIN_IP_STACK;
+ /*
+ * the user has not requested that the load-balancing be based on
+ * a flow hash of the inner packet. so use the stacking to choose
+ * a path.
+ */
+ if (!(t->flags & TUNNEL_ENCAP_DECAP_FLAG_ENCAP_INNER_HASH))
+ af |= ADJ_FLAG_MIDCHAIN_IP_STACK;
if (VNET_LINK_ETHERNET == adj_get_link_type (ai))
af |= ADJ_FLAG_MIDCHAIN_NO_COUNT;
@@ -435,10 +439,15 @@ 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;
+ af = ADJ_FLAG_NONE;
+
+ /*
+ * the user has not requested that the load-balancing be based on
+ * a flow hash of the inner packet. so use the stacking to choose
+ * a path.
+ */
+ if (!(ctx->t->flags & TUNNEL_ENCAP_DECAP_FLAG_ENCAP_INNER_HASH))
+ af |= ADJ_FLAG_MIDCHAIN_IP_STACK;
adj_nbr_midchain_update_rewrite
(ai, gre_get_fixup (ctx->t->tunnel_dst.fp_proto,