From: Stephen Hemminger <shemminger@linux-foundation.org>
To: Andrew Gallatin <gallatin@myri.com>
Cc: jeff@garzik.org, netdev@vger.kernel.org
Subject: Re: [PATCH]: Fix myri10ge NAPI oops & warnings
Date: Wed, 31 Oct 2007 14:44:12 -0700 [thread overview]
Message-ID: <20071031144412.723910ba@freepuppy.rosehill> (raw)
In-Reply-To: <4728F636.9080505@myri.com>
On Wed, 31 Oct 2007 17:40:06 -0400
Andrew Gallatin <gallatin@myri.com> wrote:
>
> When testing the myri10ge driver with 2.6.24-rc1, I found
> that the machine crashed under heavy load:
>
> Unable to handle kernel paging request at 0000000000100108 RIP:
> [<ffffffff803cc8dd>] net_rx_action+0x11b/0x184
>
> The address corresponds to the list_move_tail() in
> netif_rx_complete():
> if (unlikely(work == weight))
> list_move_tail(&n->poll_list, list);
>
> Eventually, I traced the crashes to calling netif_rx_complete() with
> work_done == budget. From looking at other drivers, it appears that
> one should only call netif_rx_complete() when work_done < budget.
>
> To fix it, I changed the test in myri10ge_poll() so that it refers
> to to work_done rather than looking at the rx ring status. If
> work_done is < budget, then that implies we have no more packets to
> process. Any races will be resolved by the NIC when the write to
> irq_claim is made.
>
> In myri10ge_clean_rx_done(), if we ever exceeded our budget, it would
> report a work_done one larger than was acutally done. This is because
> the increment was done in the conditional, so work_done would be
> incremented regardless of whether or not the test passed or failed.
> This would lead to the WARN_ON_ONCE(work > weight); warning in
> net_rx_action triggering. I've moved the increment of work_done
> inside the loop. Note that this would only be a problem when we had
> exceeded our budget.
>
> Signed off by: Andrew Gallatin <gallatin@myri.com>
>
> Andrew Gallatin Myricom Inc
>
>
Yes, this looks right.
How could the check in netif_rx_complete be changed to catch this better?
--
Stephen Hemminger <shemminger@linux-foundation.org>
next prev parent reply other threads:[~2007-10-31 21:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-31 21:40 [PATCH]: Fix myri10ge NAPI oops & warnings Andrew Gallatin
2007-10-31 21:44 ` Stephen Hemminger [this message]
2007-10-31 22:54 ` Andrew Gallatin
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=20071031144412.723910ba@freepuppy.rosehill \
--to=shemminger@linux-foundation.org \
--cc=gallatin@myri.com \
--cc=jeff@garzik.org \
--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).