ip_gre: propogate target device GSO capability to the tunnel device
authorDmitry Kravkov <dmitry@broadcom.com>
Mon, 18 Feb 2013 09:50:53 +0000 (09:50 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 19 Feb 2013 05:51:09 +0000 (00:51 -0500)
Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/ip_gre.c

index cdc31ac4a9dfa1227df35b233c1033b7c0320022..31bc9415269337f80ca6483069d99909e06675e6 100644 (file)
@@ -1103,8 +1103,14 @@ static int ipgre_tunnel_bind_dev(struct net_device *dev)
        tunnel->hlen = addend;
        /* TCP offload with GRE SEQ is not supported. */
        if (!(tunnel->parms.o_flags & GRE_SEQ)) {
-               dev->features           |= NETIF_F_GSO_SOFTWARE;
-               dev->hw_features        |= NETIF_F_GSO_SOFTWARE;
+               /* device supports enc gso offload*/
+               if (tdev->hw_enc_features & NETIF_F_GRE_GSO) {
+                       dev->features           |= NETIF_F_TSO;
+                       dev->hw_features        |= NETIF_F_TSO;
+               } else {
+                       dev->features           |= NETIF_F_GSO_SOFTWARE;
+                       dev->hw_features        |= NETIF_F_GSO_SOFTWARE;
+               }
        }
 
        return mtu;