All of lore.kernel.org
 help / color / mirror / Atom feed
From: Orlie Brewer <orlie.t.brewer@boeing.com>
To: lartc@vger.kernel.org
Subject: [LARTC] Info from tc show
Date: Fri, 25 Jul 2003 18:05:43 +0000	[thread overview]
Message-ID: <marc-lartc-105915648605266@msgid-missing> (raw)

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/

                 reply	other threads:[~2003-07-25 18:05 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=marc-lartc-105915648605266@msgid-missing \
    --to=orlie.t.brewer@boeing.com \
    --cc=lartc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.