Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755740AbcDGL3j (ORCPT ); Thu, 7 Apr 2016 07:29:39 -0400 Received: from smtprelay0062.hostedemail.com ([216.40.44.62]:56833 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755431AbcDGL3i (ORCPT ); Thu, 7 Apr 2016 07:29:38 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::::::::::,RULES_HIT:41:355:379:541:599:960:973:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2559:2562:2828:3138:3139:3140:3141:3142:3352:3622:3865:3867:3868:3870:3871:3872:4250:4321:5007:6119:6737:10004:10400:10848:11026:11232:11658:11783:11914:12043:12048:12296:12438:12517:12519:12740:13069:13311:13357:13439:13894:14659:14721:21080:30030:30054:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:3,LUA_SUMMARY:none X-HE-Tag: tooth03_53a2909305658 X-Filterd-Recvd-Size: 2363 Message-ID: <1460028573.6715.88.camel@perches.com> Subject: Re: [PATCH v7 net-next 1/1] hv_sock: introduce Hyper-V Sockets From: Joe Perches 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, kys@microsoft.com, haiyangz@microsoft.com Cc: vkuznets@redhat.com Date: Thu, 07 Apr 2016 04:29:33 -0700 In-Reply-To: <1460033410-28710-1-git-send-email-decui@microsoft.com> References: <1460033410-28710-1-git-send-email-decui@microsoft.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.2-0ubuntu1 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1345 Lines: 41 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 > +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 > +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__