public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH v2,1/1] net/hyperv: Fix the code handling tx busy
  2012-03-19 21:23 ` [PATCH v2,1/1] " Haiyang Zhang
@ 2012-03-19 21:23   ` Eric Dumazet
  2012-03-19 21:27     ` David Miller
  0 siblings, 1 reply; 4+ messages in thread
From: Eric Dumazet @ 2012-03-19 21:23 UTC (permalink / raw)
  To: Haiyang Zhang; +Cc: devel, netdev, davem, linux-kernel

On Mon, 2012-03-19 at 14:23 -0700, Haiyang Zhang wrote:
> Instead of dropping the packet, we keep the skb buffer, and return
> NETDEV_TX_BUSY to let upper layer retry send. This will not cause
> endless loop, because the host is taking data away from ring buffer,
> and we have called the stop_queue before returning NETDEV_TX_BUSY.
> 
> The stop_queue was called in the function netvsc_send() in file 
> netvsc.c, then it returns to rndis_filter_send(), which returns to
> netvsc_start_xmit() in file netvsc_drv.c. So the NETDEV_TX_BUSY is
> indeed returned AFTER queue is stopped.
> 
> Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
> Reviewed-by: K. Y. Srinivasan <kys@microsoft.com>
> ---

Thanks 

Acked-by: Eric Dumazet <eric.dumazet@gmail.com>

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

* [PATCH v2,0/1] net/hyperv: Fix the code handling tx busy
@ 2012-03-19 21:23 Haiyang Zhang
  2012-03-19 21:23 ` [PATCH v2,1/1] " Haiyang Zhang
  0 siblings, 1 reply; 4+ messages in thread
From: Haiyang Zhang @ 2012-03-19 21:23 UTC (permalink / raw)
  To: haiyangz, kys, davem, netdev, linux-kernel, devel

note: This patch is targeting 'net-next' tree.

The change log has been updated. Thanks to Eric Dumazet 
<eric.dumazet@gmail.com> and Stephen Hemminger <shemminger@vyatta.com>
for their suggestions.

Haiyang Zhang (1):
  net/hyperv: Fix the code handling tx busy

 drivers/net/hyperv/netvsc_drv.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)

-- 
1.7.4.1

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

* [PATCH v2,1/1] net/hyperv: Fix the code handling tx busy
  2012-03-19 21:23 [PATCH v2,0/1] net/hyperv: Fix the code handling tx busy Haiyang Zhang
@ 2012-03-19 21:23 ` Haiyang Zhang
  2012-03-19 21:23   ` Eric Dumazet
  0 siblings, 1 reply; 4+ messages in thread
From: Haiyang Zhang @ 2012-03-19 21:23 UTC (permalink / raw)
  To: haiyangz, kys, davem, netdev, linux-kernel, devel

Instead of dropping the packet, we keep the skb buffer, and return
NETDEV_TX_BUSY to let upper layer retry send. This will not cause
endless loop, because the host is taking data away from ring buffer,
and we have called the stop_queue before returning NETDEV_TX_BUSY.

The stop_queue was called in the function netvsc_send() in file 
netvsc.c, then it returns to rndis_filter_send(), which returns to
netvsc_start_xmit() in file netvsc_drv.c. So the NETDEV_TX_BUSY is
indeed returned AFTER queue is stopped.

Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Reviewed-by: K. Y. Srinivasan <kys@microsoft.com>
---
 drivers/net/hyperv/netvsc_drv.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
index 2517d20..dd29478 100644
--- a/drivers/net/hyperv/netvsc_drv.c
+++ b/drivers/net/hyperv/netvsc_drv.c
@@ -223,13 +223,10 @@ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net)
 		net->stats.tx_bytes += skb->len;
 		net->stats.tx_packets++;
 	} else {
-		/* we are shutting down or bus overloaded, just drop packet */
-		net->stats.tx_dropped++;
 		kfree(packet);
-		dev_kfree_skb_any(skb);
 	}
 
-	return NETDEV_TX_OK;
+	return ret ? NETDEV_TX_BUSY : NETDEV_TX_OK;
 }
 
 /*
-- 
1.7.4.1

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

* Re: [PATCH v2,1/1] net/hyperv: Fix the code handling tx busy
  2012-03-19 21:23   ` Eric Dumazet
@ 2012-03-19 21:27     ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2012-03-19 21:27 UTC (permalink / raw)
  To: eric.dumazet; +Cc: netdev, haiyangz, linux-kernel, devel

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Mon, 19 Mar 2012 14:23:11 -0700

> On Mon, 2012-03-19 at 14:23 -0700, Haiyang Zhang wrote:
>> Instead of dropping the packet, we keep the skb buffer, and return
>> NETDEV_TX_BUSY to let upper layer retry send. This will not cause
>> endless loop, because the host is taking data away from ring buffer,
>> and we have called the stop_queue before returning NETDEV_TX_BUSY.
>> 
>> The stop_queue was called in the function netvsc_send() in file 
>> netvsc.c, then it returns to rndis_filter_send(), which returns to
>> netvsc_start_xmit() in file netvsc_drv.c. So the NETDEV_TX_BUSY is
>> indeed returned AFTER queue is stopped.
>> 
>> Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
>> Reviewed-by: K. Y. Srinivasan <kys@microsoft.com>
>> ---
> 
> Thanks 
> 
> Acked-by: Eric Dumazet <eric.dumazet@gmail.com>

Applied.

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

end of thread, other threads:[~2012-03-19 21:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-19 21:23 [PATCH v2,0/1] net/hyperv: Fix the code handling tx busy Haiyang Zhang
2012-03-19 21:23 ` [PATCH v2,1/1] " Haiyang Zhang
2012-03-19 21:23   ` Eric Dumazet
2012-03-19 21:27     ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox