From 65d789e4baa0be3086b9dd97e3fdfea35b5f7857 Mon Sep 17 00:00:00 2001 From: Neale Ranns Date: Mon, 8 Feb 2021 15:24:56 +0000 Subject: fib: Always honour flow hash flag Type: fix Signed-off-by: Neale Ranns Change-Id: Id7b27edf3712aaa3c277e752b9ca78bb91d184a1 --- src/vnet/ipip/ipip.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'src/vnet/ipip') 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, -- cgit 1.2.3-korg