diff options
author | stephen hemminger <stephen@networkplumber.org> | 2016-12-06 16:43:54 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-12-07 13:13:41 -0500 |
commit | a50af86dd49ee1851d1ccf06dd0019c05b95e297 (patch) | |
tree | 257945e0bd44a7b985f0bd5f76a96c5db4debbff | |
parent | 74685b08fbb26ff5b8448fabe0941a53269dd33e (diff) |
netvsc: reduce maximum GSO size
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>
-rw-r--r-- | drivers/net/hyperv/netvsc_drv.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c index f6382150b16a..c9140c3aeb67 100644 --- a/drivers/net/hyperv/netvsc_drv.c +++ b/drivers/net/hyperv/netvsc_drv.c | |||
@@ -47,6 +47,10 @@ | |||
47 | NETIF_F_TSO | \ | 47 | NETIF_F_TSO | \ |
48 | NETIF_F_TSO6 | \ | 48 | NETIF_F_TSO6 | \ |
49 | NETIF_F_HW_CSUM) | 49 | NETIF_F_HW_CSUM) |
50 | |||
51 | /* Restrict GSO size to account for NVGRE */ | ||
52 | #define NETVSC_GSO_MAX_SIZE 62768 | ||
53 | |||
50 | static int ring_size = 128; | 54 | static int ring_size = 128; |
51 | module_param(ring_size, int, S_IRUGO); | 55 | module_param(ring_size, int, S_IRUGO); |
52 | MODULE_PARM_DESC(ring_size, "Ring buffer size (# of pages)"); | 56 | MODULE_PARM_DESC(ring_size, "Ring buffer size (# of pages)"); |
@@ -1400,6 +1404,7 @@ static int netvsc_probe(struct hv_device *dev, | |||
1400 | nvdev = net_device_ctx->nvdev; | 1404 | nvdev = net_device_ctx->nvdev; |
1401 | netif_set_real_num_tx_queues(net, nvdev->num_chn); | 1405 | netif_set_real_num_tx_queues(net, nvdev->num_chn); |
1402 | netif_set_real_num_rx_queues(net, nvdev->num_chn); | 1406 | netif_set_real_num_rx_queues(net, nvdev->num_chn); |
1407 | netif_set_gso_max_size(net, NETVSC_GSO_MAX_SIZE); | ||
1403 | 1408 | ||
1404 | ret = register_netdev(net); | 1409 | ret = register_netdev(net); |
1405 | if (ret != 0) { | 1410 | if (ret != 0) { |