netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2.4 PKT_SCHED] Report qdisc parent to userspace
@ 2004-09-29  0:01 Thomas Graf
  2004-09-29  3:56 ` David S. Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Graf @ 2004-09-29  0:01 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev

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: Thomas Graf <tgraf@suug.ch>

--- linux-2.4.28-pre3-bk4.orig/include/net/pkt_sched.h	2004-09-29 00:42:01.000000000 +0200
+++ linux-2.4.28-pre3-bk4/include/net/pkt_sched.h	2004-09-29 00:54:46.000000000 +0200
@@ -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;
--- linux-2.4.28-pre3-bk4.orig/net/sched/sch_api.c	2004-09-29 00:42:03.000000000 +0200
+++ linux-2.4.28-pre3-bk4/net/sched/sch_api.c	2004-09-29 00:59:36.000000000 +0200
@@ -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;

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 2.4 PKT_SCHED] Report qdisc parent to userspace
  2004-09-29  0:01 [PATCH 2.4 PKT_SCHED] Report qdisc parent to userspace Thomas Graf
@ 2004-09-29  3:56 ` David S. Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David S. Miller @ 2004-09-29  3:56 UTC (permalink / raw)
  To: Thomas Graf; +Cc: netdev

On Wed, 29 Sep 2004 02:01:50 +0200
Thomas Graf <tgraf@suug.ch> 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.
> 
> Signed-off-by: Thomas Graf <tgraf@suug.ch>

Applied, thanks Thomas.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-09-29  3:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-09-29  0:01 [PATCH 2.4 PKT_SCHED] Report qdisc parent to userspace Thomas Graf
2004-09-29  3:56 ` David S. Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).