netdev
[Top] [All Lists]

Re: Frozen machine with adding a tc filter

To: kuznet@xxxxxxxxxxxxx
Subject: Re: Frozen machine with adding a tc filter
From: bert hubert <ahu@xxxxxxx>
Date: Tue, 23 Jul 2002 23:28:04 +0200
Cc: albertogli@xxxxxxxxxxxxx, netdev@xxxxxxxxxxx, jdike@xxxxxxxxxx
In-reply-to: <200207222257.CAA14506@xxxxxxxxxxxxx>
Mail-followup-to: bert hubert <ahu@xxxxxxx>, kuznet@xxxxxxxxxxxxx, albertogli@xxxxxxxxxxxxx, netdev@xxxxxxxxxxx, jdike@xxxxxxxxxx
References: <20020722212111.GA22916@xxxxxxxxxxxxxxx> <200207222257.CAA14506@xxxxxxxxxxxxx>
Sender: owner-netdev@xxxxxxxxxxx
User-agent: Mutt/1.3.28i
On Tue, Jul 23, 2002 at 02:57:14AM +0400, kuznet@xxxxxxxxxxxxx wrote:

> > Please tell me your ideas,
> 
> Well, before all figure out where it deadlocks.

I tried this in User Mode Linux and after some help by Jeff, I figured out
that the deadlock is within cbq_classify() in sch_cbq.c. The problem is that
the 'no upwards classifying' check:

        if (cl == NULL || cl->level >= head->level)
                goto fallback;

is only applied if the classifyer did not return an answer:

        if (!head->filter_list || (result = tc_classify(skb,
                head->filter_list, &res)) < 0)
                        goto fallback;

        if ((cl = (void*)res.class) == NULL) {
                if (TC_H_MAJ(res.classid))
                        cl = cbq_class_lookup(q, res.classid);
                else if ((cl = defmap[res.classid&TC_PRIO_MAX]) == NULL)
                        cl = defmap[TC_PRIO_BESTEFFORT];

                if (cl == NULL || cl->level >= head->level)
                        goto fallback;
        }

However, with the commandlines specified, the classifier returns.. head, and
the loop prevention test is never performed.

Suggested fix is to move down the test to the end of the loop so it is
always invoked before iterating. Another test that might sense is to see if
head and cl differ before moving on. A loop is guaranteed in that case.

I can build this into a patch if needed, but I suspect Alexey will want to
write his own.

Thanks for your time.

Regards,

bert

-- 
http://www.PowerDNS.com          Versatile DNS Software & Services
http://www.tk                              the dot in .tk
http://lartc.org           Linux Advanced Routing & Traffic Control HOWTO


<Prev in Thread] Current Thread [Next in Thread>