interface: fix the incorrect sizes/offsets in the tso segmentation 32/20232/4
authorAndrew Yourtchenko <ayourtch@gmail.com>
Wed, 19 Jun 2019 12:09:51 +0000 (12:09 +0000)
committerFlorin Coras <florin.coras@gmail.com>
Thu, 20 Jun 2019 20:07:49 +0000 (20:07 +0000)
The copying of the first segment copied too small amount of data.
The copying of the second and subsequent segments used the wrong
data offset - for the case of GSO enabled it starts from 12 bytes
earlier.

Change-Id: I3adc532c175babc1ca1e121c7e12e6cafbdb9974
Type: fix
Ticket: VPP-1700
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
src/vnet/interface_output.c

index 28f44c3..2a41271 100644 (file)
@@ -352,7 +352,7 @@ tso_segment_buffer (vlib_main_t * vm, vnet_interface_per_thread_data_t * ptd,
 
   vlib_buffer_t *b0 = vlib_get_buffer (vm, ptd->split_buffers[0]);
   tso_init_buf_from_template_base (b0, sb0, default_bflags,
-                                  l4_hdr_sz + first_data_size);
+                                  l234_sz + first_data_size);
 
   u32 total_src_left = n_bytes_b0 - l234_sz - first_data_size;
   if (total_src_left)
@@ -410,7 +410,7 @@ tso_segment_buffer (vlib_main_t * vm, vnet_interface_per_thread_data_t * ptd,
                  csbi0 = next_bi;
                  csb0 = vlib_get_buffer (vm, csbi0);
                  src_left = csb0->current_length;
-                 src_ptr = csb0->data;
+                 src_ptr = vlib_buffer_get_current (csb0);
                }
              else
                {