Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751536AbcDNELG (ORCPT ); Thu, 14 Apr 2016 00:11:06 -0400 Received: from mail-bn1bbn0104.outbound.protection.outlook.com ([157.56.111.104]:30481 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751078AbcDNELE convert rfc822-to-8bit (ORCPT ); Thu, 14 Apr 2016 00:11:04 -0400 X-Greylist: delayed 872 seconds by postgrey-1.27 at vger.kernel.org; Thu, 14 Apr 2016 00:11:04 EDT From: Dexuan Cui To: David Miller CC: "gregkh@linuxfoundation.org" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "devel@linuxdriverproject.org" , "olaf@aepfle.de" , "apw@canonical.com" , "jasowang@redhat.com" , "cavery@redhat.com" , KY Srinivasan , Haiyang Zhang , "joe@perches.com" , "vkuznets@redhat.com" Subject: RE: [PATCH v8 net-next 1/1] hv_sock: introduce Hyper-V Sockets Thread-Topic: [PATCH v8 net-next 1/1] hv_sock: introduce Hyper-V Sockets Thread-Index: AQHRlfWfv3QrTQK5+kqLCMtcLPO2vp+Izvsg Date: Thu, 14 Apr 2016 03:56:27 +0000 Message-ID: References: <1460079411-31982-1-git-send-email-decui@microsoft.com> <20160413.223027.844777521863481943.davem@davemloft.net> In-Reply-To: <20160413.223027.844777521863481943.davem@davemloft.net> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: davemloft.net; dkim=none (message not signed) header.d=none;davemloft.net; dmarc=none action=none header.from=microsoft.com; x-originating-ip: [2404:f801:9000:19::58b] x-ms-office365-filtering-correlation-id: 85f6d289-ff7f-42c7-54ac-08d36418c132 x-microsoft-exchange-diagnostics: 1;SN2PR03MB1917;5:1qknt2eeZDbCUCNFjivE7K0vW99N3ZYYwJZm4+ZSFllERI8aDuZr4QAV8Ztn0Bkab+RrZLK3dScmC4yVfPwg6J2ZuE6ujKH8pu28bhNVkuPYknN8Y9xUW7B2H41XlBn1yL78DMc4HsxpmHQPfD7yjQ==;24:gfPGk6iH6lBkpyuhDkjhjNLIzus81h5FukUIMzeg2emS7XuD65V/CJ8jeoWTNSgLSqUya8StC5vzAHIi2IXiybHpEOPP/NvLq0NRgYMICro= x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:SN2PR03MB1917; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(61425038)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6055026)(61426038)(61427038);SRVR:SN2PR03MB1917;BCL:0;PCL:0;RULEID:;SRVR:SN2PR03MB1917; x-forefront-prvs: 0912297777 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(45984002)(2950100001)(2900100001)(6116002)(102836003)(122556002)(3280700002)(11100500001)(5004730100002)(81166005)(586003)(5008740100001)(3660700001)(1220700001)(1096002)(4326007)(2906002)(5002640100001)(106116001)(164054004)(10090500001)(77096005)(9686002)(10400500002)(33656002)(5005710100001)(10290500002)(92566002)(5003600100002)(99286002)(74316001)(86612001)(54356999)(87936001)(76576001)(19580405001)(189998001)(110136002)(19580395003)(50986999)(76176999)(86362001);DIR:OUT;SFP:1102;SCL:1;SRVR:SN2PR03MB1917;H:BLUPR03MB1410.namprd03.prod.outlook.com;FPR:;SPF:None;MLV:sfv;LANG:en; Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Apr 2016 03:56:27.0165 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN2PR03MB1917 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2563 Lines: 73 > From: David Miller [mailto:davem@davemloft.net] > Sent: Thursday, April 14, 2016 10:30 > To: Dexuan Cui > Cc: gregkh@linuxfoundation.org; netdev@vger.kernel.org; linux- > kernel@vger.kernel.org; devel@linuxdriverproject.org; olaf@aepfle.de; > apw@canonical.com; jasowang@redhat.com; cavery@redhat.com; KY > Srinivasan ; Haiyang Zhang ; > joe@perches.com; vkuznets@redhat.com > Subject: Re: [PATCH v8 net-next 1/1] hv_sock: introduce Hyper-V Sockets > > From: Dexuan Cui > Date: Thu, 7 Apr 2016 18:36:51 -0700 > > > +struct vmpipe_proto_header { > > + u32 pkt_type; > > + u32 data_size; > > +} __packed; > > There is no reason to specify __packed here. > > The types are strongly sized to word aligned quantities. > No holes are possible in this structure, nor is any padding > possible either. > > Do not ever slap __packed onto protocol or HW defined structures, > simply just define them properly with proper types and explicit > padding when necessary. Hi David, Thank you very much for taking a look at the patch! I'll remove all the 3 __packed usages in my patch. > > + struct { > > + struct vmpipe_proto_header hdr; > > + char buf[HVSOCK_SND_BUF_SZ]; > > + } __packed send; > > And so on, and so forth.. I'll remove __packed and use u8 to replace the 'char' here. > I'm really disappointed that I couldn't even get one hunk into this > patch submission without finding a major problem. David, Could you please point out more issues in the patch? I'm definitely happy to fix them. :-) > I expect this patch to take several more iterations before I can even > come close to applying it. So please set your expectations properly, > and also it seems like nobody else wants to even review this stuff > either. It is you who needs to find a way to change all of this, not > me. A few people took a look at the early versions of the patch and did give me good suggestions on the interface APIs with VMBus and some coding style issues, especially Vitaly from Redhat. Cathy from Redhat was also looking into the patch recently and gave me some good feedbacks. I'll try to invite more people to review the patch. And, I'm updating the patch to address some issues: 1) the feature is only properly supported on Windows 10/2016 build 14290 and later, so I'm going to not enable the feature on old hosts. 2) there is actually some mechanism we can use to simplify hvsock_open_connection() and help to better support hvsock_shutdown(). Thanks, -- Dexuan