From: Chris Madden <chris@reflexsecurity.com>
To: hadi@cyberus.ca
Cc: Patrick McHardy <kaber@trash.net>,
David Miller <davem@davemloft.net>,
netdev@vger.kernel.org, tgraf@suug.ch
Subject: Re: Oops in filter add
Date: Tue, 20 Mar 2007 06:54:55 -0400 [thread overview]
Message-ID: <45FFBD7F.4010005@reflexsecurity.com> (raw)
In-Reply-To: <1174382739.4864.11.camel@localhost>
Thanks for all your replies!
One thing I did notice in examining tc_ctl_tfilter was that there is
something like:
qdisc_lock_tree(dev);
tp->next = *back;
*back = tp;
qdisc_unlock_tree(dev);
And then proceed to the data structure down below with:
err = tp->ops->change(tp, cl, t->tcm_handle, tca, &fh);
Simply reordering these seems to ameliorate the problem greatly. I
don't know if this is a generic solution or something specific to the
basic filter only.
Chris Madden
jamal wrote:
> On Tue, 2007-20-03 at 08:29 +0100, Patrick McHardy wrote:
>
>> jamal wrote:
>>
>>> On Tue, 2007-20-03 at 07:58 +0100, Patrick McHardy wrote:
>>>
>>> Ok. It certainly used to matter in the old days.
>>>
>> Actually it has never been used anywhere else but in ing_filter,
>> it was introduced together with the TC actions.
>>
>>
>
> You are correct. I looked at old 2.4 and all i saw was:
>
> ----------
> /*
> revisit later: Use a private since lock dev->queue_lock is also
> used on the egress (might slow things for an iota)
> */
>
> if (dev->qdisc_ingress) {
> spin_lock(&dev->queue_lock);
> if ((q = dev->qdisc_ingress) != NULL)
> fwres = q->enqueue(skb, q);
> spin_unlock(&dev->queue_lock);
> }
> ------
>
> So the resolution (as Dave points out) was wrong. In any case, restoring
> queue_lock for now would slow things but will remove the race.
>
>
>> I'll try, but no promises, I'm a bit behind with various things myself.
>>
>
> I will ping you in a few days and if you havent done anything i will
> take it up.
> I am almost tempted to make the ingress filters to not have any
> dependencies on egress whatsoever. It will create more locks but
> will make the datapath faster. Actions can still be shared, but thats
> lesser of an overhead.
>
> cheers,
> jamal
>
>
next prev parent reply other threads:[~2007-03-20 10:54 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-19 20:10 Oops in filter add Chris Madden
2007-03-20 2:22 ` David Miller
2007-03-20 6:54 ` jamal
2007-03-20 6:58 ` Patrick McHardy
2007-03-20 7:18 ` jamal
2007-03-20 7:29 ` Patrick McHardy
2007-03-20 9:25 ` jamal
2007-03-20 10:54 ` Chris Madden [this message]
2007-03-20 11:02 ` Patrick McHardy
2007-03-20 10:58 ` Patrick McHardy
2007-03-21 9:33 ` jamal
2007-03-20 14:15 ` Chris Madden
2007-03-20 14:48 ` Patrick McHardy
2007-03-20 14:57 ` Patrick McHardy
2007-03-20 15:11 ` Thomas Graf
2007-03-20 15:13 ` Patrick McHardy
2007-03-20 16:27 ` Chris Madden
2007-03-20 17:06 ` Patrick McHardy
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=45FFBD7F.4010005@reflexsecurity.com \
--to=chris@reflexsecurity.com \
--cc=davem@davemloft.net \
--cc=hadi@cyberus.ca \
--cc=kaber@trash.net \
--cc=netdev@vger.kernel.org \
--cc=tgraf@suug.ch \
/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).