diff options
author | Haiyang Zhang <haiyangz@microsoft.com> | 2015-07-07 00:11:37 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-07-09 02:00:56 +0300 |
commit | f9cbce34c34bcc05ea0dd78c8999bfe88b5b6b86 (patch) | |
tree | 415b7324a0311b278c86d1c2bc75e316ebe84d78 /drivers/net/hyperv/netvsc_drv.c | |
parent | 9e29e21a9bbfb2204bab875f0ef6dbaed66592e7 (diff) | |
download | linux-f9cbce34c34bcc05ea0dd78c8999bfe88b5b6b86.tar.xz |
hv_netvsc: Add support to set MTU reservation from guest side
When packet encapsulation is in use, the MTU needs to be reduced for
headroom reservation.
The existing code takes the updated MTU value only from the host side.
But vSwitch extensions, such as Open vSwitch, require the flexibility
to change the MTU to different values from within a guest during the
lifecycle of a vNIC, when the encapsulation protocol is changed. The
patch supports this kind of MTU changes.
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Reviewed-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/hyperv/netvsc_drv.c')
-rw-r--r-- | drivers/net/hyperv/netvsc_drv.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c index 358475ed9b59..b855ba9a507d 100644 --- a/drivers/net/hyperv/netvsc_drv.c +++ b/drivers/net/hyperv/netvsc_drv.c @@ -743,8 +743,7 @@ static int netvsc_change_mtu(struct net_device *ndev, int mtu) if (nvdev->nvsp_version >= NVSP_PROTOCOL_VERSION_2) limit = NETVSC_MTU - ETH_HLEN; - /* Hyper-V hosts don't support MTU < ETH_DATA_LEN (1500) */ - if (mtu < ETH_DATA_LEN || mtu > limit) + if (mtu < NETVSC_MTU_MIN || mtu > limit) return -EINVAL; nvdev->start_remove = true; |