All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: johannes@sipsolutions.net
Cc: netdev@vger.kernel.org, benh@kernel.crashing.org
Subject: Re: sungem triggers NAPI warning
Date: Sun, 23 Mar 2008 03:35:58 -0700 (PDT)	[thread overview]
Message-ID: <20080323.033558.118223124.davem@davemloft.net> (raw)
In-Reply-To: <1203457124.3874.2.camel@johannes.berg>

From: Johannes Berg <johannes@sipsolutions.net>
Date: Tue, 19 Feb 2008 22:38:43 +0100

> In order to trigger it, I have to transfer a lot of data. I have
> triggered it now with a full kernel recompilation using -j6 and distcc
> onto a fast machine (with tg3 network, direct cable, gbit), and with
> rsync transferring 26GiB data between the machines.

I'll push the following fix.

Ben, thanks for letting this fall through the cracks :-)

commit da990a2402aeaee84837f29054c4628eb02f7493
Author: David S. Miller <davem@davemloft.net>
Date:   Sun Mar 23 03:35:12 2008 -0700

    [SUNGEM]: Fix NAPI assertion failure.
    
    As reported by Johannes Berg:
    
    I started getting this warning with recent kernels:
    
    [  773.908927] ------------[ cut here ]------------
    [  773.908954] Badness at net/core/dev.c:2204
     ...
    
    If we loop more than once in gem_poll(), we'll
    use more than the real budget in our gem_rx()
    calls, thus eventually trigger the caller's
    assertions in net_rx_action().
    
    Subtract "work_done" from "budget" for the second
    arg to gem_rx() to fix the bug.
    
    Signed-off-by: David S. Miller <davem@davemloft.net>

diff --git a/drivers/net/sungem.c b/drivers/net/sungem.c
index 9721279..4291458 100644
--- a/drivers/net/sungem.c
+++ b/drivers/net/sungem.c
@@ -912,7 +912,7 @@ static int gem_poll(struct napi_struct *napi, int budget)
 		 * rx ring - must call napi_disable(), which
 		 * schedule_timeout()'s if polling is already disabled.
 		 */
-		work_done += gem_rx(gp, budget);
+		work_done += gem_rx(gp, budget - work_done);
 
 		if (work_done >= budget)
 			return work_done;

  parent reply	other threads:[~2008-03-23 10:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-19 21:38 sungem triggers NAPI warning Johannes Berg
2008-02-21  2:54 ` Benjamin Herrenschmidt
2008-02-21 13:05   ` Johannes Berg
2008-02-21 22:50     ` Benjamin Herrenschmidt
2008-02-24  3:58       ` David Miller
2008-02-24  4:43         ` Benjamin Herrenschmidt
2008-03-23 10:35 ` David Miller [this message]
2008-03-23 12:07   ` Benjamin Herrenschmidt

Reply instructions:

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

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

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

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

  git send-email \
    --in-reply-to=20080323.033558.118223124.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=benh@kernel.crashing.org \
    --cc=johannes@sipsolutions.net \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

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

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.