linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] sh_eth: NAPI requires netif_receive_skb()
@ 2013-09-02 23:03 Sergei Shtylyov
  2013-09-04 18:12 ` David Miller
  0 siblings, 1 reply; 5+ messages in thread
From: Sergei Shtylyov @ 2013-09-02 23:03 UTC (permalink / raw)
  To: netdev; +Cc: nobuhiro.iwamatsu.yj, linux-sh

Driver supporting NAPI should use NAPI-specific function for receiving packets,
so netif_rx() should be changed to netif_receive_skb().

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

---
This patch is against Dave's 'net-next.git' repo (it also applies to 'net.git'
with offset). Perhaps it should  be backported to 3.11 once it is out...

 drivers/net/ethernet/renesas/sh_eth.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: net-next/drivers/net/ethernet/renesas/sh_eth.c
=================================--- net-next.orig/drivers/net/ethernet/renesas/sh_eth.c
+++ net-next/drivers/net/ethernet/renesas/sh_eth.c
@@ -1347,7 +1347,7 @@ static int sh_eth_rx(struct net_device *
 				skb_reserve(skb, NET_IP_ALIGN);
 			skb_put(skb, pkt_len);
 			skb->protocol = eth_type_trans(skb, ndev);
-			netif_rx(skb);
+			netif_receive_skb(skb);
 			ndev->stats.rx_packets++;
 			ndev->stats.rx_bytes += pkt_len;
 		}

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

* Re: [PATCH] sh_eth: NAPI requires netif_receive_skb()
  2013-09-02 23:03 [PATCH] sh_eth: NAPI requires netif_receive_skb() Sergei Shtylyov
@ 2013-09-04 18:12 ` David Miller
  2013-09-26 16:12   ` Guennadi Liakhovetski
  0 siblings, 1 reply; 5+ messages in thread
From: David Miller @ 2013-09-04 18:12 UTC (permalink / raw)
  To: sergei.shtylyov; +Cc: netdev, nobuhiro.iwamatsu.yj, linux-sh

From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Date: Tue, 3 Sep 2013 03:03:10 +0400

> Driver supporting NAPI should use NAPI-specific function for receiving packets,
> so netif_rx() should be changed to netif_receive_skb().
> 
> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

Applied.

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

* Re: [PATCH] sh_eth: NAPI requires netif_receive_skb()
  2013-09-04 18:12 ` David Miller
@ 2013-09-26 16:12   ` Guennadi Liakhovetski
  2013-09-26 16:59     ` Eric Dumazet
  2013-10-08 20:53     ` Sergei Shtylyov
  0 siblings, 2 replies; 5+ messages in thread
From: Guennadi Liakhovetski @ 2013-09-26 16:12 UTC (permalink / raw)
  To: David Miller; +Cc: sergei.shtylyov, netdev, nobuhiro.iwamatsu.yj, linux-sh

Hi

On Wed, 4 Sep 2013, David Miller wrote:

> From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
> Date: Tue, 3 Sep 2013 03:03:10 +0400
> 
> > Driver supporting NAPI should use NAPI-specific function for receiving packets,
> > so netif_rx() should be changed to netif_receive_skb().
> > 
> > Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

This patch breaks NFS boot on Armadillo800eva for me. Network 
communication slows down to a crawl with

net eth0: Receive FIFO Overflow
nfs: server 192.168.x.y not responding, still trying

With this patch reverted (e.g. in today's Linus tree snapshot) boot is 
restored.

Thanks
Guennadi

> Applied.

---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/

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

* Re: [PATCH] sh_eth: NAPI requires netif_receive_skb()
  2013-09-26 16:12   ` Guennadi Liakhovetski
@ 2013-09-26 16:59     ` Eric Dumazet
  2013-10-08 20:53     ` Sergei Shtylyov
  1 sibling, 0 replies; 5+ messages in thread
From: Eric Dumazet @ 2013-09-26 16:59 UTC (permalink / raw)
  To: Guennadi Liakhovetski
  Cc: David Miller, sergei.shtylyov, netdev, nobuhiro.iwamatsu.yj,
	linux-sh

On Thu, 2013-09-26 at 18:12 +0200, Guennadi Liakhovetski wrote:
> Hi
> 
> On Wed, 4 Sep 2013, David Miller wrote:
> 
> > From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
> > Date: Tue, 3 Sep 2013 03:03:10 +0400
> > 
> > > Driver supporting NAPI should use NAPI-specific function for receiving packets,
> > > so netif_rx() should be changed to netif_receive_skb().
> > > 
> > > Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
> 
> This patch breaks NFS boot on Armadillo800eva for me. Network 
> communication slows down to a crawl with
> 
> net eth0: Receive FIFO Overflow
> nfs: server 192.168.x.y not responding, still trying
> 
> With this patch reverted (e.g. in today's Linus tree snapshot) boot is 
> restored.

RX_RING_SIZE is 64

This driver refills the Rx ring buffers only _after_ the loop to drain
ready buffers. This was OK with the previous behavior (netif_rx() is
damn fast)

With this low amount of buffers, underrun can happen with the new code,
as netif_receive_skb() adds delay during the drain.

Most likely driver needs to refill buffers one by one (or small batches)
instead of in one go after the drain.






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

* Re: [PATCH] sh_eth: NAPI requires netif_receive_skb()
  2013-09-26 16:12   ` Guennadi Liakhovetski
  2013-09-26 16:59     ` Eric Dumazet
@ 2013-10-08 20:53     ` Sergei Shtylyov
  1 sibling, 0 replies; 5+ messages in thread
From: Sergei Shtylyov @ 2013-10-08 20:53 UTC (permalink / raw)
  To: Guennadi Liakhovetski
  Cc: David Miller, netdev, nobuhiro.iwamatsu.yj, linux-sh

Hello.

On 26-09-2013 18:12, Guennadi Liakhovetski wrote:

>> From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
>> Date: Tue, 3 Sep 2013 03:03:10 +0400

>>> Driver supporting NAPI should use NAPI-specific function for receiving packets,
>>> so netif_rx() should be changed to netif_receive_skb().

>>> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

> This patch breaks NFS boot on Armadillo800eva for me. Network
> communication slows down to a crawl with

> net eth0: Receive FIFO Overflow
> nfs: server 192.168.x.y not responding, still trying

> With this patch reverted (e.g. in today's Linus tree snapshot) boot is
> restored.

    Guennadi, are you expecting some actions (like looking into what Eric have 
suggested) from me? If so, I'm still on vacation, should be back next Tuesday.
    I don't think reverting the patch is a Right Thing to do.

> Thanks
> Guennadi

WBR, Sergei


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

end of thread, other threads:[~2013-10-08 20:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-02 23:03 [PATCH] sh_eth: NAPI requires netif_receive_skb() Sergei Shtylyov
2013-09-04 18:12 ` David Miller
2013-09-26 16:12   ` Guennadi Liakhovetski
2013-09-26 16:59     ` Eric Dumazet
2013-10-08 20:53     ` Sergei Shtylyov

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).