diff mbox

UDP is bypassing qdisc statistics ....

Message ID alpine.DEB.1.10.0909011753230.25607@V090114053VZO-1
State RFC, archived
Delegated to: David Miller
Headers show

Commit Message

Christoph Lameter Sept. 1, 2009, 9:55 p.m. UTC
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(+)

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Jarek Poplawski Sept. 1, 2009, 8:24 p.m. UTC | #1
On Tue, Sep 01, 2009 at 05:55:44PM -0400, Christoph Lameter wrote:
> 
> Ok i got some meaningful statistics now. Why is the qlen zero for all
> devices?

Looks like it's updated with q->q.qlen before dumps only. Nice work!
Btw, isn't there something with your localhost's time?

Original-Received: from ...
	...
	for <netdev@vger.kernel.org>; Tue,  1 Sep 2009 13:58:12 -0400 (EDT)
Original-Received: from cl (helo=localhost)
	...
	id 1MibKK-0007nd-Ib; Tue, 01 Sep 2009 17:55:44 -0400

Jarek P.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Christoph Lameter Sept. 2, 2009, 1:36 a.m. UTC | #2
On Tue, 1 Sep 2009, Jarek Poplawski wrote:

> Btw, isn't there something with your localhost's time?

Yup. I have virtual hosting and the provider screwed up time. I can do
nothing about it.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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);