Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932433AbcDHBPS (ORCPT ); Thu, 7 Apr 2016 21:15:18 -0400 Received: from smtprelay0054.hostedemail.com ([216.40.44.54]:32903 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932246AbcDHBPO (ORCPT ); Thu, 7 Apr 2016 21:15:14 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::::::::::::,RULES_HIT:41:355:379:541:599: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:3866:3868:3870:3871:3872:4250:4321:5007:6119:6737:10004:10400:10848:11026:11232:11473:11658:11914:12043:12048:12296:12438:12517:12519:12740:13069:13161:13229:13311:13357:13439:14659:14721:21080:30054:30083: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:2,LUA_SUMMARY:none X-HE-Tag: love87_10283a7be6a54 X-Filterd-Recvd-Size: 2051 Message-ID: <1460078109.1800.16.camel@perches.com> Subject: Re: [PATCH v8 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, cavery@redhat.com, kys@microsoft.com, haiyangz@microsoft.com Cc: vkuznets@redhat.com Date: Thu, 07 Apr 2016 18:15:09 -0700 In-Reply-To: <1460079411-31982-1-git-send-email-decui@microsoft.com> References: <1460079411-31982-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: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1021 Lines: 32 On Thu, 2016-04-07 at 18:36 -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. [] > diff --git a/include/net/af_hvsock.h b/include/net/af_hvsock.h [] > +#define VMBUS_RINGBUFFER_SIZE_HVSOCK_RECV (5 * PAGE_SIZE) > +#define VMBUS_RINGBUFFER_SIZE_HVSOCK_SEND (5 * PAGE_SIZE) > + > +#define HVSOCK_RCV_BUF_SZ VMBUS_RINGBUFFER_SIZE_HVSOCK_RECV > +#define HVSOCK_SND_BUF_SZ PAGE_SIZE [] > +struct hvsock_sock { [] > + struct { > + struct vmpipe_proto_header hdr; > + char buf[HVSOCK_SND_BUF_SZ]; > + } __packed send; > + > + struct { > + struct vmpipe_proto_header hdr; > + char buf[HVSOCK_RCV_BUF_SZ]; > + unsigned int data_len; > + unsigned int data_offset; > + } __packed recv; > +}; These bufs are not page aligned and so can span pages. Is there any value in allocating these bufs separately as pages instead of as a kmalloc?