From: Eric Dumazet <eric.dumazet@gmail.com>
To: Stephen Hemminger <shemminger@vyatta.com>
Cc: David Miller <davem@davemloft.net>,
jarkao2@gmail.com, cl@linux-foundation.org, kaber@trash.net,
netdev@vger.kernel.org
Subject: Re: [PATCH net-next-2.6] tc: report informations for multiqueue devices
Date: Wed, 02 Sep 2009 14:48:27 +0200 [thread overview]
Message-ID: <4A9E699B.7080400@gmail.com> (raw)
In-Reply-To: <4A9E6551.4030209@gmail.com>
Eric Dumazet a écrit :
> David Miller a écrit :
>> From: Eric Dumazet <eric.dumazet@gmail.com>
>> Date: Wed, 02 Sep 2009 10:28:55 +0200
>>
>>> What naming convention should we choose for multiqueue devices ?
>> We could give an index field to multiple root qdiscs assigned
>> to a device.
>
> Here is a patch then :)
>
> Only point is that I am iterating from 0 to dev->real_num_tx_queues
> instead of dev->num_tx_queues. I hope it's fine, because there are
> allocated qdisc, but not really used.
>
> Next patches to allow selective qdisc change/fetch (providing a TCA_QINDEX
> selector value to kernel)
>
> Thanks
>
>
> [PATCH net-next-2.6] tc: report informations for multiqueue devices
>
> qdisc and classes are not yet displayed by "tc -s -d {qdisc|class} show"
> for multiqueue devices.
>
> We use a new TCA_QINDEX attribute, to report queue index to user space.
> iproute2 tc should be changed to eventually display this queue index as in :
>
> $ tc -s -d qdisc
> qdisc pfifo_fast 0: dev eth0 root bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
> Sent 52498 bytes 465 pkt (dropped 0, overlimits 0 requeues 0)
> rate 0bit 0pps backlog 0b 0p requeues 0
> qdisc pfifo_fast 0: dev eth0 qindex 1 root bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
> Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
> rate 0bit 0pps backlog 0b 0p requeues 0
>
Here is the iproute2 patch as well, to display queue indexes
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
---
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index ba3254e..b80e0f6 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -490,6 +490,7 @@ enum
TCA_FCNT,
TCA_STATS2,
TCA_STAB,
+ TCA_QINDEX,
__TCA_MAX
};
diff --git a/tc/tc_class.c b/tc/tc_class.c
index 9d4eea5..1bc4bc6 100644
--- a/tc/tc_class.c
+++ b/tc/tc_class.c
@@ -196,6 +196,13 @@ int print_class(const struct sockaddr_nl *who,
if (filter_ifindex == 0)
fprintf(fp, "dev %s ", ll_index_to_name(t->tcm_ifindex));
+ if (tb[TCA_QINDEX]) {
+ int qindex = 0;
+
+ memcpy(&qindex, RTA_DATA(tb[TCA_QINDEX]), MIN(RTA_PAYLOAD(tb[TCA_QINDEX]), sizeof(int)));
+ fprintf(fp, "qindex %d ", qindex);
+ }
+
if (t->tcm_parent == TC_H_ROOT)
fprintf(fp, "root ");
else {
diff --git a/tc/tc_qdisc.c b/tc/tc_qdisc.c
index c7f2988..3ec2cf4 100644
--- a/tc/tc_qdisc.c
+++ b/tc/tc_qdisc.c
@@ -232,6 +232,14 @@ int print_qdisc(const struct sockaddr_nl *who,
fprintf(fp, "qdisc %s %x: ", (char*)RTA_DATA(tb[TCA_KIND]), t->tcm_handle>>16);
if (filter_ifindex == 0)
fprintf(fp, "dev %s ", ll_index_to_name(t->tcm_ifindex));
+
+ if (tb[TCA_QINDEX]) {
+ int qindex = 0;
+
+ memcpy(&qindex, RTA_DATA(tb[TCA_QINDEX]), MIN(RTA_PAYLOAD(tb[TCA_QINDEX]), sizeof(int)));
+ fprintf(fp, "qindex %d ", qindex);
+ }
+
if (t->tcm_parent == TC_H_ROOT)
fprintf(fp, "root ");
else if (t->tcm_parent) {
next prev parent reply other threads:[~2009-09-02 12:48 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-01 23:52 [NET] Add proc file to display the state of all qdiscs Christoph Lameter
2009-09-02 8:14 ` Jarek Poplawski
2009-09-02 8:28 ` Eric Dumazet
2009-09-02 8:30 ` David Miller
2009-09-02 12:30 ` [PATCH net-next-2.6] tc: report informations for multiqueue devices Eric Dumazet
2009-09-02 12:48 ` Eric Dumazet [this message]
2009-09-02 16:23 ` Stephen Hemminger
2009-09-02 16:30 ` Patrick McHardy
2009-09-02 16:50 ` Eric Dumazet
2009-09-02 17:17 ` [PATCH net-next-2.6] vlan: multiqueue vlan devices Eric Dumazet
2009-09-02 17:49 ` Patrick McHardy
2009-09-02 18:37 ` Brian Haley
2009-09-02 18:55 ` Eric Dumazet
2009-09-02 19:01 ` Stephen Hemminger
2009-09-02 19:12 ` Eric Dumazet
2009-09-03 1:04 ` David Miller
2009-09-03 1:05 ` Eric Dumazet
2009-09-03 9:17 ` Eric Dumazet
2009-09-03 9:20 ` David Miller
2009-09-02 17:31 ` [PATCH net-next-2.6] tc: report informations for multiqueue devices Eric Dumazet
2009-09-02 17:50 ` Patrick McHardy
2009-09-02 13:18 ` Patrick McHardy
2009-09-02 13:49 ` Eric Dumazet
2009-09-02 14:07 ` Patrick McHardy
2009-09-02 22:17 ` Jarek Poplawski
2009-09-02 9:18 ` [NET] Add proc file to display the state of all qdiscs Jarek Poplawski
2009-09-02 9:33 ` Jarek Poplawski
2009-09-02 9:37 ` Jarek Poplawski
2009-09-02 12:44 ` Patrick McHardy
2009-09-02 18:13 ` Christoph Lameter
2009-09-03 14:19 ` Jesper Dangaard Brouer
2009-09-03 14:29 ` Patrick McHardy
2009-09-03 14:43 ` Eric Dumazet
2009-09-03 17:30 ` Jesper Dangaard Brouer
2009-09-03 17:56 ` Patrick McHardy
2009-09-03 23:31 ` David Miller
2009-09-04 1:36 ` Patrick McHardy
2009-09-04 1:43 ` Patrick McHardy
2009-09-03 23:28 ` David Miller
2009-09-03 23:22 ` David Miller
2009-09-02 18:12 ` Christoph Lameter
2009-09-02 19:49 ` Jarek Poplawski
2009-09-02 21:27 ` Jarek Poplawski
2009-09-03 18:03 ` Christoph Lameter
2009-09-03 19:35 ` Jarek Poplawski
2009-09-03 19:38 ` Eric Dumazet
2009-09-03 19:54 ` Jarek Poplawski
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=4A9E699B.7080400@gmail.com \
--to=eric.dumazet@gmail.com \
--cc=cl@linux-foundation.org \
--cc=davem@davemloft.net \
--cc=jarkao2@gmail.com \
--cc=kaber@trash.net \
--cc=netdev@vger.kernel.org \
--cc=shemminger@vyatta.com \
/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 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).