openvswitch: Enable tunnel GSO for OVS bridge.
authorPravin B Shelar <pshelar@nicira.com>
Thu, 17 Jul 2014 22:14:15 +0000 (15:14 -0700)
committerPravin B Shelar <pshelar@nicira.com>
Thu, 24 Jul 2014 08:15:04 +0000 (01:15 -0700)
Following patch enables all available tunnel GSO features for OVS
bridge device so that ovs can use hardware offloads available to
underling device.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Andy Zhou <azhou@nicira.com>
include/linux/netdev_features.h
net/openvswitch/vport-internal_dev.c

index d99800cbdcf3b7b4029e4b3f325aec6b1e4382dc..dcfdecbfa0b711e52f3f629ec02ea3cbd70a6c1d 100644 (file)
@@ -176,4 +176,12 @@ enum {
                                 NETIF_F_HW_VLAN_STAG_RX | \
                                 NETIF_F_HW_VLAN_STAG_TX)
 
+#define NETIF_F_GSO_ENCAP_ALL  (NETIF_F_GSO_GRE |                      \
+                                NETIF_F_GSO_GRE_CSUM |                 \
+                                NETIF_F_GSO_IPIP |                     \
+                                NETIF_F_GSO_SIT |                      \
+                                NETIF_F_GSO_UDP_TUNNEL |               \
+                                NETIF_F_GSO_UDP_TUNNEL_CSUM |          \
+                                NETIF_F_GSO_MPLS)
+
 #endif /* _LINUX_NETDEV_FEATURES_H */
index bd658555afdfcd2a05a22d61c3a46b524c7d3ebd..84516126e5f3a74b4b88cd87e1dd316ec11b98d9 100644 (file)
@@ -140,11 +140,14 @@ static void do_setup(struct net_device *netdev)
        netdev->tx_queue_len = 0;
 
        netdev->features = NETIF_F_LLTX | NETIF_F_SG | NETIF_F_FRAGLIST |
-                          NETIF_F_HIGHDMA | NETIF_F_HW_CSUM | NETIF_F_GSO_SOFTWARE;
+                          NETIF_F_HIGHDMA | NETIF_F_HW_CSUM |
+                          NETIF_F_GSO_SOFTWARE | NETIF_F_GSO_ENCAP_ALL;
 
        netdev->vlan_features = netdev->features;
+       netdev->hw_enc_features = netdev->features;
        netdev->features |= NETIF_F_HW_VLAN_CTAG_TX;
        netdev->hw_features = netdev->features & ~NETIF_F_LLTX;
+
        eth_hw_addr_random(netdev);
 }