From: Patrick McHardy <kaber@trash.net>
To: "Waskiewicz Jr, Peter P" <peter.p.waskiewicz.jr@intel.com>
Cc: netdev@vger.kernel.org
Subject: Re: Question: how to detect if a qdisc is root or not?
Date: Sun, 22 Jul 2007 18:24:16 +0200 [thread overview]
Message-ID: <46A384B0.2030404@trash.net> (raw)
In-Reply-To: <D5C1322C3E673F459512FB59E0DDC3290344621B@orsmsx414.amr.corp.intel.com>
Waskiewicz Jr, Peter P wrote:
>>I dont think I understand. Whats the problem with setting
>>sch->parent on initialization instead on grafting as I did in
>>my example patch?
>>Please explain the problems arrising on unload in detail.
>
>
> sch->parent is getting set on initialization, and for the root and
> ingress qdiscs, it's left at zero. If I change that value, when the
> root qdisc is unloaded and pfifo_fast is put back into place, the
> qdisc_destroy() walks the tree and attempts to free memory from the
> handle pointed at by sch->parent.
First of all, qdisc destruction never propagates up, only down
the tree. Secondly neither qdisc_destroy nor pfifo nor prio
even look at sch->parent. So this is completely wrong, the only
place where sch->parent is used for walking through the tree
is qdisc_tree_decrease_qlen.
> It stops when sch->parent is NULL,
Where are you getting this? sch->parent is an *integer*.
> so
> sch->parent is actually being set as intended. The only thing that
> confused me is that nowhere in the qdisc is TC_H_ROOT included
> explicitly, rather, the root qdisc is where sch->parent is NULL.
>
> So I misunderstood what was actually wrong. The qdisc code is ok as-is,
> it's just that the top-level qdisc (root and ingress) have a sch->parent
> of NULL, which is being set correctly today.
>
> Hope that clarifies.
Not at all :)
prev parent reply other threads:[~2007-07-22 16:26 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-18 23:16 Question: how to detect if a qdisc is root or not? Waskiewicz Jr, Peter P
2007-07-18 23:23 ` Patrick McHardy
2007-07-18 23:29 ` Waskiewicz Jr, Peter P
2007-07-18 23:39 ` Patrick McHardy
2007-07-18 23:42 ` Waskiewicz Jr, Peter P
2007-07-20 22:59 ` Waskiewicz Jr, Peter P
2007-07-21 4:01 ` Patrick McHardy
2007-07-21 5:33 ` David Miller
2007-07-21 18:31 ` Waskiewicz Jr, Peter P
2007-07-21 18:55 ` Waskiewicz Jr, Peter P
2007-07-22 16:24 ` Patrick McHardy [this message]
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=46A384B0.2030404@trash.net \
--to=kaber@trash.net \
--cc=netdev@vger.kernel.org \
--cc=peter.p.waskiewicz.jr@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.