From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: David Miller <davem@davemloft.net>
Cc: johannes@sipsolutions.net, netdev@vger.kernel.org
Subject: Re: sungem triggers NAPI warning
Date: Sun, 23 Mar 2008 23:07:37 +1100 [thread overview]
Message-ID: <1206274057.7197.23.camel@pasglop> (raw)
In-Reply-To: <20080323.033558.118223124.davem@davemloft.net>
On Sun, 2008-03-23 at 03:35 -0700, David Miller wrote:
> 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 :-)
OOps... sorry.
> 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;
prev parent reply other threads:[~2008-03-23 12:08 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
2008-03-23 12:07 ` Benjamin Herrenschmidt [this message]
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=1206274057.7197.23.camel@pasglop \
--to=benh@kernel.crashing.org \
--cc=davem@davemloft.net \
--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 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).