vxlan: reuse inner packet flow hash for tunnel outer header load balance
[vpp.git] / src / vnet / vxlan / encap.c
index eec460d..da890b2 100644 (file)
@@ -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 ++;