netvsc: reduce maximum GSO size
authorstephen hemminger <stephen@networkplumber.org>
Tue, 6 Dec 2016 21:43:54 +0000 (13:43 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 15 Jan 2017 12:41:34 +0000 (13:41 +0100)
[ Upstream commit a50af86dd49ee1851d1ccf06dd0019c05b95e297 ]

Hyper-V (and Azure) support using NVGRE which requires some extra space
for encapsulation headers. Because of this the largest allowed TSO
packet is reduced.

For older releases, hard code a fixed reduced value.  For next release,
there is a better solution which uses result of host offload
negotiation.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/hyperv/netvsc_drv.c

index 409b48e1e589dfdfa795a56b7369d835fa4643da..7a601d8c615ed602d58eb4bad554083f4fd346eb 100644 (file)
@@ -40,6 +40,8 @@
 
 #include "hyperv_net.h"
 
+/* Restrict GSO size to account for NVGRE */
+#define NETVSC_GSO_MAX_SIZE    62768
 
 #define RING_SIZE_MIN 64
 static int ring_size = 128;
@@ -852,6 +854,7 @@ static int netvsc_set_channels(struct net_device *net,
                }
                goto recover;
        }
+       netif_set_gso_max_size(net, NETVSC_GSO_MAX_SIZE);
 
  out:
        netvsc_open(net);