hyperv: Add processing of MTU reduced by the host

If the host uses packet encapsulation feature, the MTU may be reduced by the
host due to headroom reservation for encapsulation. This patch handles this
new MTU value.

Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Haiyang Zhang
2014-11-12 14:07:44 -08:00
committed by David S. Miller
父節點 5226cfc500
當前提交 4d3c9d37f7
共有 3 個文件被更改,包括 14 次插入3 次删除

查看文件

@@ -699,9 +699,10 @@ static int netvsc_change_mtu(struct net_device *ndev, int mtu)
return -ENODEV;
if (nvdev->nvsp_version >= NVSP_PROTOCOL_VERSION_2)
limit = NETVSC_MTU;
limit = NETVSC_MTU - ETH_HLEN;
if (mtu < 68 || mtu > limit)
/* Hyper-V hosts don't support MTU < ETH_DATA_LEN (1500) */
if (mtu < ETH_DATA_LEN || mtu > limit)
return -EINVAL;
nvdev->start_remove = true;