Skip to contentSkip to conversation

hyperv: Enable batched notification

PATCH In review K. Y. Srinivasan 4 participants 12 messages Mar 17, 2015 – Mar 20, 2015 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

v3 cover hyperv: Enable batched notification

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 <[email protected]>.

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(-)
Signature · 1 line
1.7.4.1
#1 lore raw

PATCH v3 1/2 Drivers: hv: vmbus: Export the vmbus_sendpacket_pagebuffer_ctl()

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

---
 drivers/hv/channel.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/hv/channel.c +1 -0
index da53180..e58cdb7 100644
@@ -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
Signature · 1 line
1.7.4.1
#2 lore raw

PATCH v3 2/2 hyperv: Support batched notification

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.

---
 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(-)
drivers/net/hyperv/hyperv_net.h +1 -1
index 4815843..3fd9896 100644
@@ -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,
drivers/net/hyperv/netvsc.c +9 -5
index 208eb05..9003b94 100644
@@ -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) {
drivers/net/hyperv/netvsc_drv.c +1 -1
index a06bd66..eae58db 100644
@@ -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) {
drivers/net/hyperv/rndis_filter.c +1 -1
index ca81de0..05f3792 100644
@@ -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;
 }
 
Signature · 1 line
1.7.4.1
#3 lore raw

Re: [PATCH V3 2/2 net-next] hyperv: Support batched notification

Quoted 79 lines · 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.

---
 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(-)
drivers/net/hyperv/hyperv_net.h +1 -1
index 4815843..3fd9896 100644
@@ -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,

drivers/net/hyperv/netvsc.c +1 -1
index 208eb05..9003b94 100644
@@ -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;
drivers/net/hyperv/netvsc.c +8 -4
 	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) {
drivers/net/hyperv/netvsc_drv.c +0 -0
index a06bd66..eae58db 100644

drivers/net/hyperv/netvsc_drv.c do_send: · line 561

Quoted 7 lines
drivers/net/hyperv/netvsc_drv.c +1 -1
@@ -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?

Quoted 24 lines
drivers/net/hyperv/netvsc_drv.c +0 -0
 drop:
drivers/net/hyperv/netvsc_drv.c +0 -0
 	if (ret == 0) {
drivers/net/hyperv/rndis_filter.c +1 -1
index ca81de0..05f3792 100644
@@ -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;
 }
Signature · 7 lines
-- 
1.7.4.1

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#4 lore raw

RE: [PATCH V3 2/2 net-next] hyperv: Support batched notification

Quoted 104 lines

-----Original Message-----
From: Jason Wang [mailto:[email protected]]
Sent: Tuesday, March 17, 2015 8:09 PM
To: KY Srinivasan
Cc: [email protected]; [email protected]; linux- [email protected]; [email protected]; [email protected]; [email protected]; KY Srinivasan
Subject: Re: [PATCH V3 2/2 net-next] hyperv: Support batched notification

Quoted 43 lines · 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.

---
 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(-)
drivers/net/hyperv/hyperv_net.h +1 -1
index 4815843..3fd9896 100644
@@ -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,

drivers/net/hyperv/netvsc.c +1 -1
index 208eb05..9003b94 100644
@@ -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;
drivers/net/hyperv/netvsc.c +0 -0
 	int ret = 0;

drivers/net/hyperv/netvsc.c int netvsc_send(struct hv_device *device, · line 722

Quoted 4 lines
drivers/net/hyperv/netvsc.c +1 -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;

drivers/net/hyperv/netvsc.c int netvsc_send(struct hv_device *device, · line 776

Quoted 13 lines
drivers/net/hyperv/netvsc.c +1 -1
 	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),

drivers/net/hyperv/netvsc.c int netvsc_send(struct hv_device *device,

Quoted 11 lines
drivers/net/hyperv/netvsc.c +4 -3
-						  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);

drivers/net/hyperv/netvsc_drv.c do_send: · line 556

Quoted 12 lines
drivers/net/hyperv/netvsc.c +2 -0
+				vmbus_flags,
+				kick_q);
 	}
 
 	if (ret == 0) {
drivers/net/hyperv/netvsc_drv.c +0 -0
index a06bd66..eae58db 100644
@@ -556,7 +556,7 @@ do_send:
 	packet->page_buf_cnt = init_page_array(rndis_msg,

rndis_msg_size,

Quoted 2 lines
drivers/net/hyperv/netvsc_drv.c +0 -0
 					skb, &packet->page_buf[0]);
 
Quoted 7 lines

drivers/net/hyperv/netvsc_drv.c do_send: · line 560

Quoted 4 lines
drivers/net/hyperv/netvsc_drv.c +1 -1
-	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

A message that is not in the archive (sent off-list or not yet received): BY2PR0301MB07114336B35924D353108197A0010@BY2PR0301MB0711.namprd03.prod.out look.com

#6 lore raw

RE: [PATCH V3 2/2 net-next] hyperv: Support batched notification

Quoted 116 lines · KY Srinivasan
Quoted 108 lines

-----Original Message-----
From: Jason Wang [mailto:[email protected]]
Sent: Tuesday, March 17, 2015 8:09 PM
To: KY Srinivasan
Cc: [email protected]; [email protected]; linux- [email protected]; [email protected];
[email protected];
[email protected]; KY Srinivasan
Subject: Re: [PATCH V3 2/2 net-next] hyperv: Support batched
notification

Quoted 28 lines · 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.

---
 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(-)
drivers/net/hyperv/hyperv_net.h +1 -1
index 4815843..3fd9896 100644
@@ -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,

Review

Quoted 1 line
(quoted diff) +0 -0

b/drivers/net/hyperv/netvsc.c

Quoted 14 lines

index 208eb05..9003b94 100644

drivers/net/hyperv/netvsc.c +1 -1
@@ -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;
drivers/net/hyperv/netvsc.c +0 -0
 	int ret = 0;

drivers/net/hyperv/netvsc.c int netvsc_send(struct hv_device *device, · line 722

Quoted 4 lines
drivers/net/hyperv/netvsc.c +1 -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;

drivers/net/hyperv/netvsc.c int netvsc_send(struct hv_device *device, · line 776

Quoted 13 lines
drivers/net/hyperv/netvsc.c +1 -1
 	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),

drivers/net/hyperv/netvsc.c int netvsc_send(struct hv_device *device,

Quoted 11 lines
drivers/net/hyperv/netvsc.c +4 -3
-						  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);

drivers/net/hyperv/netvsc_drv.c do_send: · line 556

Quoted 12 lines
drivers/net/hyperv/netvsc.c +2 -0
+				vmbus_flags,
+				kick_q);
 	}
 
 	if (ret == 0) {
drivers/net/hyperv/netvsc_drv.c +0 -0
index a06bd66..eae58db 100644
@@ -556,7 +556,7 @@ do_send:
 	packet->page_buf_cnt = init_page_array(rndis_msg,

rndis_msg_size,

Quoted 2 lines
drivers/net/hyperv/netvsc_drv.c +0 -0
 					skb, &packet->page_buf[0]);
 
Quoted 7 lines

drivers/net/hyperv/netvsc_drv.c do_send: · line 560

Quoted 4 lines
drivers/net/hyperv/netvsc_drv.c +1 -1
-	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?

Quoted 6 lines

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

#7 lore raw

RE: [PATCH V3 2/2 net-next] hyperv: Support batched notification

Quoted 135 lines

-----Original Message-----
From: Jason Wang [mailto:[email protected]]
Sent: Thursday, March 19, 2015 10:58 PM
To: KY Srinivasan
Cc: [email protected]; [email protected]; linux- [email protected]; [email protected]; [email protected]; [email protected]
Subject: RE: [PATCH V3 2/2 net-next] hyperv: Support batched notification

Quoted 120 lines · KY Srinivasan
Quoted 108 lines

-----Original Message-----
From: Jason Wang [mailto:[email protected]]
Sent: Tuesday, March 17, 2015 8:09 PM
To: KY Srinivasan
Cc: [email protected]; [email protected]; linux- [email protected]; [email protected];
[email protected];
[email protected]; KY Srinivasan
Subject: Re: [PATCH V3 2/2 net-next] hyperv: Support batched
notification

Quoted 28 lines · 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.

---
 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(-)
drivers/net/hyperv/hyperv_net.h +1 -1
index 4815843..3fd9896 100644
@@ -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,

Review

Quoted 1 line
(quoted diff) +0 -0

b/drivers/net/hyperv/netvsc.c

Quoted 14 lines

index 208eb05..9003b94 100644

drivers/net/hyperv/netvsc.c +1 -1
@@ -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;
drivers/net/hyperv/netvsc.c +0 -0
 	int ret = 0;

drivers/net/hyperv/netvsc.c int netvsc_send(struct hv_device *device, · line 722

Quoted 4 lines
drivers/net/hyperv/netvsc.c +1 -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;

drivers/net/hyperv/netvsc.c int netvsc_send(struct hv_device *device, · line 776

Quoted 13 lines
drivers/net/hyperv/netvsc.c +1 -1
 	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),

drivers/net/hyperv/netvsc.c int netvsc_send(struct hv_device *device,

Quoted 11 lines
drivers/net/hyperv/netvsc.c +4 -3
-						  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);

drivers/net/hyperv/netvsc_drv.c do_send: · line 556

Quoted 12 lines
drivers/net/hyperv/netvsc.c +2 -0
+				vmbus_flags,
+				kick_q);
 	}
 
 	if (ret == 0) {
drivers/net/hyperv/netvsc_drv.c +0 -0
index a06bd66..eae58db 100644
@@ -556,7 +556,7 @@ do_send:
 	packet->page_buf_cnt = init_page_array(rndis_msg,

rndis_msg_size,

Quoted 2 lines
drivers/net/hyperv/netvsc_drv.c +0 -0
 					skb, &packet->page_buf[0]);
 
Quoted 7 lines

drivers/net/hyperv/netvsc_drv.c do_send: · line 560

Quoted 4 lines
drivers/net/hyperv/netvsc_drv.c +1 -1
-	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.

Quoted 7 lines
Quoted 3 lines

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

Quoted 2 lines

Thanks

#8 lore raw
In reply to K. Y. Srinivasan

From: "K. Y. Srinivasan" <[email protected]>
Date: Tue, 17 Mar 2015 09:02:25 -0700

Quoted 11 lines

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 <[email protected]>.

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

#9 lore raw
Quoted 21 lines

-----Original Message-----
From: David Miller [mailto:[email protected]]
Sent: Tuesday, March 17, 2015 12:23 PM
To: KY Srinivasan
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH V3 0/2 net-next] hyperv: Enable batched notification

From: "K. Y. Srinivasan" <[email protected]>
Date: Tue, 17 Mar 2015 09:02:25 -0700

Quoted 4 lines

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

Quoted 1 line

patch-set, that API is exported so it can be used in the netvsc driver. Greg

has

Quoted 8 lines
Quoted 6 lines

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 <[email protected]>.

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

I will rebase this and send it.

Thanks,

K. Y

#10 lore raw
Quoted 34 lines

-----Original Message-----
From: devel [mailto:[email protected]] On Behalf Of KY Srinivasan
Sent: Tuesday, March 17, 2015 12:26 PM
To: David Miller
Cc: [email protected]; [email protected]; [email protected]; linux- [email protected]; [email protected]; [email protected]
Subject: RE: [PATCH V3 0/2 net-next] hyperv: Enable batched notification

Quoted 21 lines

-----Original Message-----
From: David Miller [mailto:[email protected]]
Sent: Tuesday, March 17, 2015 12:23 PM
To: KY Srinivasan
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH V3 0/2 net-next] hyperv: Enable batched notification

From: "K. Y. Srinivasan" <[email protected]>
Date: Tue, 17 Mar 2015 09:02:25 -0700

Quoted 4 lines

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

Quoted 1 line

patch-set, that API is exported so it can be used in the netvsc driver. Greg

has

Quoted 2 lines

acked this export.

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines

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 <[email protected]>.

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

Quoted 8 lines

Thanks,

K. Y
_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

maintainer
#11 lore raw

From: KY Srinivasan <[email protected]>
Date: Tue, 17 Mar 2015 20:07:10 +0000

Quoted 9 lines

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.

Quoted 4 lines

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.

#12 lore raw
Quoted 28 lines

-----Original Message-----
From: David Miller [mailto:[email protected]]
Sent: Tuesday, March 17, 2015 2:37 PM
To: KY Srinivasan
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH V3 0/2 net-next] hyperv: Enable batched notification

From: KY Srinivasan <[email protected]>
Date: Tue, 17 Mar 2015 20:07:10 +0000

Quoted 4 lines

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

Quoted 1 line

is in Greg's tree. This patch merely exports an API that is already in Greg's

tree.

Quoted 7 lines

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

Quoted 8 lines
Quoted 1 line

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