From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.tohojo.dk (mail.tohojo.dk [188.40.53.186]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by huchra.bufferbloat.net (Postfix) with ESMTPS id 89CFF21F118 for ; Mon, 10 Jun 2013 05:39:55 -0700 (PDT) Received: from alrua-desktop.borgediget.toke.dk (unknown [10.42.3.5]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.tohojo.dk (Postfix) with ESMTPSA id E2DFD1EC1E4F; Mon, 10 Jun 2013 14:39:52 +0200 (CEST) Received: by alrua-desktop.borgediget.toke.dk (Postfix, from userid 1000) id 26A24EB9D; Mon, 10 Jun 2013 14:39:52 +0200 (CEST) From: =?UTF-8?q?Toke=20H=C3=B8iland-J=C3=B8rgensen?= To: bloat-devel@lists.bufferbloat.net Subject: [PATCH RFC 0/3] Broadcasting qdisc statistics via netlink Date: Mon, 10 Jun 2013 14:39:46 +0200 Message-Id: <1370867989-7318-1-git-send-email-toke@toke.dk> X-Mailer: git-send-email 1.8.3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: bloat-devel@lists.bufferbloat.net X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Developers working on AQM, device drivers, and networking stacks" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Jun 2013 12:39:55 -0000 These patches are my attempt to implement periodical broadcast of qdisc statistics via netlink. The goal is to be able to monitor qdisc stats without having to poll (as tc does). What it does: - On packet dequeue, broadcast a netlink multicast packet with the qdisc statistics. There's a sysctl parameter that sets the minimum interval between two consecutive broadcasts. The broadcast is done while the qdisc lock is still held (I think), so no new locking is done. - Right now the only new statistics being gathered is that I added qlen statistics to pfifo_fast (since they were missing), but otherwise it's basically what tc gets on `tc -s qdisc`. Oh, and the rate estimation is missing, because it complained about locking. I'm hoping some of you can comment on the usefulness of this approach, and point out to me where I'm doing things wrong. It's working to the point where there is some output, but not quite the way I've envisioned (there's certainly not a netlink packet broadcast for each packet dequeued). Anyway, the patches follow (they're against Linux 3.9.4). There's a client at https://github.com/tohojo/netlink-client which requires libnl and cmake to build; run it as `./netlink-client -i ` and it'll print what it receives from the kernel for 60 seconds (set duration with -l). Thanks, -Toke Toke Høiland-Jørgensen (3): Broadcast qdisc statistics via netlink on packet dequeue. Add qdisc_stats_broadcast_interval sysctl parameter, and use it to limit stats broadcast interval. Make pfifo_fast track qlen stats. include/net/netns/ipv4.h | 4 ++ include/net/sch_generic.h | 4 ++ include/uapi/linux/rtnetlink.h | 15 ++++--- net/core/gen_stats.c | 6 ++- net/ipv4/sysctl_net_ipv4.c | 13 ++++++ net/sched/Kconfig | 8 ++++ net/sched/sch_api.c | 7 ++++ net/sched/sch_generic.c | 93 ++++++++++++++++++++++++++++++++++++++++++ 8 files changed, 143 insertions(+), 7 deletions(-) -- 1.8.3