From owner-svn-src-all@FreeBSD.ORG Mon Dec 1 06:47:27 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 140FF1065670 for ; Mon, 1 Dec 2008 06:47:27 +0000 (UTC) (envelope-from nparhar@gmail.com) Received: from wf-out-1314.google.com (wf-out-1314.google.com [209.85.200.169]) by mx1.freebsd.org (Postfix) with ESMTP id DC80F8FC16 for ; Mon, 1 Dec 2008 06:47:26 +0000 (UTC) (envelope-from nparhar@gmail.com) Received: by wf-out-1314.google.com with SMTP id 24so2555157wfg.7 for ; Sun, 30 Nov 2008 22:47:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:subject :message-id:mail-followup-to:references:mime-version:content-type :content-disposition:in-reply-to:user-agent; bh=j+v2LrXvYjeRgoEFlJpiOpL1N78KNUz0iRg/7UGOYm0=; b=VA4wQQ0fVXrfe5McAhW7uZzBXHUKK64f/Ylrr/mUZZc7N19WZHWz64tgrN3PQBYuyy /GWgi4/JzSpQ09GSuRKdymGFt17gr19NGK+5zjBnvGobl4Yf85UrxObU9gTOsKOu2z/4 /J9Ywny9aKaJlA3THXP0qFXejbSKcTzm2STHw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:subject:message-id:mail-followup-to:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; b=UaUvGm2eO7Ltht/tq0lqjWfQ0ZE6tbqUdpWYguySChSqf3Y8vdxVK5b4dvbUrfv++3 /IojtgUzDPHTHll+Oby16hRztJx5aLOve9DanRvA5PVIpkHyMOqL4jnUo4qU+RB2jmWn EzWq5K5qbvBKrCGCfq360Ik5iekN2q34naQ58= Received: by 10.142.162.5 with SMTP id k5mr726316wfe.113.1228112212694; Sun, 30 Nov 2008 22:16:52 -0800 (PST) Received: from insightsol.com (h-67-100-74-36.snvacaid.covad.net [67.100.74.36]) by mx.google.com with ESMTPS id 29sm3380908wfg.6.2008.11.30.22.16.50 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 30 Nov 2008 22:16:51 -0800 (PST) Date: Sun, 30 Nov 2008 22:16:47 -0800 From: Navdeep Parhar To: svn-src-all@freebsd.org Message-ID: <20081201061647.GA10625@insightsol.com> Mail-Followup-To: svn-src-all@freebsd.org References: <200812010441.mB14fj1M012485@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200812010441.mB14fj1M012485@svn.freebsd.org> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) Subject: Re: svn commit: r185506 - head/sys/dev/cxgb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Dec 2008 06:47:27 -0000 Kip, pi->mac.stats are not updated too frequently, especially when compared to the rates at which packets/bytes are sent and received. The ifp-> counters will lag behind the actual values. This will affect the "realtime-ness" of the stats seen via utilities like netstat. We should continue to increment the ifp's counters as best as we can during tx/rx. It is good to sync them up with mac.stats every so often, but relying exclusively on mac.stats may not be best. Regards, Navdeep On Mon, Dec 01, 2008 at 04:41:45AM +0000, Kip Macy wrote: > 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++; > > /* > _______________________________________________ > svn-src-all@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"