X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Fdevices%2Fvirtio%2Fdevice.c;h=d110946deded081e03cc616d2e76ca18fdc7cb4e;hb=0b04209edac55487c108ff5f2faf51cbd4c2cee7;hp=367372fa29a41ca451767f4a09ae43676d624082;hpb=6440b7a602fdeb41674911cc3baf0b39a7521b96;p=vpp.git diff --git a/src/vnet/devices/virtio/device.c b/src/vnet/devices/virtio/device.c index 367372fa29a..d110946dede 100644 --- a/src/vnet/devices/virtio/device.c +++ b/src/vnet/devices/virtio/device.c @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include #include @@ -173,7 +173,8 @@ set_checksum_offsets (vlib_buffer_t * b, struct virtio_net_hdr_v1 *hdr) if (b->flags & VNET_BUFFER_F_IS_IP4) { ip4_header_t *ip4; - gso_header_offset_t gho = vnet_gso_header_offset_parser (b, 0); + generic_header_offset_t gho = { 0 }; + vnet_generic_header_offset_parser (b, &gho); hdr->flags = VIRTIO_NET_HDR_F_NEEDS_CSUM; hdr->csum_start = gho.l4_hdr_offset; // 0x22; if (b->flags & VNET_BUFFER_F_OFFLOAD_TCP_CKSUM) @@ -196,7 +197,8 @@ set_checksum_offsets (vlib_buffer_t * b, struct virtio_net_hdr_v1 *hdr) } else if (b->flags & VNET_BUFFER_F_IS_IP6) { - gso_header_offset_t gho = vnet_gso_header_offset_parser (b, 1); + generic_header_offset_t gho = { 0 }; + vnet_generic_header_offset_parser (b, &gho); hdr->flags = VIRTIO_NET_HDR_F_NEEDS_CSUM; hdr->csum_start = gho.l4_hdr_offset; // 0x36; if (b->flags & VNET_BUFFER_F_OFFLOAD_TCP_CKSUM) @@ -216,10 +218,11 @@ set_gso_offsets (vlib_buffer_t * b, struct virtio_net_hdr_v1 *hdr) if (b->flags & VNET_BUFFER_F_IS_IP4) { ip4_header_t *ip4; - gso_header_offset_t gho = vnet_gso_header_offset_parser (b, 0); + generic_header_offset_t gho = { 0 }; + vnet_generic_header_offset_parser (b, &gho); hdr->gso_type = VIRTIO_NET_HDR_GSO_TCPV4; hdr->gso_size = vnet_buffer2 (b)->gso_size; - hdr->hdr_len = gho.l4_hdr_offset + gho.l4_hdr_sz; + hdr->hdr_len = gho.hdr_sz; hdr->flags = VIRTIO_NET_HDR_F_NEEDS_CSUM; hdr->csum_start = gho.l4_hdr_offset; // 0x22; hdr->csum_offset = STRUCT_OFFSET_OF (tcp_header_t, checksum); @@ -234,10 +237,11 @@ set_gso_offsets (vlib_buffer_t * b, struct virtio_net_hdr_v1 *hdr) } else if (b->flags & VNET_BUFFER_F_IS_IP6) { - gso_header_offset_t gho = vnet_gso_header_offset_parser (b, 1); + generic_header_offset_t gho = { 0 }; + vnet_generic_header_offset_parser (b, &gho); hdr->gso_type = VIRTIO_NET_HDR_GSO_TCPV6; hdr->gso_size = vnet_buffer2 (b)->gso_size; - hdr->hdr_len = gho.l4_hdr_offset + gho.l4_hdr_sz; + hdr->hdr_len = gho.hdr_sz; hdr->flags = VIRTIO_NET_HDR_F_NEEDS_CSUM; hdr->csum_start = gho.l4_hdr_offset; // 0x36; hdr->csum_offset = STRUCT_OFFSET_OF (tcp_header_t, checksum);