From owner-freebsd-bugs Fri Jan 31 15:10:26 2003 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4428A37B405 for ; Fri, 31 Jan 2003 15:10:21 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5B5E743FE3 for ; Fri, 31 Jan 2003 15:10:16 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id h0VNAGNS005911 for ; Fri, 31 Jan 2003 15:10:16 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id h0VNAGQG005910; Fri, 31 Jan 2003 15:10:16 -0800 (PST) Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6685837B401 for ; Fri, 31 Jan 2003 15:08:27 -0800 (PST) Received: from piquet.isc.org (piquet.isc.org [204.152.184.233]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2037243F3F for ; Fri, 31 Jan 2003 15:08:27 -0800 (PST) (envelope-from vixie@piquet.isc.org) Received: by piquet.isc.org (Postfix, from userid 716) id 23D39125426; Fri, 31 Jan 2003 23:08:27 +0000 (UTC) Message-Id: <20030131230827.23D39125426@piquet.isc.org> Date: Fri, 31 Jan 2003 23:08:27 +0000 (UTC) From: Paul Vixie To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: kern/47773: "em" network device does not update packet counters smoothly Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 47773 >Category: kern >Synopsis: "em" network device does not update packet counters smoothly >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Jan 31 15:10:16 PST 2003 >Closed-Date: >Last-Modified: >Originator: Paul Vixie >Release: FreeBSD 5.0-RELEASE i386 >Organization: ISC >Environment: System: FreeBSD piquet.isc.org 5.0-RELEASE FreeBSD 5.0-RELEASE #0: Fri Jan 17 07:53:27 UTC 2003 root@piquet.isc.org:/usr/src/sys/i386/compile/ISC_FBSD_5_SMP i386 >Description: "em" network device packet counters only update every other second >How-To-Repeat: # netstat 1 input (Total) output packets errs bytes packets errs bytes colls 0 0 49411 0 0 99551 0 1113 0 47959 1159 0 90625 0 0 0 43280 0 0 85302 0 971 0 46905 1008 0 92500 0 2 0 47095 2 0 92107 0 1070 0 47132 1123 0 91538 0 0 0 47209 0 0 89947 0 1088 0 49646 1138 0 96308 0 ^C >Fix: --- sys/dev/em/if_em.h.orig Fri Jan 31 22:31:33 2003 +++ sys/dev/em/if_em.h Fri Jan 31 22:33:58 2003 @@ -192,6 +192,13 @@ */ #define WAIT_FOR_AUTO_NEG_DEFAULT 1 +/* + * This parameter controls the time between calls to the local + * maintainance function, which among other things fetches counters + * from the device and updates the interface statistics. + * measured in ticks + */ +#define MAINT_TIMER_INTERVAL (hz) /* Tunables -- End */ --- sys/dev/em/if_em.c.orig Fri Jan 31 22:19:18 2003 +++ sys/dev/em/if_em.c Fri Jan 31 22:33:58 2003 @@ -680,7 +680,7 @@ ifp->if_hwassist = 0; } - adapter->timer_handle = timeout(em_local_timer, adapter, 2*hz); + adapter->timer_handle = timeout(em_local_timer, adapter, MAINT_TIMER_INTERVAL); em_clear_hw_cntrs(&adapter->hw); #ifdef DEVICE_POLLING /* @@ -719,7 +719,7 @@ em_check_for_link(&adapter->hw); em_print_link_status(adapter); adapter->timer_handle = timeout(em_local_timer, - adapter, 2*hz); + adapter, MAINT_TIMER_INTERVAL); } } if (ifp->if_flags & IFF_RUNNING) { @@ -770,7 +770,7 @@ em_check_for_link(&adapter->hw); em_print_link_status(adapter); adapter->timer_handle = - timeout(em_local_timer, adapter, 2*hz); + timeout(em_local_timer, adapter, MAINT_TIMER_INTERVAL); } if (ifp->if_flags & IFF_RUNNING) { @@ -1160,7 +1160,8 @@ if (em_display_debug_stats && ifp->if_flags & IFF_RUNNING) { em_print_hw_stats(adapter); } - adapter->timer_handle = timeout(em_local_timer, adapter, 2*hz); + adapter->timer_handle = timeout(em_local_timer, adapter, + MAINT_TIMER_INTERVAL); splx(s); return; >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message