From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 31 12:23:57 2009 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 8335E1065670; Mon, 31 Aug 2009 12:23:57 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 54DA68FC28; Mon, 31 Aug 2009 12:23:57 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id AB0ED46B2D; Mon, 31 Aug 2009 08:23:56 -0400 (EDT) Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8]) by bigwig.baldwin.cx (Postfix) with ESMTPA id CB80F8A02E; Mon, 31 Aug 2009 08:23:55 -0400 (EDT) From: John Baldwin To: freebsd-hackers@freebsd.org Date: Mon, 31 Aug 2009 08:04:27 -0400 User-Agent: KMail/1.9.7 References: In-Reply-To: MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200908310804.27417.jhb@freebsd.org> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Mon, 31 Aug 2009 08:23:55 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.3 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: jfv@FreeBSD.org, Andrew Brampton Subject: Re: netstat -i Ierrs column, Is it total, or per second? 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, 31 Aug 2009 12:23:57 -0000 On Monday 31 August 2009 6:18:56 am Andrew Brampton wrote: > Hi FreeBSD-Hackers, > > netstat -i will print out statistics for each interface, including > input/output packets, input/output bytes, and input/output errors. Now > packets and bytes columns seem to be absolute counts, whereas the > errors column seems to be a count over the last second. For example, > when I am filling a link (and then stop), I get output like so: > > Name Mtu Network Address Ipkts Ierrs Opkts Oerrs Coll > ix0 9000 00:1b:21:20:f9:07 12687951213 432913 > 1 0 0 > > ix0 9000 00:1b:21:20:f9:07 12691545431 435439 > 1 0 0 > > ix0 9000 00:1b:21:20:f9:07 12692054413 434735 > 1 0 0 > > ix0 9000 00:1b:21:20:f9:07 12696499228 300785 > 1 0 0 > > ix0 9000 00:1b:21:20:f9:07 12696499228 0 1 > 0 0 > > As you can see the "Ipkts" value continues to rise, but the "Ierrs" > goes up and down, eventually falling to zero. So my question is, > should this "Ierrs" count be per second?, if so how can I change this > behaviour. I looked at the source code for the driver (ixgbe) and the > OS, looking for every reference to ifp->if_ierrors, but I didn't find > anything that reset this value over time. I also tried a similar > experiment with the e1000 driver but I couldn't get that interface to > list any errors. > > I'm running these tests on FreeBSD 8.0-Beta3, but I observed the same > behaviour on FreeBSD 7.2. It should be total and it sounds like a bug in the device driver. It looks like ixgbe_update_stats_counters() overwrites the accumulated value of if_ierrors: /* Rx Errors */ ifp->if_ierrors = total_missed_rx + adapter->stats.crcerrs + adapter->stats.rlec; It also increments if_ierrors in ixgbe_rxeof(). The driver should only do one or the other, but probably not both. -- John Baldwin