From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 6 14:40:01 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 75852106566B; Mon, 6 Aug 2012 14:40:01 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 487F58FC0A; Mon, 6 Aug 2012 14:40:01 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 86C41B972; Mon, 6 Aug 2012 10:40:00 -0400 (EDT) From: John Baldwin To: freebsd-hackers@freebsd.org Date: Mon, 6 Aug 2012 10:07:37 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p17; KDE/4.5.5; amd64; ; ) References: In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable Message-Id: <201208061007.37898.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 06 Aug 2012 10:40:00 -0400 (EDT) Cc: Tim Kientzle Subject: Re: How to Expose Chip-level Ethernet Statistics? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Aug 2012 14:40:01 -0000 On Saturday, August 04, 2012 3:21:23 pm Tim Kientzle wrote: > I believe that some of the issues I'm having with this > Ethernet driver might be easier to diagnose if I could > expose the chip-level statistics counters (especially queue > overrun counts). >=20 > Is there a standard way to do this? >=20 > I've looked at systat, netstat, and ifconfig but haven't > yet found a standard tool that queries this sort of > information. (If I could find that, I could figure out > which ioctl it used=85) >=20 > Pointers appreciated=85 In particular, if there's another > Ethernet driver that does this well, I can use that for a > reference. Several drivers (igb, em, cxgb, cxgbe, ixgbe, etc.) just expose a "stats" sysctl node under the device and populate that with stats. Typically they install a SYSCTL_PROC() that directly queries the register. In some cases they read the registers via a timer and cache the results and the sysctl handlers returned the cached results. =2D-=20 John Baldwin