From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752355AbbEKF6T (ORCPT ); Mon, 11 May 2015 01:58:19 -0400 Received: from smtprelay0205.hostedemail.com ([216.40.44.205]:35528 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751065AbbEKF6R (ORCPT ); Mon, 11 May 2015 01:58:17 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 30,2,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:2693:2828:2892:2914:3138:3139:3140:3141:3142:3352:3622:3865:3866:3867:3868:3871:3872:3874:4321:4605:5007:6119:6120:6261:7901:7903:10010:10400:10848:11026:11232:11473:11658:11914:12043:12294:12296:12438:12517:12519:12663:12679:12740:13069:13255:13311:13357:21080,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:1:0 X-HE-Tag: blood95_8244c0b3f5a4d X-Filterd-Recvd-Size: 2447 Message-ID: <1431323894.2884.4.camel@perches.com> Subject: Re: [PATCH V5 1/1] hv_netvsc: Use the xmit_more skb flag to optimize signaling the host From: Joe Perches To: "K. Y. Srinivasan" Cc: davem@davemloft.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, devel@linuxdriverproject.org, olaf@aepfle.de, apw@canonical.com, jasowang@redhat.com Date: Sun, 10 May 2015 22:58:14 -0700 In-Reply-To: <1431317294-16442-1-git-send-email-kys@microsoft.com> References: <1431317294-16442-1-git-send-email-kys@microsoft.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.12.11-0ubuntu3 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 On Sun, 2015-05-10 at 21:08 -0700, K. Y. Srinivasan wrote: > Based on the information given to this driver (via the xmit_more skb flag), > we can defer signaling the host if more packets are on the way. This will help > make the host more efficient since it can potentially process a larger batch of > packets. Implement this optimization. trivia: I think that indirecting VMBUS_DATA_PACKET_FLAG_COMPLETTION_REQUESTED into a non-const temporary isn't very useful. Whenever overly long identifiers like VMBUS_ is used, I think that it'd be better to use it directly and ignore 80 column warnings. Same with the "sizeof(struct nvsp_message)" on two lines. > diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c [] > @@ -743,6 +743,8 @@ static inline int netvsc_send_pkt( > u64 req_id; > int ret; > struct hv_page_buffer *pgbuf; > + u32 vmbus_flags = VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED; > + u32 ring_avail = hv_ringbuf_avail_percent(&out_channel->outbound); [] > @@ -769,30 +771,41 @@ static inline int netvsc_send_pkt( [] > + ret = vmbus_sendpacket_pagebuffer_ctl(out_channel, > + pgbuf, > + packet->page_buf_cnt, > + &nvmsg, > + sizeof(struct > + nvsp_message), > + req_id, > + vmbus_flags, > + !packet->xmit_more); [] > netif_tx_stop_queue(netdev_get_tx_queue( > ndev, q_idx)); This could be on one line too.