diff options
author | Mohsin Kazmi <sykazmi@cisco.com> | 2020-06-24 16:20:54 +0200 |
---|---|---|
committer | Andrew Yourtchenko <ayourtch@gmail.com> | 2020-06-29 10:43:35 +0000 |
commit | 6d52257a2d631ede2ed5136247690f9ac13e1409 (patch) | |
tree | afce8accb43abe597acf1d3dee8867bd68095161 | |
parent | 42382f542767c468e461b49cfba265ea2b611f10 (diff) |
gso: fix the l2 path
Type: fix
Change-Id: I4f91175444dec9800d651aa5a5e0472359de63d1
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
(cherry picked from commit ec1d61efe6d01a1a687f39e57a601ac693833b07)
-rw-r--r-- | src/vnet/gso/node.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/vnet/gso/node.c b/src/vnet/gso/node.c index c690835af48..ddbcb996b5f 100644 --- a/src/vnet/gso/node.c +++ b/src/vnet/gso/node.c @@ -261,7 +261,7 @@ tso_init_buf_from_template (vlib_main_t * vm, vlib_buffer_t * nb0, static_always_inline void tso_fixup_segmented_buf (vlib_main_t * vm, vlib_buffer_t * b0, u8 tcp_flags, - int is_ip6, generic_header_offset_t * gho) + int is_l2, int is_ip6, generic_header_offset_t * gho) { ip4_header_t *ip4 = (ip4_header_t *) (vlib_buffer_get_current (b0) + gho->l3_hdr_offset); @@ -300,7 +300,7 @@ tso_fixup_segmented_buf (vlib_main_t * vm, vlib_buffer_t * b0, u8 tcp_flags, b0->flags &= ~VNET_BUFFER_F_OFFLOAD_IP_CKSUM; } - if ((gho->gho_flags & GHO_F_TUNNEL) == 0) + if (!is_l2 && ((gho->gho_flags & GHO_F_TUNNEL) == 0)) { u32 adj_index0 = vnet_buffer (b0)->ip.adj_index[VLIB_TX]; @@ -326,7 +326,8 @@ tso_fixup_segmented_buf (vlib_main_t * vm, vlib_buffer_t * b0, u8 tcp_flags, static_always_inline u32 tso_segment_buffer (vlib_main_t * vm, vnet_interface_per_thread_data_t * ptd, u32 sbi0, vlib_buffer_t * sb0, - generic_header_offset_t * gho, u32 n_bytes_b0, int is_ip6) + generic_header_offset_t * gho, u32 n_bytes_b0, int is_l2, + int is_ip6) { u32 n_tx_bytes = 0; u16 gso_size = vnet_buffer2 (sb0)->gso_size; @@ -374,7 +375,8 @@ tso_segment_buffer (vlib_main_t * vm, vnet_interface_per_thread_data_t * ptd, src_ptr = vlib_buffer_get_current (sb0) + l234_sz + first_data_size; src_left = sb0->current_length - l234_sz - first_data_size; - tso_fixup_segmented_buf (vm, b0, tcp_flags_no_fin_psh, is_ip6, gho); + tso_fixup_segmented_buf (vm, b0, tcp_flags_no_fin_psh, is_l2, is_ip6, + gho); /* grab a second buffer and prepare the loop */ ASSERT (dbi < vec_len (ptd->split_buffers)); @@ -423,8 +425,8 @@ tso_segment_buffer (vlib_main_t * vm, vnet_interface_per_thread_data_t * ptd, if (0 == dst_left && total_src_left) { n_tx_bytes += cdb0->current_length; - tso_fixup_segmented_buf (vm, cdb0, tcp_flags_no_fin_psh, is_ip6, - gho); + tso_fixup_segmented_buf (vm, cdb0, tcp_flags_no_fin_psh, is_l2, + is_ip6, gho); ASSERT (dbi < vec_len (ptd->split_buffers)); cdb0 = vlib_get_buffer (vm, ptd->split_buffers[dbi++]); tso_init_buf_from_template (vm, cdb0, b0, l234_sz, @@ -433,7 +435,7 @@ tso_segment_buffer (vlib_main_t * vm, vnet_interface_per_thread_data_t * ptd, } } - tso_fixup_segmented_buf (vm, cdb0, save_tcp_flags, is_ip6, gho); + tso_fixup_segmented_buf (vm, cdb0, save_tcp_flags, is_l2, is_ip6, gho); n_tx_bytes += cdb0->current_length; } @@ -678,7 +680,7 @@ vnet_gso_node_inline (vlib_main_t * vm, n_tx_bytes = tso_segment_buffer (vm, ptd, bi0, b[0], &gho, n_bytes_b0, - inner_is_ip6); + is_l2, inner_is_ip6); if (PREDICT_FALSE (n_tx_bytes == 0)) { |