diff options
author | Steven Luong <sluong@cisco.com> | 2020-10-12 10:43:28 -0700 |
---|---|---|
committer | Dave Wallace <dwallacelf@gmail.com> | 2020-10-23 21:13:59 +0000 |
commit | 11166453a54511b1396faed46abb946a0d2eb393 (patch) | |
tree | 50e218e1ea08649ff34db14936d4e55cc0729a28 /src/vnet | |
parent | ee3ea114961610476bac544a979fdee8278d2b9e (diff) |
virtio: checksum error reported for ip6 traffic with GSO enable
When GSO is enabled, vhost clears the checksum field prior to transmitting
the packet. Some newer kernel version does not like that and complains
about checksum error. This was seen with ip6 traffic.
Type: fix
Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: I7c6f2a6148f4a30107bfa8b078f5990e64300cf1
(cherry picked from commit ac0f5363881fdce2721287bc5c756282166d9991)
Diffstat (limited to 'src/vnet')
-rw-r--r-- | src/vnet/devices/virtio/vhost_user_input.c | 6 | ||||
-rw-r--r-- | src/vnet/devices/virtio/vhost_user_output.c | 6 |
2 files changed, 1 insertions, 11 deletions
diff --git a/src/vnet/devices/virtio/vhost_user_input.c b/src/vnet/devices/virtio/vhost_user_input.c index ea8e7d6f777..1209e13d742 100644 --- a/src/vnet/devices/virtio/vhost_user_input.c +++ b/src/vnet/devices/virtio/vhost_user_input.c @@ -292,15 +292,11 @@ vhost_user_handle_rx_offload (vlib_buffer_t * b0, u8 * b0_data, tcp_header_t *tcp = (tcp_header_t *) (b0_data + vnet_buffer (b0)->l4_hdr_offset); l4_hdr_sz = tcp_header_bytes (tcp); - tcp->checksum = 0; b0->flags |= VNET_BUFFER_F_OFFLOAD_TCP_CKSUM; } else if (l4_proto == IP_PROTOCOL_UDP) { - udp_header_t *udp = - (udp_header_t *) (b0_data + vnet_buffer (b0)->l4_hdr_offset); - l4_hdr_sz = sizeof (*udp); - udp->checksum = 0; + l4_hdr_sz = sizeof (udp_header_t); b0->flags |= VNET_BUFFER_F_OFFLOAD_UDP_CKSUM; } diff --git a/src/vnet/devices/virtio/vhost_user_output.c b/src/vnet/devices/virtio/vhost_user_output.c index 2d17ddfda04..54d478c7034 100644 --- a/src/vnet/devices/virtio/vhost_user_output.c +++ b/src/vnet/devices/virtio/vhost_user_output.c @@ -256,18 +256,12 @@ vhost_user_handle_tx_offload (vhost_user_intf_t * vui, vlib_buffer_t * b, hdr->flags = VIRTIO_NET_HDR_F_NEEDS_CSUM; hdr->csum_start = gho.l4_hdr_offset; hdr->csum_offset = offsetof (udp_header_t, checksum); - udp_header_t *udp = - (udp_header_t *) (vlib_buffer_get_current (b) + gho.l4_hdr_offset); - udp->checksum = 0; } else if (b->flags & VNET_BUFFER_F_OFFLOAD_TCP_CKSUM) { hdr->flags = VIRTIO_NET_HDR_F_NEEDS_CSUM; hdr->csum_start = gho.l4_hdr_offset; hdr->csum_offset = offsetof (tcp_header_t, checksum); - tcp_header_t *tcp = - (tcp_header_t *) (vlib_buffer_get_current (b) + gho.l4_hdr_offset); - tcp->checksum = 0; } /* GSO offload */ |