diff options
Diffstat (limited to 'src/vnet')
-rw-r--r-- | src/vnet/geneve/encap.c | 8 | ||||
-rw-r--r-- | src/vnet/vxlan-gbp/encap.c | 7 | ||||
-rw-r--r-- | src/vnet/vxlan/encap.c | 7 |
3 files changed, 22 insertions, 0 deletions
diff --git a/src/vnet/geneve/encap.c b/src/vnet/geneve/encap.c index 8e59aea3626..af52fd24543 100644 --- a/src/vnet/geneve/encap.c +++ b/src/vnet/geneve/encap.c @@ -120,6 +120,7 @@ geneve_encap_inline (vlib_main_t * vm, flow_hash0 = vnet_l2_compute_flow_hash (b[0]); flow_hash1 = vnet_l2_compute_flow_hash (b[1]); + /* Get next node index and adj index from tunnel next_dpo */ if (sw_if_index0 != vnet_buffer (b[0])->sw_if_index[VLIB_TX]) { @@ -289,6 +290,10 @@ geneve_encap_inline (vlib_main_t * vm, stats_n_packets += 2; stats_n_bytes += len0 + len1; + /* 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; + /* Batch stats increment on the same geneve 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 @@ -467,6 +472,9 @@ geneve_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 (b[0])->ip.flow_hash = flow_hash0; + /* Batch stats increment on the same geneve 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 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++; diff --git a/src/vnet/vxlan/encap.c b/src/vnet/vxlan/encap.c index eec460d5bc5..da890b2d5fb 100644 --- a/src/vnet/vxlan/encap.c +++ b/src/vnet/vxlan/encap.c @@ -287,6 +287,10 @@ vxlan_encap_inline (vlib_main_t * vm, udp1->checksum = 0xffff; } + /* 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; + if (sw_if_index0 == sw_if_index1) { vlib_increment_combined_counter (tx_counter, thread_index, @@ -424,6 +428,9 @@ vxlan_encap_inline (vlib_main_t * vm, udp0->checksum = 0xffff; } + /* reuse inner packet flow_hash for load-balance node */ + vnet_buffer (b0)->ip.flow_hash = flow_hash0; + vlib_increment_combined_counter (tx_counter, thread_index, sw_if_index0, 1, len0); pkts_encapsulated ++; |