From patchwork Wed May 6 08:56:38 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jesper Dangaard Brouer X-Patchwork-Id: 26899 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@bilbo.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id 6CDF8B7043 for ; Wed, 6 May 2009 18:56:48 +1000 (EST) Received: by ozlabs.org (Postfix) id 5C937DDDF9; Wed, 6 May 2009 18:56:48 +1000 (EST) Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id F35D5DDDF3 for ; Wed, 6 May 2009 18:56:47 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752816AbZEFI4k (ORCPT ); Wed, 6 May 2009 04:56:40 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752813AbZEFI4k (ORCPT ); Wed, 6 May 2009 04:56:40 -0400 Received: from lanfw001a.cxnet.dk ([87.72.215.196]:53498 "EHLO lanfw001a.cxnet.dk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751660AbZEFI4j (ORCPT ); Wed, 6 May 2009 04:56:39 -0400 Received: from comxexch02.comx.local (unknown [172.31.1.117]) by lanfw001a.cxnet.dk (Postfix) with ESMTP id D25BF163698; Wed, 6 May 2009 10:56:38 +0200 (CEST) Received: from 172.31.4.93 ([172.31.4.93]) by comxexch02.comx.local ([172.31.1.117]) with Microsoft Exchange Server HTTP-DAV ; Wed, 6 May 2009 08:56:38 +0000 Received: from hawk by comxexch02.comx.local; 06 May 2009 10:56:38 +0200 Subject: [PATCH v2] igb: Record host memory receive overflow in net_stats From: Jesper Dangaard Brouer Reply-To: jdb@comx.dk To: "Ronciak, John" , "David S. Miller" Cc: Jesper Dangaard Brouer , "Kirsher, Jeffrey T" , netdev , "e1000-devel@lists.sourceforge.net" , "Brandeburg, Jesse" , "Allan, Bruce W" , "Waskiewicz Jr, Peter P" In-Reply-To: <1241597562.5172.25.camel@localhost.localdomain> References: <1241435206.8115.104.camel@localhost.localdomain> <9929d2390905051147y71f34e4bu9f63edc1e5a253a2@mail.gmail.com> <20090505.115819.84151021.davem@davemloft.net> <273D38FBE7C6FE46A1689FCD014A0B8B49655903@azsmsx505.amr.corp.intel.com> <1241597562.5172.25.camel@localhost.localdomain> Organization: ComX Networks A/S Date: Wed, 06 May 2009 10:56:38 +0200 Message-Id: <1241600198.5172.36.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.6.3 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The RNBC (Receive No Buffers Count) register for the 82576, indicate that frames were received when there were no available buffers in host memory to store those frames (receive descriptor head and tail pointers were equal). The packet is still received by the NIC if there is space in the FIFO I have shown that this situation can arise when the kernel is too busy else where. As the the RNBC value is not necessary a packet drop, I choose to store the RNBC value in net_stats.rx_fifo_errors. Saving the stats in dev->net_stats makes it visible via /proc/net/dev as "fifo", and thus viewable to ifconfig as "overruns" and 'netstat -i' as "RX-OVR". The Receive No Buffers Count (RNBC) can already be queried by ethtool -S as "rx_no_buffer_count". Signed-off-by: Jesper Dangaard Brouer --- drivers/net/igb/igb_main.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) -- 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 --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c index 183235d..3ee00a5 100644 --- a/drivers/net/igb/igb_main.c +++ b/drivers/net/igb/igb_main.c @@ -3597,6 +3597,10 @@ void igb_update_stats(struct igb_adapter *adapter) adapter->net_stats.rx_frame_errors = adapter->stats.algnerrc; adapter->net_stats.rx_missed_errors = adapter->stats.mpc; + /* Note RNBC (Receive No Buffers Count) is an overflow + * indication, thus not necessary a dropped packet. */ + adapter->net_stats.rx_fifo_errors = adapter->stats.rnbc; + /* Tx Errors */ adapter->net_stats.tx_errors = adapter->stats.ecol + adapter->stats.latecol;