From: Changli Gao <xiaosuo@gmail.com>
To: Tom Herbert <therbert@google.com>
Cc: davem@davemloft.net, eric.dumazet@gmail.com, netdev@vger.kernel.org
Subject: Re: [PATCH] net: fix problem in dequeuing from input_pkt_queue
Date: Thu, 20 May 2010 08:09:50 +0800 [thread overview]
Message-ID: <AANLkTinZHzZykWYWu9vOmK5ydtcB6ToVBKG1RKYSuSn4@mail.gmail.com> (raw)
In-Reply-To: <AANLkTilxZdJifPtBANrDNdYWxiAMLY6AwA0KYm1yWjle@mail.gmail.com>
On Thu, May 20, 2010 at 7:58 AM, Tom Herbert <therbert@google.com> wrote:
>>> napi->weight = weight_p;
>>> - local_irq_disable();
>>> while (work < quota) {
>>> struct sk_buff *skb;
>>> unsigned int qlen;
>>>
>>> while ((skb = __skb_dequeue(&sd->process_queue))) {
>>> - local_irq_enable();
>>
>> we need to keep local irq disabled. If not, flush_backlog may be
>> called, and it will access sd->process_queue.
>>
>
> It should be okay? process_backlog only runs in softirq so bottom
> halves are already disabled, and I don't think flush_backlog runs out
> of an interrupt.
>
Oh no. It is an IRQ handler.
on_each_cpu(flush_backlog, dev, 1);
...
int on_each_cpu(void (*func) (void *info), void *info, int wait)
{
int ret = 0;
preempt_disable();
ret = smp_call_function(func, info, wait);
local_irq_disable();
func(info);
local_irq_enable();
preempt_enable();
return ret;
}
--
Regards,
Changli Gao(xiaosuo@gmail.com)
next prev parent reply other threads:[~2010-05-20 0:10 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-19 21:47 [PATCH] net: fix problem in dequeuing from input_pkt_queue Tom Herbert
2010-05-19 23:45 ` Changli Gao
2010-05-19 23:58 ` Tom Herbert
2010-05-20 0:09 ` Changli Gao [this message]
2010-05-20 2:48 ` Tom Herbert
2010-05-20 4:37 ` Eric Dumazet
2010-05-20 6:05 ` Tom Herbert
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=AANLkTinZHzZykWYWu9vOmK5ydtcB6ToVBKG1RKYSuSn4@mail.gmail.com \
--to=xiaosuo@gmail.com \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.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;
as well as URLs for NNTP newsgroup(s).