diff options
author | Shawn Ji <xiaji@tethrnet.com> | 2019-12-18 10:10:54 +0800 |
---|---|---|
committer | Shawn Ji <xiaji@tethrnet.com> | 2019-12-21 05:36:21 +0000 |
commit | d0bb569621b9f0608c8eac448aec07cd010d4706 (patch) | |
tree | fb82739b5fc38fd775d94e5da07907c111b68a3f /src/plugins | |
parent | 2eb13c295427405208ad9d13d562d2a084a46da7 (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>
(cherry picked from commit 623b4f85e6ee4611ae15bb3103fe30725ca977ed)
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/gtpu/gtpu_encap.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/plugins/gtpu/gtpu_encap.c b/src/plugins/gtpu/gtpu_encap.c index ec33e1e4487..e6b2ce589d0 100644 --- a/src/plugins/gtpu/gtpu_encap.c +++ b/src/plugins/gtpu/gtpu_encap.c @@ -413,6 +413,12 @@ gtpu_encap_inline (vlib_main_t * vm, stats_n_packets += 4; stats_n_bytes += len0 + len1 + len2 + len3; + /* save inner packet flow_hash for load-balance node */ + vnet_buffer (b0)->ip.flow_hash = flow_hash0; + vnet_buffer (b1)->ip.flow_hash = flow_hash1; + vnet_buffer (b2)->ip.flow_hash = flow_hash2; + vnet_buffer (b3)->ip.flow_hash = flow_hash3; + /* Batch stats increment on the same gtpu tunnel so counter is not incremented per packet. Note stats are still incremented for deleted and admin-down tunnel where packets are dropped. It is not worthwhile @@ -611,6 +617,9 @@ gtpu_encap_inline (vlib_main_t * vm, stats_n_packets += 1; stats_n_bytes += len0; + /* save inner packet flow_hash for load-balance node */ + vnet_buffer (b0)->ip.flow_hash = flow_hash0; + /* Batch stats increment on the same gtpu tunnel so counter is not incremented per packet. Note stats are still incremented for deleted and admin-down tunnel where packets are dropped. It is not worthwhile |