aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/ipip
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/ipip
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/ipip')
-rw-r--r--src/vnet/ipip/ipip.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/src/vnet/ipip/ipip.c b/src/vnet/ipip/ipip.c
index d43bcd1cb53..e6ea3ebe79d 100644
--- a/src/vnet/ipip/ipip.c
+++ b/src/vnet/ipip/ipip.c
@@ -335,14 +335,18 @@ ipip_update_adj (vnet_main_t * vnm, u32 sw_if_index, adj_index_t ai)
ipip_tunnel_t *t;
adj_flags_t af;
+ af = ADJ_FLAG_NONE;
t = ipip_tunnel_db_find_by_sw_if_index (sw_if_index);
if (!t)
return;
- 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;
@@ -372,10 +376,13 @@ 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;
+ /*
+ * 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, fixup,