Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755830AbcDGMCk (ORCPT ); Thu, 7 Apr 2016 08:02:40 -0400 Received: from mail-bn1bn0104.outbound.protection.outlook.com ([157.56.110.104]:51232 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755003AbcDGMCh convert rfc822-to-8bit (ORCPT ); Thu, 7 Apr 2016 08:02:37 -0400 X-Greylist: delayed 905 seconds by postgrey-1.27 at vger.kernel.org; Thu, 07 Apr 2016 08:02:36 EDT From: Dexuan Cui To: Joe Perches , "gregkh@linuxfoundation.org" , "davem@davemloft.net" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "devel@linuxdriverproject.org" , "olaf@aepfle.de" , "apw@canonical.com" , "jasowang@redhat.com" , KY Srinivasan , Haiyang Zhang CC: "vkuznets@redhat.com" Subject: RE: [PATCH v7 net-next 1/1] hv_sock: introduce Hyper-V Sockets Thread-Topic: [PATCH v7 net-next 1/1] hv_sock: introduce Hyper-V Sockets Thread-Index: AQHRkMDG0CkQx40DFUSMZJ0GU+0BIp9+ZIHQ Date: Thu, 7 Apr 2016 11:47:26 +0000 Message-ID: References: <1460033410-28710-1-git-send-email-decui@microsoft.com> <1460028573.6715.88.camel@perches.com> In-Reply-To: <1460028573.6715.88.camel@perches.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: perches.com; dkim=none (message not signed) header.d=none;perches.com; dmarc=none action=none header.from=microsoft.com; x-originating-ip: [2404:f801:9000:18::21d] x-ms-office365-filtering-correlation-id: d0ed9c9d-e91c-408a-b026-08d35eda6454 x-microsoft-exchange-diagnostics: 1;BLUPR03MB1412;5:Ev/cu5GFl1ty3d9+PI+4xx/YRxPvONwsVJ3B++bhMeUJQR3csddbD8kMfcr+RxmuXYkNobwzH5D/wVH4Sdf0jPPthaYLGH/tCUAZ52sYiA7J6ovwUimWpfFAza79eFhdm+Gr19l3eqc6/48g8A8+og==;24:jUiJ0RYV9uMYcjYF1eenRe+SscCOS03xeRaSjL9IVdOmFXA9htY7euF6Kw8JR2+aoO4gjOdjIizVigh0nCCYE4aE1L3MT0mT+1UMqWMsngc= x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR03MB1412; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(61425038)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6055026)(61426038)(61427038);SRVR:BLUPR03MB1412;BCL:0;PCL:0;RULEID:;SRVR:BLUPR03MB1412; x-forefront-prvs: 0905A6B2C7 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(24454002)(377424004)(2561002)(3280700002)(189998001)(19580395003)(76176999)(4326007)(81166005)(19580405001)(106116001)(5008740100001)(5005710100001)(3660700001)(50986999)(2501003)(1220700001)(2906002)(33656002)(102836003)(586003)(86362001)(6116002)(86612001)(54356999)(164054004)(76576001)(1096002)(122556002)(87936001)(1511001)(2421001)(74316001)(99286002)(5002640100001)(5003600100002)(5004730100002)(5001770100001)(4001450100002)(2900100001)(92566002)(2201001)(10090500001)(10290500002)(10400500002)(2950100001)(77096005)(921003)(3826002)(1121003);DIR:OUT;SFP:1102;SCL:1;SRVR:BLUPR03MB1412;H:BLUPR03MB1410.namprd03.prod.outlook.com;FPR:;SPF:None;MLV:sfv;LANG:en; spamdiagnosticoutput: 1:23 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Apr 2016 11:47:26.6962 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR03MB1412 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2023 Lines: 61 > From: Joe Perches [mailto:joe@perches.com] > Sent: Thursday, April 7, 2016 19:30 > To: Dexuan Cui ; gregkh@linuxfoundation.org; > davem@davemloft.net; netdev@vger.kernel.org; linux-kernel@vger.kernel.org; > devel@linuxdriverproject.org; olaf@aepfle.de; apw@canonical.com; > jasowang@redhat.com; KY Srinivasan ; Haiyang Zhang > > Cc: vkuznets@redhat.com > Subject: Re: [PATCH v7 net-next 1/1] hv_sock: introduce Hyper-V Sockets > > On Thu, 2016-04-07 at 05:50 -0700, Dexuan Cui wrote: > > Hyper-V Sockets (hv_sock) supplies a byte-stream based communication > > mechanism between the host and the guest. It's somewhat like TCP over > > VMBus, but the transportation layer (VMBus) is much simpler than IP. > > style trivia: > > > diff --git a/net/hv_sock/af_hvsock.c b/net/hv_sock/af_hvsock.c > [] > > +static struct sock *__hvsock_find_bound_socket(const struct sockaddr_hv > *addr) > > +{ > > + struct hvsock_sock *hvsk; > > + > > + list_for_each_entry(hvsk, &hvsock_bound_list, bound_list) > > + if (uuid_equals(addr->shv_service_id, > > + hvsk->local_addr.shv_service_id)) > > + return hvsock_to_sk(hvsk); > > Because there's an if, it's generally nicer to use > braces in the list_for_each Thanks for the suggestion, Joe! I'll add {}. > > +static struct sock *__hvsock_find_connected_socket_by_channel( > > + const struct vmbus_channel *channel) > > +{ > > + struct hvsock_sock *hvsk; > > + > > + list_for_each_entry(hvsk, &hvsock_connected_list, connected_list) > > + if (hvsk->channel == channel) > > + return hvsock_to_sk(hvsk); > > + return NULL; > > here too I'll fix this too. > > +static int hvsock_sendmsg(struct socket *sock, struct msghdr *msg, size_t len) > > +{ > [] > > + if (msg->msg_flags & ~MSG_DONTWAIT) { > > + pr_err("hvsock_sendmsg: unsupported flags=0x%x\n", > > + ???????msg->msg_flags); > > All the pr_ messages with embedded function > names could use "%s:", __func__ I'll fix this. Thanks, -- Dexuan