Skip to contentSkip to conversation

Report qdisc parent to userspace

PATCH Applied Thomas Graf 2 participants 2 messages Sep 29, 2004

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

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.

include/net/pkt_sched.h +1 -0
@@ -81,6 +81,7 @@
 #define TCQ_F_INGRES	4
 	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);
 			}
 		}
@@ -812,7 +814,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(&qdisc_tree_lock);
 				goto done;
maintainer Applied
#1 lore raw
Quoted 6 lines · On Wed, 29 Sep 2004 02:01:50 +0200 Thomas Graf <[email protected]> wrote:

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.

Applied, thanks Thomas.