* [PATCH 2.6 PKT_SCHED] Report qdisc parent to userspace
@ 2004-09-24 12:37 Thomas Graf
2004-09-24 12:52 ` Thomas Graf
0 siblings, 1 reply; 4+ messages in thread
From: Thomas Graf @ 2004-09-24 12:37 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.
Note: This has nothing to do with __parent.
Signed-off-by: Thomas Graf <tgraf@suug.ch>
--- linux-2.6.9-rc2-bk7.orig/include/net/pkt_sched.h 2004-09-21 23:26:54.000000000 +0200
+++ linux-2.6.9-rc2-bk7/include/net/pkt_sched.h 2004-09-24 14:15:36.000000000 +0200
@@ -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;
--- linux-2.6.9-rc2-bk7.orig/net/sched/sch_api.c 2004-09-21 23:27:31.000000000 +0200
+++ linux-2.6.9-rc2-bk7/net/sched/sch_api.c 2004-09-24 13:56:03.000000000 +0200
@@ -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;
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 2.6 PKT_SCHED] Report qdisc parent to userspace
2004-09-24 12:37 [PATCH 2.6 PKT_SCHED] Report qdisc parent to userspace Thomas Graf
@ 2004-09-24 12:52 ` Thomas Graf
2004-09-24 14:00 ` [RESEND PATCH " Thomas Graf
0 siblings, 1 reply; 4+ messages in thread
From: Thomas Graf @ 2004-09-24 12:52 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev
* Thomas Graf <20040924123710.GB3944@postel.suug.ch> 2004-09-24 14:37
> 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.
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.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [RESEND PATCH 2.6 PKT_SCHED] Report qdisc parent to userspace
2004-09-24 12:52 ` Thomas Graf
@ 2004-09-24 14:00 ` Thomas Graf
2004-09-28 21:19 ` David S. Miller
0 siblings, 1 reply; 4+ messages in thread
From: Thomas Graf @ 2004-09-24 14:00 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev
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.
Signed-off-by: Thomas Graf <tgraf@suug.ch>
--- linux-2.6.9-rc2-bk7.orig/include/net/pkt_sched.h 2004-09-21 23:26:54.000000000 +0200
+++ linux-2.6.9-rc2-bk7/include/net/pkt_sched.h 2004-09-24 14:15:36.000000000 +0200
@@ -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;
--- linux-2.6.9-rc2-bk7.orig/net/sched/sch_api.c 2004-09-21 23:27:31.000000000 +0200
+++ linux-2.6.9-rc2-bk7/net/sched/sch_api.c 2004-09-24 15:34:43.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);
}
}
@@ -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;
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [RESEND PATCH 2.6 PKT_SCHED] Report qdisc parent to userspace
2004-09-24 14:00 ` [RESEND PATCH " Thomas Graf
@ 2004-09-28 21:19 ` David S. Miller
0 siblings, 0 replies; 4+ messages in thread
From: David S. Miller @ 2004-09-28 21:19 UTC (permalink / raw)
To: Thomas Graf; +Cc: netdev
On Fri, 24 Sep 2004 16:00:39 +0200
Thomas Graf <tgraf@suug.ch> 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_info
> fields in the leaf classes.
>
> Signed-off-by: Thomas Graf <tgraf@suug.ch>
This patch looks fine to me, applied.
Thanks Thomas.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2004-09-28 21:19 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-09-24 12:37 [PATCH 2.6 PKT_SCHED] Report qdisc parent to userspace Thomas Graf
2004-09-24 12:52 ` Thomas Graf
2004-09-24 14:00 ` [RESEND PATCH " Thomas Graf
2004-09-28 21:19 ` 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).