summaryrefslogtreecommitdiffstats
path: root/src/vnet/adj
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/adj
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/adj')
-rw-r--r--src/vnet/adj/.clang-format2
-rw-r--r--src/vnet/adj/adj_midchain.c17
2 files changed, 18 insertions, 1 deletions
diff --git a/src/vnet/adj/.clang-format b/src/vnet/adj/.clang-format
new file mode 100644
index 00000000000..9d159247d51
--- /dev/null
+++ b/src/vnet/adj/.clang-format
@@ -0,0 +1,2 @@
+DisableFormat: true
+SortIncludes: false
diff --git a/src/vnet/adj/adj_midchain.c b/src/vnet/adj/adj_midchain.c
index 93cfb550e3e..a21cd21ea25 100644
--- a/src/vnet/adj/adj_midchain.c
+++ b/src/vnet/adj/adj_midchain.c
@@ -623,8 +623,23 @@ adj_nbr_midchain_stack_on_fib_entry (adj_index_t ai,
choice = load_balance_get_bucket_i (lb, hash & lb->lb_n_buckets_minus_1);
dpo_copy (&tmp, choice);
}
- else if (adj->ia_flags & ADJ_FLAG_MIDCHAIN_FIXUP_FLOW_HASH)
+ else if (lb->lb_n_buckets > 1)
{
+ /*
+ * the client has chosen not to use the stacking to select a
+ * bucket, and there are more than one buckets. there's no
+ * value in using the midchain's fixed rewrite string to select
+ * the path, so force a flow hash on the inner.
+ */
+ adj->rewrite_header.flags |= VNET_REWRITE_FIXUP_FLOW_HASH;
+ }
+
+ if (adj->ia_flags & ADJ_FLAG_MIDCHAIN_FIXUP_FLOW_HASH)
+ {
+ /*
+ * The client, for reasons unbeknownst to adj, wants to force
+ * a flow hash on the inner, we will oblige.
+ */
adj->rewrite_header.flags |= VNET_REWRITE_FIXUP_FLOW_HASH;
}
}