From b18796092bd1ef23d41b70c83c69d8d9cd2d051a Mon Sep 17 00:00:00 2001 From: Neale Ranns Date: Thu, 12 Nov 2020 16:53:51 +0000 Subject: geneve: Remove one bucket load-balance objects Type: improvement geneve uses the UDP source port for the flow hash to get load-balancing over multiple paths to the tunnel destination. However, if there is only one path, then we can elide the LB object, contributed by the resolving FIB entry, from the dasta path. Signed-off-by: Neale Ranns Change-Id: I13a1bedc307a474d258a757bc1bae28564798730 --- src/plugins/geneve/geneve.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/plugins/geneve') diff --git a/src/plugins/geneve/geneve.c b/src/plugins/geneve/geneve.c index f991af97571..2c6f1ffded5 100644 --- a/src/plugins/geneve/geneve.c +++ b/src/plugins/geneve/geneve.c @@ -150,6 +150,18 @@ geneve_tunnel_restack_dpo (geneve_tunnel_t * t) FIB_FORW_CHAIN_TYPE_UNICAST_IP4 : FIB_FORW_CHAIN_TYPE_UNICAST_IP6; fib_entry_contribute_forwarding (t->fib_entry_index, forw_type, &dpo); + + /* geneve uses the flow hash as the udp source port + * hence the packet's hash is unknown at this time. + * However, we can still skip single bucket load balance dpo's */ + while (DPO_LOAD_BALANCE == dpo.dpoi_type) + { + load_balance_t *lb = load_balance_get (dpo.dpoi_index); + if (lb->lb_n_buckets > 1) + break; + + dpo_copy (&dpo, load_balance_get_bucket_i (lb, 0)); + } dpo_stack_from_node (encap_index, &t->next_dpo, &dpo); dpo_reset (&dpo); } -- cgit 1.2.3-korg