From owner-svn-src-head@FreeBSD.ORG Mon Dec 1 04:41:46 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0C3F0106564A; Mon, 1 Dec 2008 04:41:46 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F1A3F8FC18; Mon, 1 Dec 2008 04:41:45 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mB14fjRr012486; Mon, 1 Dec 2008 04:41:45 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB14fj1M012485; Mon, 1 Dec 2008 04:41:45 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200812010441.mB14fj1M012485@svn.freebsd.org> From: Kip Macy Date: Mon, 1 Dec 2008 04:41:45 +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: r185506 - head/sys/dev/cxgb 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, 01 Dec 2008 04:41:46 -0000 Author: kmacy Date: Mon Dec 1 04:41:45 2008 New Revision: 185506 URL: http://svn.freebsd.org/changeset/base/185506 Log: Proper fix for tracking ifnet statistics Modified: head/sys/dev/cxgb/cxgb_main.c Modified: head/sys/dev/cxgb/cxgb_main.c ============================================================================== --- head/sys/dev/cxgb/cxgb_main.c Mon Dec 1 04:03:17 2008 (r185505) +++ head/sys/dev/cxgb/cxgb_main.c Mon Dec 1 04:41:45 2008 (r185506) @@ -2203,6 +2203,58 @@ cxgb_tick_handler(void *arg, int count) if (p->linkpoll_period) check_link_status(sc); + + for (i = 0; i < sc->params.nports; i++) { + struct port_info *pi = &sc->port[i]; + struct ifnet *ifp = pi->ifp; + struct mac_stats *mstats = &pi->mac.stats; + + ifp->if_opackets = + mstats->tx_frames_64 + + mstats->tx_frames_65_127 + + mstats->tx_frames_128_255 + + mstats->tx_frames_256_511 + + mstats->tx_frames_512_1023 + + mstats->tx_frames_1024_1518 + + mstats->tx_frames_1519_max; + + ifp->if_ipackets = + mstats->rx_frames_64 + + mstats->rx_frames_65_127 + + mstats->rx_frames_128_255 + + mstats->rx_frames_256_511 + + mstats->rx_frames_512_1023 + + mstats->rx_frames_1024_1518 + + mstats->rx_frames_1519_max; + + ifp->if_obytes = mstats->tx_octets; + ifp->if_ibytes = mstats->rx_octets; + ifp->if_omcasts = mstats->tx_mcast_frames; + ifp->if_imcasts = mstats->rx_mcast_frames; + + ifp->if_collisions = + mstats->tx_total_collisions; + + ifp->if_iqdrops = mstats->rx_cong_drops; + + ifp->if_oerrors = + mstats->tx_excess_collisions + + mstats->tx_underrun + + mstats->tx_len_errs + + mstats->tx_mac_internal_errs + + mstats->tx_excess_deferral + + mstats->tx_fcs_errs; + ifp->if_ierrors = + mstats->rx_jabber + + mstats->rx_data_errs + + mstats->rx_sequence_errs + + mstats->rx_runt + + mstats->rx_too_long + + mstats->rx_mac_internal_errs + + mstats->rx_short + + mstats->rx_fcs_errs; + } + sc->check_task_cnt++; /*