Report qdisc parent to userspace
Subsystems (3)
PATCH 1/1 Report qdisc parent to userspace
Report parent classid of a qdisc back to userspace. Without this there is no way for userspace to see if the qdisc is attached to a class other than parsing all class trees of the link and check all tcm_info fields in the leaf classes.
Note: This has nothing to do with __parent.
include/net/pkt_sched.h +1 -0
@@ -80,6 +80,7 @@int padded;struct Qdisc_ops *ops;u32 handle; +u32 parent;atomic_t refcnt;struct sk_buff_head q;struct net_device *dev;
net/sched/sch_api.c +3 -2
@@ -702,10 +702,11 @@return -ENOENT ;if (clid ==TC_H_INGRESS ) q =qdisc_create (dev, tcm->tcm_parent, tca, &err); -else +else q =qdisc_create (dev, tcm->tcm_handle, tca, &err);if (q ==NULL )return err; + q->parent = clid; graft:if (1 ) {
@@ -821,7 +822,7 @@ q_idx++;continue ; } -if (tc_fill_qdisc (skb, q,0 ,NETLINK_CB (cb->skb).pid, +if (tc_fill_qdisc (skb, q, q->parent,NETLINK_CB (cb->skb).pid, cb->nlh->nlmsg_seq,NLM_F_MULTI ,RTM_NEWQDISC ) <=0 ) {read_unlock_bh (&qdisc_tree_lock); goto done;
* Thomas Graf <[email protected]> 2004-09-24 14:37
Quoted 4 lines
Report parent classid of a qdisc back to userspace. Without this there is no way for userspace to see if the qdisc is attached to a class other than parsing all class trees of the link and check all
tcm_infofields in the leaf classes.
Don't include this patch yet. I think i missed a case when tcm_parent is set to a non-existant classid but gets attached to the root class.
PATCH RESEND 1/1 Report qdisc parent to userspace
This patch should be better, sorry for the brain dead patch before.
Report parent classid of a qdisc back to userspace. Without this there is no way for userspace to see if the qdisc is attached to a class other than parsing all class trees of the link and check all tcm_info fields in the leaf classes.
include/net/pkt_sched.h +1 -0
@@ -80,6 +80,7 @@int padded;struct Qdisc_ops *ops;u32 handle; +u32 parent;atomic_t refcnt;struct sk_buff_head q;struct net_device *dev;
net/sched/sch_api.c +3 -1
@@ -371,6 +371,8 @@unsigned long cl = cops->get (parent, classid);if (cl) { err = cops->graft (parent, cl, new, old); +if (new) + new->parent = classid; cops->put (parent, cl); } }
@@ -821,7 +823,7 @@ q_idx++;continue ; } -if (tc_fill_qdisc (skb, q,0 ,NETLINK_CB (cb->skb).pid, +if (tc_fill_qdisc (skb, q, q->parent,NETLINK_CB (cb->skb).pid, cb->nlh->nlmsg_seq,NLM_F_MULTI ,RTM_NEWQDISC ) <=0 ) {read_unlock_bh (&qdisc_tree_lock); goto done;
David S. Miller
maintainerQuoted 8 lines · On Fri, 24 Sep 2004 16:00:39 +0200 Thomas Graf <[email protected]> wrote:
This patch should be better, sorry for the brain dead patch before.
Report parent classid of a qdisc back to userspace. Without this there is no way for userspace to see if the qdisc is attached to a class other than parsing all class trees of the link and check all
tcm_infofields in the leaf classes.Signed-off-by Thomas Graf <[email protected]>
This patch looks fine to me, applied.
Thanks Thomas.