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:

committed by
David S. Miller

父節點
5226cfc500
當前提交
4d3c9d37f7
@@ -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;
|
||||
|
Reference in New Issue
Block a user