Disable TSO/CSUM offloading 66/866/2
authorShesha Sreenivasamurthy <shesha@cisco.com>
Mon, 25 Apr 2016 17:34:53 +0000 (13:34 -0400)
committerDamjan Marion <damarion@cisco.com>
Mon, 25 Apr 2016 19:09:31 +0000 (19:09 +0000)
  Enabling these features breaks L4 traffic when a VHOST
  interface is bridged with a hardware interface which
  does not support such offloading. (Eg: enic)

Change-Id: Ife3d292a8860eb60b82f1473e2d0dd7329e51d5e
Signed-off-by: Shesha Sreenivasamurthy <shesha@cisco.com>
vnet/vnet/devices/dpdk/vhost_user.c

index 61a206c..7691ff8 100644 (file)
@@ -422,6 +422,21 @@ dpdk_vhost_user_get_features(u32 hw_if_index, u64 * features)
 {
   *features = rte_vhost_feature_get();
 
+#if RTE_VERSION >= RTE_VERSION_NUM(16, 4, 0, 0)
+#define OFFLOAD_FEATURES ((1ULL << VIRTIO_NET_F_HOST_TSO4) | \
+               (1ULL << VIRTIO_NET_F_HOST_TSO6) | \
+               (1ULL << VIRTIO_NET_F_CSUM)    | \
+               (1ULL << VIRTIO_NET_F_GUEST_CSUM) | \
+               (1ULL << VIRTIO_NET_F_GUEST_TSO4) | \
+               (1ULL << VIRTIO_NET_F_GUEST_TSO6))
+
+  /* These are not suppoted as bridging/tunneling VHOST
+   * interfaces with hardware interfaces/drivers that does
+   * not support offloading breaks L4 traffic.
+   */
+  *features &= (~OFFLOAD_FEATURES);
+#endif
+
   DBG_SOCK("supported features: 0x%lx", *features);
   return 0;
 }