All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V3 0/2 net-next] hyperv: Enable batched notification
@ 2015-03-17 16:02 K. Y. Srinivasan
  2015-03-17 16:02   ` K. Y. Srinivasan
  2015-03-17 19:23 ` [PATCH V3 0/2 net-next] hyperv: Enable " David Miller
  0 siblings, 2 replies; 17+ messages in thread
From: K. Y. Srinivasan @ 2015-03-17 16:02 UTC (permalink / raw)
  To: davem, netdev, linux-kernel, devel, olaf, apw, jasowang; +Cc: K. Y. Srinivasan

Take into consideration the xmit_more flag in skb to decide if we should
notify the host as we place packets in VMBUS.

The VMBUS API that would give us this control is already in Greg's tree, in this
patch-set, that API is exported so it can be used in the netvsc driver. Greg has
acked this export.

In this version of the patch-set, the patch to address the vmbus signalling
fix is not included here; that patch will be taken through Greg's tree.
I have also gotten rid of an unnecessary local variable in start_xmit()
function based on feedback from Jason Wang <jasowang@redhat.com>.

K. Y. Srinivasan (2):
  Drivers: hv: vmbus: Export the vmbus_sendpacket_pagebuffer_ctl()
  hyperv: Support batched notification

 drivers/hv/channel.c              |    1 +
 drivers/net/hyperv/hyperv_net.h   |    2 +-
 drivers/net/hyperv/netvsc.c       |   14 +++++++++-----
 drivers/net/hyperv/netvsc_drv.c   |    2 +-
 drivers/net/hyperv/rndis_filter.c |    2 +-
 5 files changed, 13 insertions(+), 8 deletions(-)

-- 
1.7.4.1


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH V3 1/2 net-next] Drivers: hv: vmbus: Export the vmbus_sendpacket_pagebuffer_ctl()
  2015-03-17 16:02 [PATCH V3 0/2 net-next] hyperv: Enable batched notification K. Y. Srinivasan
@ 2015-03-17 16:02   ` K. Y. Srinivasan
  2015-03-17 19:23 ` [PATCH V3 0/2 net-next] hyperv: Enable " David Miller
  1 sibling, 0 replies; 17+ messages in thread
From: K. Y. Srinivasan @ 2015-03-17 16:02 UTC (permalink / raw)
  To: davem, netdev, linux-kernel, devel, olaf, apw, jasowang; +Cc: K. Y. Srinivasan

Export the vmbus_sendpacket_pagebuffer_ctl() interface. This interface
will be used in the netvsc driver to optimize signalling the host.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/hv/channel.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/hv/channel.c b/drivers/hv/channel.c
index da53180..e58cdb7 100644
--- a/drivers/hv/channel.c
+++ b/drivers/hv/channel.c
@@ -710,6 +710,7 @@ int vmbus_sendpacket_pagebuffer_ctl(struct vmbus_channel *channel,
 
 	return ret;
 }
+EXPORT_SYMBOL_GPL(vmbus_sendpacket_pagebuffer_ctl);
 
 /*
  * vmbus_sendpacket_pagebuffer - Send a range of single-page buffer
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH V3 1/2 net-next] Drivers: hv: vmbus: Export the vmbus_sendpacket_pagebuffer_ctl()
@ 2015-03-17 16:02   ` K. Y. Srinivasan
  0 siblings, 0 replies; 17+ messages in thread
From: K. Y. Srinivasan @ 2015-03-17 16:02 UTC (permalink / raw)
  To: davem, netdev, linux-kernel, devel, olaf, apw, jasowang

Export the vmbus_sendpacket_pagebuffer_ctl() interface. This interface
will be used in the netvsc driver to optimize signalling the host.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/hv/channel.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/hv/channel.c b/drivers/hv/channel.c
index da53180..e58cdb7 100644
--- a/drivers/hv/channel.c
+++ b/drivers/hv/channel.c
@@ -710,6 +710,7 @@ int vmbus_sendpacket_pagebuffer_ctl(struct vmbus_channel *channel,
 
 	return ret;
 }
+EXPORT_SYMBOL_GPL(vmbus_sendpacket_pagebuffer_ctl);
 
 /*
  * vmbus_sendpacket_pagebuffer - Send a range of single-page buffer
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH V3 2/2 net-next] hyperv: Support batched notification
  2015-03-17 16:02   ` K. Y. Srinivasan
  (?)
@ 2015-03-17 16:02   ` K. Y. Srinivasan
  2015-03-18  3:08       ` Jason Wang
  -1 siblings, 1 reply; 17+ messages in thread
From: K. Y. Srinivasan @ 2015-03-17 16:02 UTC (permalink / raw)
  To: davem, netdev, linux-kernel, devel, olaf, apw, jasowang; +Cc: K. Y. Srinivasan

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   |    2 +-
 drivers/net/hyperv/rndis_filter.c |    2 +-
 4 files changed, 12 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..eae58db 100644
--- a/drivers/net/hyperv/netvsc_drv.c
+++ b/drivers/net/hyperv/netvsc_drv.c
@@ -556,7 +556,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, !skb->xmit_more);
 
 drop:
 	if (ret == 0) {
diff --git a/drivers/net/hyperv/rndis_filter.c b/drivers/net/hyperv/rndis_filter.c
index ca81de0..05f3792 100644
--- a/drivers/net/hyperv/rndis_filter.c
+++ b/drivers/net/hyperv/rndis_filter.c
@@ -238,7 +238,7 @@ static int rndis_filter_send_request(struct rndis_device *dev,
 
 	packet->send_completion = NULL;
 
-	ret = netvsc_send(dev->net_dev->dev, packet);
+	ret = netvsc_send(dev->net_dev->dev, packet, true);
 	return ret;
 }
 
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* Re: [PATCH V3 0/2 net-next] hyperv: Enable batched notification
  2015-03-17 16:02 [PATCH V3 0/2 net-next] hyperv: Enable batched notification K. Y. Srinivasan
  2015-03-17 16:02   ` K. Y. Srinivasan
@ 2015-03-17 19:23 ` David Miller
  2015-03-17 19:26   ` KY Srinivasan
  1 sibling, 1 reply; 17+ messages in thread
From: David Miller @ 2015-03-17 19:23 UTC (permalink / raw)
  To: kys; +Cc: netdev, linux-kernel, devel, olaf, apw, jasowang

From: "K. Y. Srinivasan" <kys@microsoft.com>
Date: Tue, 17 Mar 2015 09:02:25 -0700

> Take into consideration the xmit_more flag in skb to decide if we should
> notify the host as we place packets in VMBUS.
> 
> The VMBUS API that would give us this control is already in Greg's tree, in this
> patch-set, that API is exported so it can be used in the netvsc driver. Greg has
> acked this export.
> 
> In this version of the patch-set, the patch to address the vmbus signalling
> fix is not included here; that patch will be taken through Greg's tree.
> I have also gotten rid of an unnecessary local variable in start_xmit()
> function based on feedback from Jason Wang <jasowang@redhat.com>.

This patch set does not apply to net-next at all.

^ permalink raw reply	[flat|nested] 17+ messages in thread

* RE: [PATCH V3 0/2 net-next] hyperv: Enable batched notification
  2015-03-17 19:23 ` [PATCH V3 0/2 net-next] hyperv: Enable " David Miller
@ 2015-03-17 19:26   ` KY Srinivasan
  2015-03-17 20:07     ` KY Srinivasan
  0 siblings, 1 reply; 17+ messages in thread
From: KY Srinivasan @ 2015-03-17 19:26 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, linux-kernel, devel, olaf, apw, jasowang



> -----Original Message-----
> From: David Miller [mailto:davem@redhat.com]
> Sent: Tuesday, March 17, 2015 12:23 PM
> To: KY Srinivasan
> Cc: netdev@vger.kernel.org; linux-kernel@vger.kernel.org;
> devel@linuxdriverproject.org; olaf@aepfle.de; apw@canonical.com;
> jasowang@redhat.com
> Subject: Re: [PATCH V3 0/2 net-next] hyperv: Enable batched notification
> 
> From: "K. Y. Srinivasan" <kys@microsoft.com>
> Date: Tue, 17 Mar 2015 09:02:25 -0700
> 
> > Take into consideration the xmit_more flag in skb to decide if we should
> > notify the host as we place packets in VMBUS.
> >
> > The VMBUS API that would give us this control is already in Greg's tree, in
> this
> > patch-set, that API is exported so it can be used in the netvsc driver. Greg
> has
> > acked this export.
> >
> > In this version of the patch-set, the patch to address the vmbus signalling
> > fix is not included here; that patch will be taken through Greg's tree.
> > I have also gotten rid of an unnecessary local variable in start_xmit()
> > function based on feedback from Jason Wang <jasowang@redhat.com>.
> 
> This patch set does not apply to net-next at all.

I will rebase this and send it.

Thanks,

K. Y

^ permalink raw reply	[flat|nested] 17+ messages in thread

* RE: [PATCH V3 0/2 net-next] hyperv: Enable batched notification
  2015-03-17 19:26   ` KY Srinivasan
@ 2015-03-17 20:07     ` KY Srinivasan
  2015-03-17 21:37       ` David Miller
  0 siblings, 1 reply; 17+ messages in thread
From: KY Srinivasan @ 2015-03-17 20:07 UTC (permalink / raw)
  To: KY Srinivasan, David Miller, Greg KH (gregkh@linuxfoundation.org)
  Cc: olaf, netdev, jasowang, linux-kernel, apw, devel



> -----Original Message-----
> From: devel [mailto:driverdev-devel-bounces@linuxdriverproject.org] On
> Behalf Of KY Srinivasan
> Sent: Tuesday, March 17, 2015 12:26 PM
> To: David Miller
> Cc: olaf@aepfle.de; netdev@vger.kernel.org; jasowang@redhat.com; linux-
> kernel@vger.kernel.org; apw@canonical.com; devel@linuxdriverproject.org
> Subject: RE: [PATCH V3 0/2 net-next] hyperv: Enable batched notification
> 
> 
> 
> > -----Original Message-----
> > From: David Miller [mailto:davem@redhat.com]
> > Sent: Tuesday, March 17, 2015 12:23 PM
> > To: KY Srinivasan
> > Cc: netdev@vger.kernel.org; linux-kernel@vger.kernel.org;
> > devel@linuxdriverproject.org; olaf@aepfle.de; apw@canonical.com;
> > jasowang@redhat.com
> > Subject: Re: [PATCH V3 0/2 net-next] hyperv: Enable batched notification
> >
> > From: "K. Y. Srinivasan" <kys@microsoft.com>
> > Date: Tue, 17 Mar 2015 09:02:25 -0700
> >
> > > Take into consideration the xmit_more flag in skb to decide if we should
> > > notify the host as we place packets in VMBUS.
> > >
> > > The VMBUS API that would give us this control is already in Greg's tree, in
> > this
> > > patch-set, that API is exported so it can be used in the netvsc driver. Greg
> > has
> > > acked this export.
> > >
> > > In this version of the patch-set, the patch to address the vmbus signalling
> > > fix is not included here; that patch will be taken through Greg's tree.
> > > I have also gotten rid of an unnecessary local variable in start_xmit()
> > > function based on feedback from Jason Wang <jasowang@redhat.com>.
> >
> > This patch set does not apply to net-next at all.
> 
> I will rebase this and send it.

David,

I pulled down the net-next tree and the issue is with the first patch:
0001-Drivers-hv-vmbus-Export-the-vmbus_sendpacket_pagebuf.patch

The net-next tree is not current with Greg's tree and this patch is on code that
is in Greg's tree. This patch merely exports an API that is already in Greg's tree.
Greg wanted me to take this patch through your tree since the only user
of this functionality is the network driver. Any suggestions on how I should 
proceed here.

The second patch:
0002-hyperv-Support-batched-notification.patch

applies cleanly to your tree.

Regards,

K. Y


> 
> Thanks,
> 
> K. Y
> _______________________________________________
> devel mailing list
> devel@linuxdriverproject.org
> http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH V3 0/2 net-next] hyperv: Enable batched notification
  2015-03-17 20:07     ` KY Srinivasan
@ 2015-03-17 21:37       ` David Miller
  2015-03-17 21:39           ` KY Srinivasan
  0 siblings, 1 reply; 17+ messages in thread
From: David Miller @ 2015-03-17 21:37 UTC (permalink / raw)
  To: kys; +Cc: gregkh, olaf, netdev, jasowang, linux-kernel, apw, devel

From: KY Srinivasan <kys@microsoft.com>
Date: Tue, 17 Mar 2015 20:07:10 +0000

> I pulled down the net-next tree and the issue is with the first patch:
> 0001-Drivers-hv-vmbus-Export-the-vmbus_sendpacket_pagebuf.patch
> 
> The net-next tree is not current with Greg's tree and this patch is on code that
> is in Greg's tree. This patch merely exports an API that is already in Greg's tree.
> Greg wanted me to take this patch through your tree since the only user
> of this functionality is the network driver. Any suggestions on how I should 
> proceed here.
> 
> The second patch:
> 0002-hyperv-Support-batched-notification.patch
> 
> applies cleanly to your tree.

Don't create cross-tree dependencies like this.

I'm not pulling in Greg's tree to get a dependency like this.

And if I don't, I can't apply patch #2 because it will fail to
build.

^ permalink raw reply	[flat|nested] 17+ messages in thread

* RE: [PATCH V3 0/2 net-next] hyperv: Enable batched notification
  2015-03-17 21:37       ` David Miller
@ 2015-03-17 21:39           ` KY Srinivasan
  0 siblings, 0 replies; 17+ messages in thread
From: KY Srinivasan @ 2015-03-17 21:39 UTC (permalink / raw)
  To: David Miller; +Cc: gregkh, olaf, netdev, jasowang, linux-kernel, apw, devel



> -----Original Message-----
> From: David Miller [mailto:davem@davemloft.net]
> Sent: Tuesday, March 17, 2015 2:37 PM
> To: KY Srinivasan
> Cc: gregkh@linuxfoundation.org; olaf@aepfle.de; netdev@vger.kernel.org;
> jasowang@redhat.com; linux-kernel@vger.kernel.org; apw@canonical.com;
> devel@linuxdriverproject.org
> Subject: Re: [PATCH V3 0/2 net-next] hyperv: Enable batched notification
> 
> From: KY Srinivasan <kys@microsoft.com>
> Date: Tue, 17 Mar 2015 20:07:10 +0000
> 
> > I pulled down the net-next tree and the issue is with the first patch:
> > 0001-Drivers-hv-vmbus-Export-the-vmbus_sendpacket_pagebuf.patch
> >
> > The net-next tree is not current with Greg's tree and this patch is on code
> that
> > is in Greg's tree. This patch merely exports an API that is already in Greg's
> tree.
> > Greg wanted me to take this patch through your tree since the only user
> > of this functionality is the network driver. Any suggestions on how I should
> > proceed here.
> >
> > The second patch:
> > 0002-hyperv-Support-batched-notification.patch
> >
> > applies cleanly to your tree.
> 
> Don't create cross-tree dependencies like this.
> 
> I'm not pulling in Greg's tree to get a dependency like this.
> 
> And if I don't, I can't apply patch #2 because it will fail to
> build.
Ok; I will submit the first patch through Greg's tree.

Thanks,

K. Y

^ permalink raw reply	[flat|nested] 17+ messages in thread

* RE: [PATCH V3 0/2 net-next] hyperv: Enable batched notification
@ 2015-03-17 21:39           ` KY Srinivasan
  0 siblings, 0 replies; 17+ messages in thread
From: KY Srinivasan @ 2015-03-17 21:39 UTC (permalink / raw)
  To: David Miller; +Cc: olaf, gregkh, jasowang, linux-kernel, netdev, apw, devel



> -----Original Message-----
> From: David Miller [mailto:davem@davemloft.net]
> Sent: Tuesday, March 17, 2015 2:37 PM
> To: KY Srinivasan
> Cc: gregkh@linuxfoundation.org; olaf@aepfle.de; netdev@vger.kernel.org;
> jasowang@redhat.com; linux-kernel@vger.kernel.org; apw@canonical.com;
> devel@linuxdriverproject.org
> Subject: Re: [PATCH V3 0/2 net-next] hyperv: Enable batched notification
> 
> From: KY Srinivasan <kys@microsoft.com>
> Date: Tue, 17 Mar 2015 20:07:10 +0000
> 
> > I pulled down the net-next tree and the issue is with the first patch:
> > 0001-Drivers-hv-vmbus-Export-the-vmbus_sendpacket_pagebuf.patch
> >
> > The net-next tree is not current with Greg's tree and this patch is on code
> that
> > is in Greg's tree. This patch merely exports an API that is already in Greg's
> tree.
> > Greg wanted me to take this patch through your tree since the only user
> > of this functionality is the network driver. Any suggestions on how I should
> > proceed here.
> >
> > The second patch:
> > 0002-hyperv-Support-batched-notification.patch
> >
> > applies cleanly to your tree.
> 
> Don't create cross-tree dependencies like this.
> 
> I'm not pulling in Greg's tree to get a dependency like this.
> 
> And if I don't, I can't apply patch #2 because it will fail to
> build.
Ok; I will submit the first patch through Greg's tree.

Thanks,

K. Y

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH V3 2/2 net-next] hyperv: Support batched notification
  2015-03-17 16:02   ` [PATCH V3 2/2 net-next] hyperv: Support batched notification K. Y. Srinivasan
@ 2015-03-18  3:08       ` Jason Wang
  0 siblings, 0 replies; 17+ messages in thread
From: Jason Wang @ 2015-03-18  3:08 UTC (permalink / raw)
  To: K. Y. Srinivasan
  Cc: davem, netdev, linux-kernel, devel, olaf, apw, K. Y. Srinivasan



On Wed, Mar 18, 2015 at 12:02 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   |    2 +-
>  drivers/net/hyperv/rndis_filter.c |    2 +-
>  4 files changed, 12 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..eae58db 100644
> --- a/drivers/net/hyperv/netvsc_drv.c
> +++ b/drivers/net/hyperv/netvsc_drv.c
> @@ -556,7 +556,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, 
> !skb->xmit_more);
>  

Looks like the issue of V2 still there (E.g we need to kick when 
hv_ringbuffer_write() returns -EAGAIN?
> 
>  drop:
>  	if (ret == 0) {
> diff --git a/drivers/net/hyperv/rndis_filter.c 
> b/drivers/net/hyperv/rndis_filter.c
> index ca81de0..05f3792 100644
> --- a/drivers/net/hyperv/rndis_filter.c
> +++ b/drivers/net/hyperv/rndis_filter.c
> @@ -238,7 +238,7 @@ static int rndis_filter_send_request(struct 
> rndis_device *dev,
>  
>  	packet->send_completion = NULL;
>  
> -	ret = netvsc_send(dev->net_dev->dev, packet);
> +	ret = netvsc_send(dev->net_dev->dev, packet, true);
>  	return ret;
>  }
>  
> -- 
> 1.7.4.1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH V3 2/2 net-next] hyperv: Support batched notification
@ 2015-03-18  3:08       ` Jason Wang
  0 siblings, 0 replies; 17+ messages in thread
From: Jason Wang @ 2015-03-18  3:08 UTC (permalink / raw)
  To: K. Y. Srinivasan; +Cc: olaf, netdev, linux-kernel, apw, devel, davem



On Wed, Mar 18, 2015 at 12:02 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   |    2 +-
>  drivers/net/hyperv/rndis_filter.c |    2 +-
>  4 files changed, 12 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..eae58db 100644
> --- a/drivers/net/hyperv/netvsc_drv.c
> +++ b/drivers/net/hyperv/netvsc_drv.c
> @@ -556,7 +556,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, 
> !skb->xmit_more);
>  

Looks like the issue of V2 still there (E.g we need to kick when 
hv_ringbuffer_write() returns -EAGAIN?
> 
>  drop:
>  	if (ret == 0) {
> diff --git a/drivers/net/hyperv/rndis_filter.c 
> b/drivers/net/hyperv/rndis_filter.c
> index ca81de0..05f3792 100644
> --- a/drivers/net/hyperv/rndis_filter.c
> +++ b/drivers/net/hyperv/rndis_filter.c
> @@ -238,7 +238,7 @@ static int rndis_filter_send_request(struct 
> rndis_device *dev,
>  
>  	packet->send_completion = NULL;
>  
> -	ret = netvsc_send(dev->net_dev->dev, packet);
> +	ret = netvsc_send(dev->net_dev->dev, packet, true);
>  	return ret;
>  }
>  
> -- 
> 1.7.4.1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 17+ messages in thread

* RE: [PATCH V3 2/2 net-next] hyperv: Support batched notification
  2015-03-18  3:08       ` Jason Wang
@ 2015-03-19 16:53         ` KY Srinivasan
  -1 siblings, 0 replies; 17+ messages in thread
From: KY Srinivasan @ 2015-03-19 16:53 UTC (permalink / raw)
  To: Jason Wang; +Cc: davem, netdev, linux-kernel, devel, olaf, apw

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



> -----Original Message-----
> From: Jason Wang [mailto:jasowang@redhat.com]
> Sent: Tuesday, March 17, 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; KY Srinivasan
> Subject: Re: [PATCH V3 2/2 net-next] hyperv: Support batched notification
> 
> 
> 
> On Wed, Mar 18, 2015 at 12:02 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   |    2 +-
> >  drivers/net/hyperv/rndis_filter.c |    2 +-
> >  4 files changed, 12 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..eae58db 100644
> > --- a/drivers/net/hyperv/netvsc_drv.c
> > +++ b/drivers/net/hyperv/netvsc_drv.c
> > @@ -556,7 +556,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,
> > !skb->xmit_more);
> >
> 
> Looks like the issue of V2 still there (E.g we need to kick when
> hv_ringbuffer_write() returns -EAGAIN?

Jason, this issue will be handled in the lower layer. I have already submitted a patch to the vmbus
Driver that correctly signals the host when EAGAIN is encountered.

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¥

^ permalink raw reply	[flat|nested] 17+ messages in thread

* RE: [PATCH V3 2/2 net-next] hyperv: Support batched notification
@ 2015-03-19 16:53         ` KY Srinivasan
  0 siblings, 0 replies; 17+ messages in thread
From: KY Srinivasan @ 2015-03-19 16:53 UTC (permalink / raw)
  To: Jason Wang; +Cc: davem, netdev, linux-kernel, devel, olaf, apw



> -----Original Message-----
> From: Jason Wang [mailto:jasowang@redhat.com]
> Sent: Tuesday, March 17, 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; KY Srinivasan
> Subject: Re: [PATCH V3 2/2 net-next] hyperv: Support batched notification
> 
> 
> 
> On Wed, Mar 18, 2015 at 12:02 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   |    2 +-
> >  drivers/net/hyperv/rndis_filter.c |    2 +-
> >  4 files changed, 12 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..eae58db 100644
> > --- a/drivers/net/hyperv/netvsc_drv.c
> > +++ b/drivers/net/hyperv/netvsc_drv.c
> > @@ -556,7 +556,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,
> > !skb->xmit_more);
> >
> 
> Looks like the issue of V2 still there (E.g we need to kick when
> hv_ringbuffer_write() returns -EAGAIN?

Jason, this issue will be handled in the lower layer. I have already submitted a patch to the vmbus
Driver that correctly signals the host when EAGAIN is encountered.

Regards,

K. Y


^ permalink raw reply	[flat|nested] 17+ messages in thread

* RE: [PATCH V3 2/2 net-next] hyperv: Support batched notification
       [not found]         ` <BY2PR0301MB07114336B35924D353108197A0010@BY2PR0301MB0711.namprd03.prod.out look.com>
@ 2015-03-20  5:57           ` Jason Wang
  2015-03-20 14:01               ` KY Srinivasan
  0 siblings, 1 reply; 17+ messages in thread
From: Jason Wang @ 2015-03-20  5:57 UTC (permalink / raw)
  To: KY Srinivasan; +Cc: davem, netdev, linux-kernel, devel, olaf, apw



On Fri, Mar 20, 2015 at 12:53 AM, KY Srinivasan <kys@microsoft.com> 
wrote:
> 
> 
>>  -----Original Message-----
>>  From: Jason Wang [mailto:jasowang@redhat.com]
>>  Sent: Tuesday, March 17, 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; KY Srinivasan
>>  Subject: Re: [PATCH V3 2/2 net-next] hyperv: Support batched 
>> notification
>>  
>>  
>>  
>>  On Wed, Mar 18, 2015 at 12:02 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   |    2 +-
>>  >  drivers/net/hyperv/rndis_filter.c |    2 +-
>>  >  4 files changed, 12 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..eae58db 100644
>>  > --- a/drivers/net/hyperv/netvsc_drv.c
>>  > +++ b/drivers/net/hyperv/netvsc_drv.c
>>  > @@ -556,7 +556,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,
>>  > !skb->xmit_more);
>>  >
>>  
>>  Looks like the issue of V2 still there (E.g we need to kick when
>>  hv_ringbuffer_write() returns -EAGAIN?
> 
> Jason, this issue will be handled in the lower layer. I have already 
> submitted a patch to the vmbus
> Driver that correctly signals the host when EAGAIN is encountered.
> 
> Regards,
> 
> K. Y

Okay, find the mail but looks like I was not cced.

Please keep me in the cc list for hyperv patches.

Thanks


^ permalink raw reply	[flat|nested] 17+ messages in thread

* RE: [PATCH V3 2/2 net-next] hyperv: Support batched notification
  2015-03-20  5:57           ` Jason Wang
@ 2015-03-20 14:01               ` KY Srinivasan
  0 siblings, 0 replies; 17+ messages in thread
From: KY Srinivasan @ 2015-03-20 14:01 UTC (permalink / raw)
  To: Jason Wang; +Cc: davem, netdev, linux-kernel, devel, olaf, apw

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



> -----Original Message-----
> From: Jason Wang [mailto:jasowang@redhat.com]
> Sent: Thursday, March 19, 2015 10:58 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
> Subject: RE: [PATCH V3 2/2 net-next] hyperv: Support batched notification
> 
> 
> 
> On Fri, Mar 20, 2015 at 12:53 AM, KY Srinivasan <kys@microsoft.com>
> wrote:
> >
> >
> >>  -----Original Message-----
> >>  From: Jason Wang [mailto:jasowang@redhat.com]
> >>  Sent: Tuesday, March 17, 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; KY Srinivasan
> >>  Subject: Re: [PATCH V3 2/2 net-next] hyperv: Support batched
> >> notification
> >>
> >>
> >>
> >>  On Wed, Mar 18, 2015 at 12:02 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   |    2 +-
> >>  >  drivers/net/hyperv/rndis_filter.c |    2 +-
> >>  >  4 files changed, 12 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..eae58db 100644
> >>  > --- a/drivers/net/hyperv/netvsc_drv.c
> >>  > +++ b/drivers/net/hyperv/netvsc_drv.c
> >>  > @@ -556,7 +556,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,
> >>  > !skb->xmit_more);
> >>  >
> >>
> >>  Looks like the issue of V2 still there (E.g we need to kick when
> >>  hv_ringbuffer_write() returns -EAGAIN?
> >
> > Jason, this issue will be handled in the lower layer. I have already
> > submitted a patch to the vmbus
> > Driver that correctly signals the host when EAGAIN is encountered.
> >
> > Regards,
> >
> > K. Y
> 
> Okay, find the mail but looks like I was not cced.
> 
> Please keep me in the cc list for hyperv patches.

Sorry about that; will do.

K. Y
> 
> Thanks

ÿôèº{.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¥

^ permalink raw reply	[flat|nested] 17+ messages in thread

* RE: [PATCH V3 2/2 net-next] hyperv: Support batched notification
@ 2015-03-20 14:01               ` KY Srinivasan
  0 siblings, 0 replies; 17+ messages in thread
From: KY Srinivasan @ 2015-03-20 14:01 UTC (permalink / raw)
  To: Jason Wang; +Cc: davem, netdev, linux-kernel, devel, olaf, apw



> -----Original Message-----
> From: Jason Wang [mailto:jasowang@redhat.com]
> Sent: Thursday, March 19, 2015 10:58 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
> Subject: RE: [PATCH V3 2/2 net-next] hyperv: Support batched notification
> 
> 
> 
> On Fri, Mar 20, 2015 at 12:53 AM, KY Srinivasan <kys@microsoft.com>
> wrote:
> >
> >
> >>  -----Original Message-----
> >>  From: Jason Wang [mailto:jasowang@redhat.com]
> >>  Sent: Tuesday, March 17, 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; KY Srinivasan
> >>  Subject: Re: [PATCH V3 2/2 net-next] hyperv: Support batched
> >> notification
> >>
> >>
> >>
> >>  On Wed, Mar 18, 2015 at 12:02 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   |    2 +-
> >>  >  drivers/net/hyperv/rndis_filter.c |    2 +-
> >>  >  4 files changed, 12 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..eae58db 100644
> >>  > --- a/drivers/net/hyperv/netvsc_drv.c
> >>  > +++ b/drivers/net/hyperv/netvsc_drv.c
> >>  > @@ -556,7 +556,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,
> >>  > !skb->xmit_more);
> >>  >
> >>
> >>  Looks like the issue of V2 still there (E.g we need to kick when
> >>  hv_ringbuffer_write() returns -EAGAIN?
> >
> > Jason, this issue will be handled in the lower layer. I have already
> > submitted a patch to the vmbus
> > Driver that correctly signals the host when EAGAIN is encountered.
> >
> > Regards,
> >
> > K. Y
> 
> Okay, find the mail but looks like I was not cced.
> 
> Please keep me in the cc list for hyperv patches.

Sorry about that; will do.

K. Y
> 
> Thanks


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2015-03-20 14:01 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-17 16:02 [PATCH V3 0/2 net-next] hyperv: Enable batched notification K. Y. Srinivasan
2015-03-17 16:02 ` [PATCH V3 1/2 net-next] Drivers: hv: vmbus: Export the vmbus_sendpacket_pagebuffer_ctl() K. Y. Srinivasan
2015-03-17 16:02   ` K. Y. Srinivasan
2015-03-17 16:02   ` [PATCH V3 2/2 net-next] hyperv: Support batched notification K. Y. Srinivasan
2015-03-18  3:08     ` Jason Wang
2015-03-18  3:08       ` Jason Wang
2015-03-19 16:53       ` KY Srinivasan
2015-03-19 16:53         ` KY Srinivasan
     [not found]         ` <BY2PR0301MB07114336B35924D353108197A0010@BY2PR0301MB0711.namprd03.prod.out look.com>
2015-03-20  5:57           ` Jason Wang
2015-03-20 14:01             ` KY Srinivasan
2015-03-20 14:01               ` KY Srinivasan
2015-03-17 19:23 ` [PATCH V3 0/2 net-next] hyperv: Enable " David Miller
2015-03-17 19:26   ` KY Srinivasan
2015-03-17 20:07     ` KY Srinivasan
2015-03-17 21:37       ` David Miller
2015-03-17 21:39         ` KY Srinivasan
2015-03-17 21:39           ` KY Srinivasan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.