Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S945551AbcJSPmi (ORCPT ); Wed, 19 Oct 2016 11:42:38 -0400 Received: from mail-dm3nam03on0094.outbound.protection.outlook.com ([104.47.41.94]:28208 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S944023AbcJSPme (ORCPT ); Wed, 19 Oct 2016 11:42:34 -0400 X-Greylist: delayed 5552 seconds by postgrey-1.27 at vger.kernel.org; Wed, 19 Oct 2016 11:42:34 EDT From: Haiyang Zhang To: Jarod Wilson , "linux-kernel@vger.kernel.org" CC: "netdev@vger.kernel.org" , "virtualization@lists.linux-foundation.org" , KY Srinivasan , "Michael S. Tsirkin" , Shrikrishna Khare , "VMware, Inc." Subject: RE: [PATCH net-next 5/6] net: use core MTU range checking in virt drivers Thread-Topic: [PATCH net-next 5/6] net: use core MTU range checking in virt drivers Thread-Index: AQHSKbE9IJuQJBXoHUetb5rQekcRzqCvz3lg Date: Wed, 19 Oct 2016 14:07:47 +0000 Message-ID: References: <20161019023333.15760-1-jarod@redhat.com> <20161019023333.15760-6-jarod@redhat.com> In-Reply-To: <20161019023333.15760-6-jarod@redhat.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=haiyangz@microsoft.com; x-originating-ip: [72.74.33.140] x-ms-office365-filtering-correlation-id: b4d091de-4b29-447f-cb33-08d3f8294e34 x-microsoft-exchange-diagnostics: 1;DM5PR03MB2492;7:43wPFe8ayYA1NxB3Q4K8jz7lSgkkOxag7r1g21+h3hNtvMZUhvQU9aMVTa66VA1Z2/iugY9mk2zDqzgDwDHTk5Ad71OZmnabIXtt8zc0Kbybqq0pliIj9XjkFAHq/iJNvmBFI0k2XUe5DTqD6o9R9Mc9gIbmnTOY98tGoMSsAQTEaweNg0ndsJ617BYOSKKLh6KP/b3Yy65k82W6nmSVpZOgu0SG+ZTjVQTZamQduycG8gyuj9eXjgoelNiKE9YvQ6xMFhMEaR6/EBIhG6ADDsGlxvjKUZha/WCWTGXEAd5i9CayXCVJyjmwU4+53GWYufT50D98i60n2BtwyTHdWmoELrxRboWpGVtLvmCmLBtnvCoVfNQ1qZu9WF/mF3DY x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM5PR03MB2492; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(61668805478150)(9452136761055); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(61425038)(6040176)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(6055026)(61426038)(61427038);SRVR:DM5PR03MB2492;BCL:0;PCL:0;RULEID:;SRVR:DM5PR03MB2492; x-forefront-prvs: 0100732B76 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(7916002)(377454003)(199003)(189002)(13464003)(97736004)(87936001)(2950100002)(122556002)(86362001)(19580405001)(6116002)(189998001)(5001770100001)(586003)(102836003)(9686002)(3846002)(8936002)(3660700001)(10290500002)(66066001)(3280700002)(10400500002)(5002640100001)(68736007)(8990500004)(10090500001)(8676002)(305945005)(2900100001)(7696004)(76176999)(77096005)(50986999)(99286002)(19580395003)(92566002)(2501003)(76576001)(81156014)(5660300001)(7736002)(74316002)(7846002)(5005710100001)(33656002)(4326007)(54356999)(106356001)(106116001)(86612001)(81166006)(2906002)(101416001)(105586002);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR03MB2492;H:BLUPR03MB1412.namprd03.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Oct 2016 14:07:47.7361 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR03MB2492 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.home.local id u9JFgiEe018401 Content-Length: 2333 Lines: 77 > -----Original Message----- > From: Jarod Wilson [mailto:jarod@redhat.com] > Sent: Tuesday, October 18, 2016 10:34 PM > To: linux-kernel@vger.kernel.org > Cc: Jarod Wilson ; netdev@vger.kernel.org; > virtualization@lists.linux-foundation.org; KY Srinivasan > ; Haiyang Zhang ; Michael S. > Tsirkin ; Shrikrishna Khare ; VMware, > Inc. > Subject: [PATCH net-next 5/6] net: use core MTU range checking in virt > drivers > > hyperv_net: > - set min/max_mtu > > virtio_net: > - set min/max_mtu > - remove virtnet_change_mtu > > vmxnet3: > - set min/max_mtu > > CC: netdev@vger.kernel.org > CC: virtualization@lists.linux-foundation.org > CC: "K. Y. Srinivasan" > CC: Haiyang Zhang > CC: "Michael S. Tsirkin" > CC: Shrikrishna Khare > CC: "VMware, Inc." > Signed-off-by: Jarod Wilson > --- > drivers/net/hyperv/hyperv_net.h | 4 ++-- > drivers/net/hyperv/netvsc_drv.c | 14 +++++++------- > drivers/net/virtio_net.c | 23 ++++++++++------------- > drivers/net/vmxnet3/vmxnet3_drv.c | 7 ++++--- > 4 files changed, 23 insertions(+), 25 deletions(-) > > diff --git a/drivers/net/hyperv/hyperv_net.h > b/drivers/net/hyperv/hyperv_net.h > index f4fbcb5..3958ada 100644 > --- a/drivers/net/hyperv/hyperv_net.h > +++ b/drivers/net/hyperv/hyperv_net.h > @@ -606,8 +606,8 @@ struct nvsp_message { > } __packed; > > > -#define NETVSC_MTU 65536 > -#define NETVSC_MTU_MIN 68 > +#define NETVSC_MTU 65535 Why change it to 65535? For Hyperv host, this should be 65536. > @@ -1343,6 +1336,13 @@ static int netvsc_probe(struct hv_device *dev, > > netif_carrier_off(net); > > + /* MTU range: 68 - 1500 or 65521 */ > + net->min_mtu = NETVSC_MTU_MIN; > + if (nvdev->nvsp_version >= NVSP_PROTOCOL_VERSION_2) > + net->max_mtu = NETVSC_MTU - ETH_HLEN; > + else > + net->max_mtu = ETH_DATA_LEN; > + > netvsc_init_settings(net); > > net_device_ctx = netdev_priv(net); nvdev->nvsp_version is not set until after rndis_filter_device_add() is successfully completed. You need to move this part to the place just before this line: ret = register_netdev(net); Thanks, - Haiyang