From owner-svn-src-head@FreeBSD.ORG Mon Mar 12 03:47:31 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id ABA35106566C; Mon, 12 Mar 2012 03:47:31 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7D6648FC0A; Mon, 12 Mar 2012 03:47:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2C3lVSr041256; Mon, 12 Mar 2012 03:47:31 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2C3lVw9041253; Mon, 12 Mar 2012 03:47:31 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201203120347.q2C3lVw9041253@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 12 Mar 2012 03:47:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232850 - head/sys/dev/bge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Mar 2012 03:47:31 -0000 Author: yongari Date: Mon Mar 12 03:47:30 2012 New Revision: 232850 URL: http://svn.freebsd.org/changeset/base/232850 Log: Make if_ierrors updated whenever any of the following counters are updated. o Number of times NIC ran out of RX buffer descriptors o Number of inbound packet errors o Number of inbound packets that were chosen to be discarded Previously only the discarded packet counter was used to update if_ierrors. This change fixes wrong if_ierrors counter on BCM570[0-4] controllers. For BCM5705 and later controllers bge(4) already correctly counted it. Reported by: Eugene Grosbein rdtc dot ru> Modified: head/sys/dev/bge/if_bge.c head/sys/dev/bge/if_bgereg.h Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Mon Mar 12 02:42:47 2012 (r232849) +++ head/sys/dev/bge/if_bge.c Mon Mar 12 03:47:30 2012 (r232850) @@ -4489,6 +4489,12 @@ bge_stats_update(struct bge_softc *sc) ifp->if_collisions += (uint32_t)(cnt - sc->bge_tx_collisions); sc->bge_tx_collisions = cnt; + cnt = READ_STAT(sc, stats, nicNoMoreRxBDs.bge_addr_lo); + ifp->if_ierrors += (uint32_t)(cnt - sc->bge_rx_nobds); + sc->bge_rx_nobds = cnt; + cnt = READ_STAT(sc, stats, ifInErrors.bge_addr_lo); + ifp->if_ierrors += (uint32_t)(cnt - sc->bge_rx_inerrs); + sc->bge_rx_inerrs = cnt; cnt = READ_STAT(sc, stats, ifInDiscards.bge_addr_lo); ifp->if_ierrors += (uint32_t)(cnt - sc->bge_rx_discards); sc->bge_rx_discards = cnt; Modified: head/sys/dev/bge/if_bgereg.h ============================================================================== --- head/sys/dev/bge/if_bgereg.h Mon Mar 12 02:42:47 2012 (r232849) +++ head/sys/dev/bge/if_bgereg.h Mon Mar 12 03:47:30 2012 (r232850) @@ -2861,6 +2861,8 @@ struct bge_softc { int bge_csum_features; struct callout bge_stat_ch; uint32_t bge_rx_discards; + uint32_t bge_rx_inerrs; + uint32_t bge_rx_nobds; uint32_t bge_tx_discards; uint32_t bge_tx_collisions; #ifdef DEVICE_POLLING