Netdev List
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Eric Paris <eparis@redhat.com>, David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org, Tom Herbert <therbert@google.com>
Subject: Re: BUG: using smp_processor_id() in preemptible [00000000] code: avahi-daemon:  caller is netif_rx
Date: Thu, 15 Apr 2010 21:07:58 +0200	[thread overview]
Message-ID: <1271358478.16881.2939.camel@edumazet-laptop> (raw)
In-Reply-To: <1271337401.16881.2563.camel@edumazet-laptop>

Le jeudi 15 avril 2010 à 15:16 +0200, Eric Dumazet a écrit :
> Le lundi 12 avril 2010 à 21:40 +0200, Eric Dumazet a écrit :
> > Good spot, RPS changed a bit netif_rx() requirements.
> > 
> > I would change ip_dev_loopback_xmit() to call netif_rx_ni() instead...
> > 
> > David, Tom ?
> > 
> > diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
> > index c65f18e..d1bcc9f 100644
> > --- a/net/ipv4/ip_output.c
> > +++ b/net/ipv4/ip_output.c
> > @@ -120,7 +120,7 @@ static int ip_dev_loopback_xmit(struct sk_buff *newskb)
> >  	newskb->pkt_type = PACKET_LOOPBACK;
> >  	newskb->ip_summed = CHECKSUM_UNNECESSARY;
> >  	WARN_ON(!skb_dst(newskb));
> > -	netif_rx(newskb);
> > +	netif_rx_ni(newskb);
> >  	return 0;
> >  }
> >  
> 
> After some confusion, it seems this was the right fix after all :)
> 
> [PATCH] ip: Fix ip_dev_loopback_xmit()
> 
> Eric Paris got following trace with a linux-next kernel
> 
> [   14.203970] BUG: using smp_processor_id() in preemptible [00000000]
> code: avahi-daemon/2093
> [   14.204025] caller is netif_rx+0xfa/0x110
> [   14.204035] Call Trace:
> [   14.204064]  [<ffffffff81278fe5>] debug_smp_processor_id+0x105/0x110
> [   14.204070]  [<ffffffff8142163a>] netif_rx+0xfa/0x110
> [   14.204090]  [<ffffffff8145b631>] ip_dev_loopback_xmit+0x71/0xa0
> [   14.204095]  [<ffffffff8145b892>] ip_mc_output+0x192/0x2c0
> [   14.204099]  [<ffffffff8145d610>] ip_local_out+0x20/0x30
> [   14.204105]  [<ffffffff8145d8ad>] ip_push_pending_frames+0x28d/0x3d0
> [   14.204119]  [<ffffffff8147f1cc>] udp_push_pending_frames+0x14c/0x400
> [   14.204125]  [<ffffffff814803fc>] udp_sendmsg+0x39c/0x790
> [   14.204137]  [<ffffffff814891d5>] inet_sendmsg+0x45/0x80
> [   14.204149]  [<ffffffff8140af91>] sock_sendmsg+0xf1/0x110
> [   14.204189]  [<ffffffff8140dc6c>] sys_sendmsg+0x20c/0x380
> [   14.204233]  [<ffffffff8100ad82>] system_call_fastpath+0x16/0x1b
> 
> While current linux-2.6 kernel doesnt emit this warning, bug is latent
> and might cause unexpected failures.
> 
> ip_dev_loopback_xmit() runs in process context, preemption enabled, so
> must call netif_rx_ni() instead of netif_rx(), to make sure that we
> process pending software interrupt.
> 
> Reported-by: Eric Paris <eparis@redhat.com>
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
> ---
> diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
> index c65f18e..d1bcc9f 100644
> --- a/net/ipv4/ip_output.c
> +++ b/net/ipv4/ip_output.c
> @@ -120,7 +120,7 @@ static int ip_dev_loopback_xmit(struct sk_buff *newskb)
>  	newskb->pkt_type = PACKET_LOOPBACK;
>  	newskb->ip_summed = CHECKSUM_UNNECESSARY;
>  	WARN_ON(!skb_dst(newskb));
> -	netif_rx(newskb);
> +	netif_rx_ni(newskb);
>  	return 0;
>  }
>  

Oops silly me, I forgot ipv6

updated patch in a couple of minutes





  reply	other threads:[~2010-04-15 19:08 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-12 19:20 BUG: using smp_processor_id() in preemptible [00000000] code: avahi-daemon: caller is netif_rx Eric Paris
2010-04-12 19:40 ` Eric Dumazet
2010-04-12 20:54   ` Tom Herbert
2010-04-13  7:14     ` Eric Dumazet
2010-04-15  7:14       ` David Miller
2010-04-15  7:30         ` Changli Gao
2010-04-15  7:37           ` David Miller
2010-04-15  7:47             ` Changli Gao
2010-04-15  7:57               ` David Miller
2010-04-15  8:27                 ` Changli Gao
2010-04-15  8:33                   ` David Miller
2010-04-15  8:58                     ` Eric Dumazet
2010-04-15  8:49               ` Eric Dumazet
2010-04-15  9:02                 ` David Miller
2010-04-15 10:29                   ` Eric Dumazet
2010-04-15 13:16   ` Eric Dumazet
2010-04-15 19:07     ` Eric Dumazet [this message]
2010-04-15 19:13     ` [PATCH] ip: Fix ip_dev_loopback_xmit() Eric Dumazet
2010-04-15 21:26       ` David Miller
2010-04-16  0:03         ` Changli Gao
2010-04-16  0:15           ` David Miller
2010-04-16  0:19             ` Changli Gao

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=1271358478.16881.2939.camel@edumazet-laptop \
    --to=eric.dumazet@gmail.com \
    --cc=davem@davemloft.net \
    --cc=eparis@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=therbert@google.com \
    /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