[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <BN1PR0301MB077052B05F1CCC4EF7697DF3CA930@BN1PR0301MB0770.namprd03.prod.outlook.com>
Date: Mon, 6 Jul 2015 19:32:20 +0000
From: Haiyang Zhang <haiyangz@...rosoft.com>
To: David Miller <davem@...emloft.net>,
"dan.carpenter@...cle.com" <dan.carpenter@...cle.com>
CC: "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"olaf@...fle.de" <olaf@...fle.de>,
"jasowang@...hat.com" <jasowang@...hat.com>,
"driverdev-devel@...uxdriverproject.org"
<driverdev-devel@...uxdriverproject.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH net-next] hv_netvsc: Add support to set MTU reservation
from guest side
> -----Original Message-----
> From: David Miller [mailto:davem@...emloft.net]
> Sent: Friday, July 3, 2015 12:17 PM
> To: dan.carpenter@...cle.com
> Cc: Haiyang Zhang; netdev@...r.kernel.org; olaf@...fle.de;
> jasowang@...hat.com; driverdev-devel@...uxdriverproject.org; linux-
> kernel@...r.kernel.org
> Subject: Re: [PATCH net-next] hv_netvsc: Add support to set MTU
> reservation from guest side
>
> From: Dan Carpenter <dan.carpenter@...cle.com>
> Date: Fri, 3 Jul 2015 14:28:47 +0300
>
> > On Thu, Jul 02, 2015 at 01:17:35PM -0700, Haiyang Zhang wrote:
> >> 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@...rosoft.com>
> >> Reviewed-by: K. Y. Srinivasan <kys@...rosoft.com>
> >> ---
> >> drivers/net/hyperv/netvsc_drv.c | 3 +--
> >> drivers/net/hyperv/rndis_filter.c | 2 +-
> >> 2 files changed, 2 insertions(+), 3 deletions(-)
> >>
> >> diff --git a/drivers/net/hyperv/netvsc_drv.c
> b/drivers/net/hyperv/netvsc_drv.c
> >> index 358475e..68e7ece 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 < 68 || mtu > limit)
> >
> > How did you calculate 68? Avoid magic numbers like this, make it a
> > define.
>
> Agreed.
The number 68 is same as the common code in eth_change_mtu(). I think it
came from the protocol requirement:
https://en.wikipedia.org/wiki/Maximum_transmission_unit
Sure, I will put the number in a define, and resubmit the patch.
Thanks,
- Haiyang
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists