[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.1.10.0909011753230.25607@V090114053VZO-1>
Date: Tue, 1 Sep 2009 17:55:44 -0400 (EDT)
From: Christoph Lameter <cl@...ux-foundation.org>
To: Eric Dumazet <eric.dumazet@...il.com>
cc: Patrick McHardy <kaber@...sh.net>,
Mark Smith <lk-netdev@...netdev.nosense.org>,
Jarek Poplawski <jarkao2@...il.com>, netdev@...r.kernel.org
Subject: Re: UDP is bypassing qdisc statistics ....
Ok i got some meaningful statistics now. Why is the qlen zero for all
devices?
$ cat /proc/net/qdisc_stats
Type Device St Bytes Packts Qlen Bklg Drops Requeu Overlimit
TX0 root lo 0 0 0 0 0 0 0 0
RX root lo 0 0 0 0 0 0 0 0
TX0 root eth0 0 12463 91 0 0 0 0 0
TX1 root eth0 0 2954 39 0 0 0 0 0
TX2 root eth0 0 2132 23 0 0 0 0 0
TX3 root eth0 0 29293 210 0 0 0 0 0
TX4 root eth0 0 2805 31 0 0 0 0 0
TX5 root eth0 0 1286862317 3762765 0 0 643253 30886 0
TX6 root eth0 0 1310 17 0 0 0 0 0
TX7 root eth0 0 2860 31 0 0 0 0 0
---
net/sched/sch_api.c | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 72 insertions(+)
Index: linux-2.6/net/sched/sch_api.c
===================================================================
--- linux-2.6.orig/net/sched/sch_api.c 2009-09-01 12:27:24.000000000 -0500
+++ linux-2.6/net/sched/sch_api.c 2009-09-01 12:40:30.000000000 -0500
@@ -1699,6 +1699,77 @@ static const struct file_operations psch
.llseek = seq_lseek,
.release = single_release,
};
+
+static void dump_qdisc(struct seq_file *seq, struct net_device *dev,
+ struct Qdisc *q, char *inout, char *text)
+{
+ seq_printf(seq, "%3s %2s %6s %3lx %8lld %6d %4d %4d %6d %6d %6d\n",
+ inout, text, dev->name, q->state,
+ q->bstats.bytes, q->bstats.packets,
+ q->qstats.qlen, q->qstats.backlog, q->qstats.drops,
+ q->qstats.requeues, q->qstats.overlimits);
+}
+
+static void dump_qdisc_root(struct seq_file *seq, struct net_device *dev,
+ struct Qdisc *root, char *inout)
+{
+ struct Qdisc *q;
+ int n = 0;
+
+ if (!root)
+ return;
+
+ dump_qdisc(seq, dev, root, inout, "root");
+
+ list_for_each_entry(q, &root->list, list) {
+ char buffer[10];
+
+ sprintf(buffer,"Q%d", ++n);
+ dump_qdisc(seq, dev, q, inout, buffer);
+ }
+}
+
+
+static int qdisc_show(struct seq_file *seq, void *v)
+{
+ struct net_device *dev;
+
+ seq_printf(seq, "Type Device St Bytes Packts "
+ "Qlen Bklg Drops Requeu Overlimit\n");
+
+ read_lock(&dev_base_lock);
+
+ for_each_netdev(&init_net, dev) {
+ struct netdev_queue *dev_queue;
+ int i;
+
+ for (i = 0; i < dev->real_num_tx_queues; i++) {
+ char buffer[10];
+
+ dev_queue = netdev_get_tx_queue(dev, i);
+ sprintf(buffer, "TX%d", i);
+ dump_qdisc_root(seq, dev, dev_queue->qdisc_sleeping, buffer);
+ }
+ dev_queue = &dev->rx_queue;
+ dump_qdisc_root(seq, dev, dev_queue->qdisc_sleeping, "RX");
+ }
+
+ read_unlock(&dev_base_lock);
+ return 0;
+}
+
+static int qdisc_open(struct inode *inode, struct file *file)
+{
+ return single_open(file, qdisc_show, PDE(inode)->data);
+}
+
+static const struct file_operations qdisc_fops = {
+ .owner = THIS_MODULE,
+ .open = qdisc_open,
+ .read = seq_read,
+ .llseek = seq_lseek,
+ .release = single_release,
+};
#endif
static int __init pktsched_init(void)
@@ -1706,6 +1777,7 @@ static int __init pktsched_init(void)
register_qdisc(&pfifo_qdisc_ops);
register_qdisc(&bfifo_qdisc_ops);
proc_net_fops_create(&init_net, "psched", 0, &psched_fops);
+ proc_net_fops_create(&init_net, "qdisc_stats", 0, &qdisc_fops);
rtnl_register(PF_UNSPEC, RTM_NEWQDISC, tc_modify_qdisc, NULL);
rtnl_register(PF_UNSPEC, RTM_DELQDISC, tc_get_qdisc, NULL);
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists