summaryrefslogtreecommitdiffstats
path: root/src/vnet/vxlan-gbp/encap.c
diff options
context:
space:
mode:
authorShawn Ji <xiaji@tethrnet.com>2019-12-18 10:10:54 +0800
committerShawn Ji <xiaji@tethrnet.com>2019-12-20 18:25:10 +0800
commit623b4f85e6ee4611ae15bb3103fe30725ca977ed (patch)
treec0003115d71d300d554d8ba4ac2fee9029d8e731 /src/vnet/vxlan-gbp/encap.c
parent4453c09ac38b8c80248d105e378640230124f8a6 (diff)
vxlan: reuse inner packet flow hash for tunnel outer header load balance
Type: fix Several tunnels encapsulation use udp as outer header and udp src port is set by inner header flow hash, such as gtpu, geneve, vxlan, vxlan-gbd Since flow hash of inner header is already been calculated, keeping it to vnet_buffere[b]->ip.flow_hash should save load-balance node work to select ECMP uplinks. Change-Id: I0e4e2b27178f4fcc5785e221d6d1f3e8747d0d59 Signed-off-by: Shawn Ji <xiaji@tethrnet.com>
Diffstat (limited to 'src/vnet/vxlan-gbp/encap.c')
-rw-r--r--src/vnet/vxlan-gbp/encap.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/vnet/vxlan-gbp/encap.c b/src/vnet/vxlan-gbp/encap.c
index 4bba49af5c8..a606b891189 100644
--- a/src/vnet/vxlan-gbp/encap.c
+++ b/src/vnet/vxlan-gbp/encap.c
@@ -309,6 +309,10 @@ vxlan_gbp_encap_inline (vlib_main_t * vm,
udp1->checksum = 0xffff;
}
+ /* save inner packet flow_hash for load-balance node */
+ vnet_buffer (b[0])->ip.flow_hash = flow_hash0;
+ vnet_buffer (b[1])->ip.flow_hash = flow_hash1;
+
vlib_increment_combined_counter (tx_counter, thread_index,
sw_if_index0, 1, len0);
vlib_increment_combined_counter (tx_counter, thread_index,
@@ -451,6 +455,9 @@ vxlan_gbp_encap_inline (vlib_main_t * vm,
udp0->checksum = 0xffff;
}
+ /* save inner packet flow_hash for load-balance node */
+ vnet_buffer (b[0])->ip.flow_hash = flow_hash0;
+
vlib_increment_combined_counter (tx_counter, thread_index,
sw_if_index0, 1, len0);
pkts_encapsulated++;