summaryrefslogtreecommitdiffstats
path: root/src/vnet/devices/virtio/vhost_user_output.c
diff options
context:
space:
mode:
authorMohsin Kazmi <sykazmi@cisco.com>2020-04-23 17:59:49 +0200
committerNeale Ranns <nranns@cisco.com>2020-05-05 07:44:12 +0000
commit84f91fa9c54f82c54b58ea3bf6e9ba22ff735d3a (patch)
tree63a762ea0e66b1a0074378f25984eb6450ac9ceb /src/vnet/devices/virtio/vhost_user_output.c
parent5ec6a4ea4440211e468a813ffe0f3173421c9b29 (diff)
gso: add support for IP-IP
Type: feature Change-Id: I37752af8496e0042a1da91124f3d94216b39ff11 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Diffstat (limited to 'src/vnet/devices/virtio/vhost_user_output.c')
-rw-r--r--src/vnet/devices/virtio/vhost_user_output.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/vnet/devices/virtio/vhost_user_output.c b/src/vnet/devices/virtio/vhost_user_output.c
index 4f5eb3c1d76..d48e43738a9 100644
--- a/src/vnet/devices/virtio/vhost_user_output.c
+++ b/src/vnet/devices/virtio/vhost_user_output.c
@@ -237,7 +237,11 @@ vhost_user_handle_tx_offload (vhost_user_intf_t * vui, vlib_buffer_t * b,
virtio_net_hdr_t * hdr)
{
generic_header_offset_t gho = { 0 };
- vnet_generic_header_offset_parser (b, &gho);
+ int is_ip4 = b->flags & VNET_BUFFER_F_IS_IP4;
+ int is_ip6 = b->flags & VNET_BUFFER_F_IS_IP6;
+
+ ASSERT (!(is_ip4 && is_ip6));
+ vnet_generic_header_offset_parser (b, &gho, 1 /* l2 */ , is_ip4, is_ip6);
if (b->flags & VNET_BUFFER_F_OFFLOAD_IP_CKSUM)
{
ip4_header_t *ip4;
@@ -272,13 +276,13 @@ vhost_user_handle_tx_offload (vhost_user_intf_t * vui, vlib_buffer_t * b,
{
if (b->flags & VNET_BUFFER_F_OFFLOAD_TCP_CKSUM)
{
- if ((b->flags & VNET_BUFFER_F_IS_IP4) &&
+ if (is_ip4 &&
(vui->features & (1ULL << FEAT_VIRTIO_NET_F_GUEST_TSO4)))
{
hdr->gso_size = vnet_buffer2 (b)->gso_size;
hdr->gso_type = VIRTIO_NET_HDR_GSO_TCPV4;
}
- else if ((b->flags & VNET_BUFFER_F_IS_IP6) &&
+ else if (is_ip6 &&
(vui->features & (1ULL << FEAT_VIRTIO_NET_F_GUEST_TSO6)))
{
hdr->gso_size = vnet_buffer2 (b)->gso_size;