LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: KY Srinivasan <kys@microsoft.com>
To: Jason Wang <jasowang@redhat.com>
Cc: "davem@davemloft.net" <davem@davemloft.net>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"devel@linuxdriverproject.org" <devel@linuxdriverproject.org>,
	"olaf@aepfle.de" <olaf@aepfle.de>,
	"apw@canonical.com" <apw@canonical.com>
Subject: RE: [PATCH 2/2 net-next] hyperv: Support batched notification
Date: Wed, 11 Mar 2015 16:41:59 +0000	[thread overview]
Message-ID: <BY2PR0301MB0711FCC428583B528CD0B191A0190@BY2PR0301MB0711.namprd03.prod.outlook.com> (raw)
In-Reply-To: <1426044867.1341.3@smtp.corp.redhat.com>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 3732 bytes --]



> -----Original Message-----
> From: Jason Wang [mailto:jasowang@redhat.com]
> Sent: Tuesday, March 10, 2015 8:34 PM
> To: KY Srinivasan
> Cc: davem@davemloft.net; netdev@vger.kernel.org;
> gregkh@linuxfoundation.org; linux-kernel@vger.kernel.org;
> devel@linuxdriverproject.org; olaf@aepfle.de; apw@canonical.com; KY
> Srinivasan
> Subject: Re: [PATCH 2/2 net-next] hyperv: Support batched notification
> 
> 
> 
> On Wed, Mar 11, 2015 at 2:50 AM, K. Y. Srinivasan <kys@microsoft.com>
> 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 <kys@microsoft.com>
> > ---
> >  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);
> 
> What if kick_q is false but ret is -EAGAIN here? Looks like in this case host
> won't get notified at all. How about checking whether txq and kicking if it has
> been stopped like what other network driver did?

Good point. I am going to fix this issue in the VMBUS layer. The kick_q argument
is simply a hint to the vmbus level - the lower level can choose not to notify the
host (even if kick_q is true) based on other considerations.

I will resend this series with the logic in the vmbus driver. I will send the patch out
and Greg can decide if the vmbus change should go through Greg's tree or David's tree.

Regards,

K. Y
ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

  reply	other threads:[~2015-03-11 16:42 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-10 18:49 [PATCH 0/2 net-next] hyperv: Enable " K. Y. Srinivasan
2015-03-10 18:50 ` [PATCH 1/2 net-next] Drivers: hv: vmbus: Export the vmbus_sendpacket_pagebuffer_ctl() K. Y. Srinivasan
2015-03-10 18:25   ` Greg KH
2015-03-10 18:50   ` [PATCH 2/2 net-next] hyperv: Support batched notification K. Y. Srinivasan
2015-03-11  3:34     ` Jason Wang
2015-03-11 16:41       ` KY Srinivasan [this message]
2015-03-11  9:23     ` Olaf Hering
2015-03-11 17:45       ` KY Srinivasan
2015-03-12 11:06         ` Olaf Hering

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BY2PR0301MB0711FCC428583B528CD0B191A0190@BY2PR0301MB0711.namprd03.prod.outlook.com \
    --to=kys@microsoft.com \
    --cc=apw@canonical.com \
    --cc=davem@davemloft.net \
    --cc=devel@linuxdriverproject.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jasowang@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=olaf@aepfle.de \
    --subject='RE: [PATCH 2/2 net-next] hyperv: Support batched notification' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).