]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
netvsc: reduce maximum GSO size
authorstephen hemminger <stephen@networkplumber.org>
Tue, 6 Dec 2016 21:43:54 +0000 (13:43 -0800)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 16 Mar 2017 02:27:22 +0000 (02:27 +0000)
[ 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: Ben Hutchings <ben@decadent.org.uk>
drivers/net/hyperv/netvsc_drv.c

index 7e3331821200bd6a5a2da4e84645a015c9417b86..ab68d940a2c71be5f9cbd5088ab928bd8c4403e0 100644 (file)
@@ -47,6 +47,9 @@ struct net_device_context {
        struct work_struct work;
 };
 
+/* Restrict GSO size to account for NVGRE */
+#define NETVSC_GSO_MAX_SIZE    62768
+
 #define RING_SIZE_MIN 64
 static int ring_size = 128;
 module_param(ring_size, int, S_IRUGO);
@@ -839,6 +842,7 @@ static int netvsc_probe(struct hv_device *dev,
        nvdev = hv_get_drvdata(dev);
        netif_set_real_num_tx_queues(net, nvdev->num_chn);
        netif_set_real_num_rx_queues(net, nvdev->num_chn);
+       netif_set_gso_max_size(net, NETVSC_GSO_MAX_SIZE);
 
        ret = register_netdev(net);
        if (ret != 0) {