All of lore.kernel.org
 help / color / mirror / Atom feed
* [LARTC] Info from tc show
@ 2003-07-25 18:05 Orlie Brewer
  0 siblings, 0 replies; only message in thread
From: Orlie Brewer @ 2003-07-25 18:05 UTC (permalink / raw)
  To: lartc

Hello,

I've a question about getting information using "tc show" and the
underlying rtnetlink sockets.  Given the following (similar to the
core device example in Almesberger's paper "Differentiated Services
on Linux")

tc qdisc add dev eth0 handle 1:0 root dsmark indices 64 set_tc_index
tc qdisc add dev eth0 parent 1:0 handle 2:0 htb

Then, the following

tc -d qdisc show dev eth0

gives

qdisc htb 2: r2q 10 default 0 direct_packets_stat 0 ver 3.6
qdisc dsmark 1: indices 0x0040 set_tc_index 
So now my question, how can a process (without access to the command
that created the qdiscs) get the information that the root dsmark qdisc
1:0 is the parent of the htb qdisc 2:0, or alternatively, that the
htb qdisc 2:0 belongs to the root dsmark qdisc 1:0?

Looking at the code for tc, parent is only printed if t->tcm_parent
is nonzero.  If one looks at /usr/src/linux/net/sched/sch_api.c,
in tc_fill_qdisc, t->tcm_parent is set to clid, which is the
third parameter to the function.  Looking at the call to tc_fill_qdisc
in tc_dump_qdisc, the third parameter is the constant 0.

Looking at /usr/src/linux/net/sched/sch_dsmark.c, it looks like the
the htb qdisc 2:0 is stored in the struct Qdisc *q field of the
struct dsmark_qdisc_data, so that dsmark_dump could return q->handle,
but that would require an new enum (TCA_DSMARK_QHANDLE or something)
in the dsmark section of /usr/src/linux/include/linux/pkt_sched.h
and of course a couple lines of code in dsmark_dump.

Is there any way of getting that info without hacking the kernel modules?

Thanks for any comments.

Orlie


    Orlie Brewer
    The Boeing Company         VOICE: (425) 865 - 3191,
    P.O. Box 3707, MS 7L-48    FAX:   (425) 865 - 2965
    Seattle, WA 98124-2207     EMAIL: orlie.t.brewer@boeing.com
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-07-25 18:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-07-25 18:05 [LARTC] Info from tc show Orlie Brewer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.