netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Arend van Spriel" <arend@broadcom.com>
To: "David S. Miller" <davem@davemloft.net>
Cc: "Eric Dumazet" <edumazet@google.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	brcm80211-dev-list@broadcom.com
Subject: need info: softirq warning upon free skb
Date: Thu, 14 Mar 2013 19:36:06 +0100	[thread overview]
Message-ID: <51421896.6020607@broadcom.com> (raw)

Hi Dave,

Sorry to bother. Today during testing I ran into two warnings, which 
given their occurrence are fired in the same code path:
kernel/softirq.c:99:__local_bh_disable():
	WARN_ON_ONCE(in_irq());
kernel/softirq.c:160:_local_bh_enable_ip():
	WARN_ON_ONCE(in_irq() || irqs_disabled());

I have not seen those warning before, but consider them serious enough 
to look into it (although no crashing system yet). They popped up in our 
driver while freeing an skb. For this we use a utility function in our 
driver (brcm80211 wireless) as listed below. It provided a little code 
shortcut by skipping dev_kfree_skb_any(). However, circumstances seem to 
have changed for some reason. The warning occurs in 
nf_conntrack_destroy() path. Before digging deeper I decided the answer 
might be known out there. Should the comment statements in the code 
snippet below still be valid? I am more than happy to get rid of the 
function entirely if it does not make sense.

Regards,
Arend

-8<---------------------------------------------------------------
void brcmu_pkt_buf_free_skb(struct sk_buff *skb)
{
	if (!skb)
		return;
	WARN_ON(skb->next);
	if (skb->destructor)
		/* cannot kfree_skb() on hard IRQ (net/core/skbuff.c) if
		 * destructor exists
		 */
		dev_kfree_skb_any(skb);
	else
		/* can free immediately (even in_irq()) if destructor
		 * does not exist
		 */
		dev_kfree_skb(skb);
}

                 reply	other threads:[~2013-03-14 18:36 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=51421896.6020607@broadcom.com \
    --to=arend@broadcom.com \
    --cc=brcm80211-dev-list@broadcom.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=linux-kernel@vger.kernel.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).