Commit 5e786740 authored by Thomas Graf's avatar Thomas Graf Committed by David S. Miller

[PKT_SCHED]: 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.
Signed-off-by: default avatarThomas Graf <tgraf@suug.ch>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 013c19c3
......@@ -80,6 +80,7 @@ struct Qdisc
int padded;
struct Qdisc_ops *ops;
u32 handle;
u32 parent;
atomic_t refcnt;
struct sk_buff_head q;
struct net_device *dev;
......
......@@ -371,6 +371,8 @@ int qdisc_graft(struct net_device *dev, struct Qdisc *parent, u32 classid,
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 @@ static int tc_dump_qdisc(struct sk_buff *skb, struct netlink_callback *cb)
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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment