netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "David S. Miller" <davem@redhat.com>
To: jt@hpl.hp.com
Cc: jt@bougret.hpl.hp.com, linux-kernel@vger.kernel.org,
	tsbogend@alpha.franken.de, jgarzik@pobox.com, netdev@oss.sgi.com
Subject: Re: [BUG 2.6.0-test11] pcnet32 oops
Date: Fri, 5 Dec 2003 16:59:00 -0800	[thread overview]
Message-ID: <20031205165900.2920ea6a.davem@redhat.com> (raw)
In-Reply-To: <20031205234510.GA2319@bougret.hpl.hp.com>

On Fri, 5 Dec 2003 15:45:10 -0800
Jean Tourrilhes <jt@bougret.hpl.hp.com> wrote:

> Badness in local_bh_enable at kernel/softirq.c:121
> Call Trace:
>  [<c011ff91>] local_bh_enable+0x35/0x58
>  [<c022d19a>] ip_ct_find_proto+0xd2/0xd8
>  [<c022d923>] destroy_conntrack+0x13/0x19c
>  [<c01e68c8>] __kfree_skb+0xc8/0xfc
>  [<d085b160>] pcnet32_purge_tx_ring+0x94/0xc4 [pcnet32]
>  [<d085b300>] pcnet32_restart+0x14/0x6c [pcnet32]
>  [<d085c089>] pcnet32_set_multicast_list+0x7d/0x90 [pcnet32]

This is the classic case of doing disabling/enabling of software
interrupts with hardware interrupts disabled, which is a bug.

In this case pcnet32_set_multicast_list() is disabling hardware
interrupts, and the packet freeing of pcnet32_purge_tx_ring()
is what leads to the software interrupt disable/enable.

However, I'm inclined to believe that we should change dev_kfree_skb_any()
to fix this class of problems, by making it check for hardware interrupts
being disabled as well as being in an interrupt.

But we might not want to do it like this, just reenabling the hardware
interrupts at the top level won't cause the software interrupt to fire
to actually execute the SKB freeing work.... Need to think about this
some more.

===== include/linux/netdevice.h 1.66 vs edited =====
--- 1.66/include/linux/netdevice.h	Sat Nov  1 14:11:04 2003
+++ edited/include/linux/netdevice.h	Fri Dec  5 16:53:01 2003
@@ -634,7 +634,7 @@
  */
 static inline void dev_kfree_skb_any(struct sk_buff *skb)
 {
-	if (in_irq())
+	if (in_irq() || irqs_disabled())
 		dev_kfree_skb_irq(skb);
 	else
 		dev_kfree_skb(skb);

  reply	other threads:[~2003-12-06  0:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-05 23:45 [BUG 2.6.0-test11] pcnet32 oops Jean Tourrilhes
2003-12-06  0:59 ` David S. Miller [this message]
2003-12-09 14:15   ` Rask Ingemann Lambertsen
2003-12-10  8:30     ` David S. Miller
2003-12-10  8:32     ` David S. Miller

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=20031205165900.2920ea6a.davem@redhat.com \
    --to=davem@redhat.com \
    --cc=jgarzik@pobox.com \
    --cc=jt@bougret.hpl.hp.com \
    --cc=jt@hpl.hp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@oss.sgi.com \
    --cc=tsbogend@alpha.franken.de \
    /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).