From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753411AbbCLDdm (ORCPT ); Wed, 11 Mar 2015 23:33:42 -0400 Received: from mail-bn1bbn0103.outbound.protection.outlook.com ([157.56.111.103]:3459 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751833AbbCLDdj (ORCPT ); Wed, 11 Mar 2015 23:33:39 -0400 From: KY Srinivasan To: Jason Wang CC: "davem@davemloft.net" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "devel@linuxdriverproject.org" , "olaf@aepfle.de" , "apw@canonical.com" , "gregkh@linuxfoundation.org" Subject: RE: [PATCH V2 3/3 net-next] hyperv: Support batched notification Thread-Topic: [PATCH V2 3/3 net-next] hyperv: Support batched notification Thread-Index: AQHQXCOVjQEDvhBE/EaxYfHAOje/oZ0YK10AgAAGrIA= Date: Thu, 12 Mar 2015 03:33:36 +0000 Message-ID: References: <1426100635-9508-1-git-send-email-kys@microsoft.com> <1426100660-9547-1-git-send-email-kys@microsoft.com> <1426100660-9547-3-git-send-email-kys@microsoft.com> <1426129712.12154.3@smtp.corp.redhat.com> In-Reply-To: <1426129712.12154.3@smtp.corp.redhat.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [2601:8:9b00:fd:b924:a39b:1484:9136] authentication-results: redhat.com; dkim=none (message not signed) header.d=none; x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY2PR0301MB0710; x-forefront-antispam-report: BMV:1;SFV:NSPM;SFS:(10019020)(6009001)(24454002)(51704005)(377454003)(40100003)(19580395003)(76576001)(99286002)(54356999)(77156002)(93886004)(46102003)(50986999)(106116001)(86362001)(110136001)(86612001)(19580405001)(33656002)(102836002)(76176999)(74316001)(2656002)(87936001)(92566002)(62966003)(2950100001)(122556002)(2900100001)(3826002);DIR:OUT;SFP:1102;SCL:1;SRVR:BY2PR0301MB0710;H:BY2PR0301MB0711.namprd03.prod.outlook.com;FPR:;SPF:None;MLV:sfv;LANG:en; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(601004)(5002009)(5005006);SRVR:BY2PR0301MB0710;BCL:0;PCL:0;RULEID:;SRVR:BY2PR0301MB0710; x-forefront-prvs: 05134F8B4F Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 X-OriginatorOrg: microsoft.onmicrosoft.com X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Mar 2015 03:33:36.2894 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR0301MB0710 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by nfs id t2C3XkHZ030498 > -----Original Message----- > From: Jason Wang [mailto:jasowang@redhat.com] > Sent: Wednesday, March 11, 2015 8:09 PM > To: KY Srinivasan > Cc: davem@davemloft.net; netdev@vger.kernel.org; linux- > kernel@vger.kernel.org; devel@linuxdriverproject.org; olaf@aepfle.de; > apw@canonical.com; gregkh@linuxfoundation.org; KY Srinivasan > Subject: Re: [PATCH V2 3/3 net-next] hyperv: Support batched notification > > > > On Thu, Mar 12, 2015 at 3:04 AM, K. Y. Srinivasan > wrote: > > Optimize notifying the host by deferring notification until there are > > no more packets to be sent. This will help in batching the requests on > > the host. > > > > Signed-off-by: K. Y. Srinivasan > > --- > > drivers/net/hyperv/hyperv_net.h | 2 +- > > drivers/net/hyperv/netvsc.c | 14 +++++++++----- > > drivers/net/hyperv/netvsc_drv.c | 3 ++- > > drivers/net/hyperv/rndis_filter.c | 2 +- > > 4 files changed, 13 insertions(+), 8 deletions(-) > > > > diff --git a/drivers/net/hyperv/hyperv_net.h > > b/drivers/net/hyperv/hyperv_net.h index 4815843..3fd9896 100644 > > --- a/drivers/net/hyperv/hyperv_net.h > > +++ b/drivers/net/hyperv/hyperv_net.h > > @@ -184,7 +184,7 @@ struct rndis_device { int > > netvsc_device_add(struct hv_device *device, void *additional_info); > > int netvsc_device_remove(struct hv_device *device); int > > netvsc_send(struct hv_device *device, > > - struct hv_netvsc_packet *packet); > > + struct hv_netvsc_packet *packet, bool kick_q); > > void netvsc_linkstatus_callback(struct hv_device *device_obj, > > struct rndis_message *resp); > > int netvsc_recv_callback(struct hv_device *device_obj, diff --git > > a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c index > > 208eb05..9003b94 100644 > > --- a/drivers/net/hyperv/netvsc.c > > +++ b/drivers/net/hyperv/netvsc.c > > @@ -707,7 +707,7 @@ static u32 netvsc_copy_to_send_buf(struct > > netvsc_device *net_device, } > > > > int netvsc_send(struct hv_device *device, > > - struct hv_netvsc_packet *packet) > > + struct hv_netvsc_packet *packet, bool kick_q) > > { > > struct netvsc_device *net_device; > > int ret = 0; > > @@ -719,6 +719,7 @@ int netvsc_send(struct hv_device *device, > > u32 msg_size = 0; > > struct sk_buff *skb = NULL; > > u16 q_idx = packet->q_idx; > > + u32 vmbus_flags = > VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED; > > > > > > net_device = get_outbound_net_device(device); @@ -768,18 > +769,21 @@ > > int netvsc_send(struct hv_device *device, > > return -ENODEV; > > > > if (packet->page_buf_cnt) { > > - ret = vmbus_sendpacket_pagebuffer(out_channel, > > + ret = vmbus_sendpacket_pagebuffer_ctl(out_channel, > > packet->page_buf, > > packet->page_buf_cnt, > > &sendMessage, > > sizeof(struct > nvsp_message), > > - req_id); > > + req_id, > > + vmbus_flags, > > + kick_q); > > } else { > > - ret = vmbus_sendpacket(out_channel, &sendMessage, > > + ret = vmbus_sendpacket_ctl(out_channel, &sendMessage, > > sizeof(struct nvsp_message), > > req_id, > > VM_PKT_DATA_INBAND, > > - > VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); > > + vmbus_flags, > > + kick_q); > > } > > > > if (ret == 0) { > > diff --git a/drivers/net/hyperv/netvsc_drv.c > > b/drivers/net/hyperv/netvsc_drv.c index a06bd66..80b4b29 100644 > > --- a/drivers/net/hyperv/netvsc_drv.c > > +++ b/drivers/net/hyperv/netvsc_drv.c > > @@ -384,6 +384,7 @@ static int netvsc_start_xmit(struct sk_buff *skb, > > struct net_device *net) > > u32 net_trans_info; > > u32 hash; > > u32 skb_length = skb->len; > > + bool kick_q = !skb->xmit_more; > > > > > > /* We will atmost need two pages to describe the rndis @@ -556,7 > > +557,7 @@ do_send: > > packet->page_buf_cnt = init_page_array(rndis_msg, > rndis_msg_size, > > skb, &packet->page_buf[0]); > > > > - ret = netvsc_send(net_device_ctx->device_ctx, packet); > > + ret = netvsc_send(net_device_ctx->device_ctx, packet, kick_q); > > Maybe just a !skb->xmit_more here to save a local variable. Will fix it. K. Y {.n++%ݶw{.n+{G{ayʇڙ,jfhz_(階ݢj"mG?&~iOzv^m ?I From mboxrd@z Thu Jan 1 00:00:00 1970 From: KY Srinivasan Subject: RE: [PATCH V2 3/3 net-next] hyperv: Support batched notification Date: Thu, 12 Mar 2015 03:33:36 +0000 Message-ID: References: <1426100635-9508-1-git-send-email-kys@microsoft.com> <1426100660-9547-1-git-send-email-kys@microsoft.com> <1426100660-9547-3-git-send-email-kys@microsoft.com> <1426129712.12154.3@smtp.corp.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: "olaf@aepfle.de" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "gregkh@linuxfoundation.org" , "apw@canonical.com" , "devel@linuxdriverproject.org" , "davem@davemloft.net" To: Jason Wang Return-path: In-Reply-To: <1426129712.12154.3@smtp.corp.redhat.com> Content-Language: en-US List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: driverdev-devel-bounces@linuxdriverproject.org Sender: "devel" List-Id: netdev.vger.kernel.org > -----Original Message----- > From: Jason Wang [mailto:jasowang@redhat.com] > Sent: Wednesday, March 11, 2015 8:09 PM > To: KY Srinivasan > Cc: davem@davemloft.net; netdev@vger.kernel.org; linux- > kernel@vger.kernel.org; devel@linuxdriverproject.org; olaf@aepfle.de; > apw@canonical.com; gregkh@linuxfoundation.org; KY Srinivasan > Subject: Re: [PATCH V2 3/3 net-next] hyperv: Support batched notification > > > > On Thu, Mar 12, 2015 at 3:04 AM, K. Y. Srinivasan > wrote: > > Optimize notifying the host by deferring notification until there are > > no more packets to be sent. This will help in batching the requests on > > the host. > > > > Signed-off-by: K. Y. Srinivasan > > --- > > drivers/net/hyperv/hyperv_net.h | 2 +- > > drivers/net/hyperv/netvsc.c | 14 +++++++++----- > > drivers/net/hyperv/netvsc_drv.c | 3 ++- > > drivers/net/hyperv/rndis_filter.c | 2 +- > > 4 files changed, 13 insertions(+), 8 deletions(-) > > > > diff --git a/drivers/net/hyperv/hyperv_net.h > > b/drivers/net/hyperv/hyperv_net.h index 4815843..3fd9896 100644 > > --- a/drivers/net/hyperv/hyperv_net.h > > +++ b/drivers/net/hyperv/hyperv_net.h > > @@ -184,7 +184,7 @@ struct rndis_device { int > > netvsc_device_add(struct hv_device *device, void *additional_info); > > int netvsc_device_remove(struct hv_device *device); int > > netvsc_send(struct hv_device *device, > > - struct hv_netvsc_packet *packet); > > + struct hv_netvsc_packet *packet, bool kick_q); > > void netvsc_linkstatus_callback(struct hv_device *device_obj, > > struct rndis_message *resp); > > int netvsc_recv_callback(struct hv_device *device_obj, diff --git > > a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c index > > 208eb05..9003b94 100644 > > --- a/drivers/net/hyperv/netvsc.c > > +++ b/drivers/net/hyperv/netvsc.c > > @@ -707,7 +707,7 @@ static u32 netvsc_copy_to_send_buf(struct > > netvsc_device *net_device, } > > > > int netvsc_send(struct hv_device *device, > > - struct hv_netvsc_packet *packet) > > + struct hv_netvsc_packet *packet, bool kick_q) > > { > > struct netvsc_device *net_device; > > int ret = 0; > > @@ -719,6 +719,7 @@ int netvsc_send(struct hv_device *device, > > u32 msg_size = 0; > > struct sk_buff *skb = NULL; > > u16 q_idx = packet->q_idx; > > + u32 vmbus_flags = > VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED; > > > > > > net_device = get_outbound_net_device(device); @@ -768,18 > +769,21 @@ > > int netvsc_send(struct hv_device *device, > > return -ENODEV; > > > > if (packet->page_buf_cnt) { > > - ret = vmbus_sendpacket_pagebuffer(out_channel, > > + ret = vmbus_sendpacket_pagebuffer_ctl(out_channel, > > packet->page_buf, > > packet->page_buf_cnt, > > &sendMessage, > > sizeof(struct > nvsp_message), > > - req_id); > > + req_id, > > + vmbus_flags, > > + kick_q); > > } else { > > - ret = vmbus_sendpacket(out_channel, &sendMessage, > > + ret = vmbus_sendpacket_ctl(out_channel, &sendMessage, > > sizeof(struct nvsp_message), > > req_id, > > VM_PKT_DATA_INBAND, > > - > VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); > > + vmbus_flags, > > + kick_q); > > } > > > > if (ret == 0) { > > diff --git a/drivers/net/hyperv/netvsc_drv.c > > b/drivers/net/hyperv/netvsc_drv.c index a06bd66..80b4b29 100644 > > --- a/drivers/net/hyperv/netvsc_drv.c > > +++ b/drivers/net/hyperv/netvsc_drv.c > > @@ -384,6 +384,7 @@ static int netvsc_start_xmit(struct sk_buff *skb, > > struct net_device *net) > > u32 net_trans_info; > > u32 hash; > > u32 skb_length = skb->len; > > + bool kick_q = !skb->xmit_more; > > > > > > /* We will atmost need two pages to describe the rndis @@ -556,7 > > +557,7 @@ do_send: > > packet->page_buf_cnt = init_page_array(rndis_msg, > rndis_msg_size, > > skb, &packet->page_buf[0]); > > > > - ret = netvsc_send(net_device_ctx->device_ctx, packet); > > + ret = netvsc_send(net_device_ctx->device_ctx, packet, kick_q); > > Maybe just a !skb->xmit_more here to save a local variable. Will fix it. K. Y