aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet
diff options
context:
space:
mode:
authorSteven Luong <sluong@cisco.com>2019-08-06 21:51:34 -0700
committersteven luong <sluong@cisco.com>2019-08-20 23:02:48 +0000
commit01685beada5929f4817edca0daad14a808a4c329 (patch)
tree348333839b65d2d954fb3533f5875fbf361a330d /src/vnet
parent2ecbf6dc548bc7592db24d9541b05579312d0f63 (diff)
devices: skip checksum calculation if guest supports checksum offload
Set VNET_HW_INTERFACE_FLAG_SUPPORTS_TX_L4_CKSUM_OFFLOAD for the interface to skip checksum calculation if guest supports checksum offload. Type: fix Ticket: VPP-1750 Signed-off-by: Steven Luong <sluong@cisco.com> Change-Id: Ie933c3462394f07580ef7f2bec1d2eb3b075bd0c (cherry picked from commit a75ad876401a700127ebf234fc422e76fcd57b4c)
Diffstat (limited to 'src/vnet')
-rw-r--r--src/vnet/devices/virtio/vhost_user.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/vnet/devices/virtio/vhost_user.c b/src/vnet/devices/virtio/vhost_user.c
index 788b348cc0b..c06f78ce1bb 100644
--- a/src/vnet/devices/virtio/vhost_user.c
+++ b/src/vnet/devices/virtio/vhost_user.c
@@ -498,10 +498,14 @@ vhost_user_socket_read (clib_file_t * uf)
ASSERT (vui->virtio_net_hdr_sz < VLIB_BUFFER_PRE_DATA_SIZE);
vnet_hw_interface_t *hw = vnet_get_hw_interface (vnm, vui->hw_if_index);
if (vui->enable_gso &&
- (vui->features & (1ULL << FEAT_VIRTIO_NET_F_GUEST_CSUM)))
- hw->flags |= VNET_HW_INTERFACE_FLAG_SUPPORTS_GSO;
+ ((vui->features & FEATURE_VIRTIO_NET_F_HOST_GUEST_TSO_FEATURE_BITS)
+ == FEATURE_VIRTIO_NET_F_HOST_GUEST_TSO_FEATURE_BITS))
+ hw->flags |=
+ (VNET_HW_INTERFACE_FLAG_SUPPORTS_GSO |
+ VNET_HW_INTERFACE_FLAG_SUPPORTS_TX_L4_CKSUM_OFFLOAD);
else
- hw->flags &= ~VNET_HW_INTERFACE_FLAG_SUPPORTS_GSO;
+ hw->flags &= ~(VNET_HW_INTERFACE_FLAG_SUPPORTS_GSO |
+ VNET_HW_INTERFACE_FLAG_SUPPORTS_TX_L4_CKSUM_OFFLOAD);
vnet_hw_interface_set_flags (vnm, vui->hw_if_index, 0);
vui->is_ready = 0;
vhost_user_update_iface_state (vui);