From leres@ee.lbl.gov  Tue Feb 15 01:53:26 2005
Return-Path: <leres@ee.lbl.gov>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id D472516A4CF
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 15 Feb 2005 01:53:26 +0000 (GMT)
Received: from fun.ee.lbl.gov (fun.ee.lbl.gov [131.243.1.81])
	by mx1.FreeBSD.org (Postfix) with ESMTP id A27FE43D48
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 15 Feb 2005 01:53:26 +0000 (GMT)
	(envelope-from leres@ee.lbl.gov)
Received: from fun.ee.lbl.gov (localhost [127.0.0.1])
	by fun.ee.lbl.gov (8.13.3/8.13.3) with ESMTP id j1F1rQtS076880
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 14 Feb 2005 17:53:26 -0800 (PST)
Received: from fun.ee.lbl.gov (leres@localhost)
	by fun.ee.lbl.gov (8.13.3/8.13.3/Submit) with ESMTP id j1F1rP7F076877
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 14 Feb 2005 17:53:26 -0800 (PST)
Message-Id: <200502150153.j1F1rP7F076877@fun.ee.lbl.gov>
Date: Mon, 14 Feb 2005 17:53:25 -0800
From: Craig Leres <leres@ee.lbl.gov>
To: FreeBSD-gnats-submit@freebsd.org
Subject: em driver if_oerrors book keeping error
X-Send-Pr-Version: 3.113

>Number:         77541
>Category:       kern
>Synopsis:       [em] [patch] if_oerrors book keeping error
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    glebius
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Feb 15 02:00:41 GMT 2005
>Closed-Date:    Mon Dec 12 14:15:56 GMT 2005
>Last-Modified:  Mon Dec 12 14:15:56 GMT 2005
>Originator:     Craig Leres
>Release:        FreeBSD 4.10-RELEASE i386
>Organization:
Lawrence Berkeley National Laboratory
>Environment:
>Description:
	It looks like if the chip goes to sleep, em_watchdog() is
	invoked and if_oerrors is incremented. However,
	em_update_stats_counters() overwrites if_oerrors every 2
	seconds with the sum of excessive and late collisions. So
	the output error counter for does not tally watchdog timeouts
	and also can be seen to decrease.

>How-To-Repeat:
>Fix:

	If it's desirable to keep track of watchdog timeouts (I
	believe it is) a simple fix would be to tally watch dog
	timeouts separately and then add them in when calculating
	if_oerrors in em_update_stats_counters().

	An untested, partital suggested fix is appended

==============================================================================

*** if_em.c.virgin	Mon Feb 14 17:49:13 2005
--- if_em.c	Mon Feb 14 17:52:37 2005
***************
*** 780,785 ****
--- 780,786 ----
  	em_init(adapter);
  
  	ifp->if_oerrors++;
+ 	adapter->watchdog_timeout++;
  	return;
  }
  
***************
*** 2897,2903 ****
  	adapter->stats.mpc + adapter->stats.cexterr;
  
  	/* Tx Errors */
! 	ifp->if_oerrors = adapter->stats.ecol + adapter->stats.latecol;
  
  }
  
--- 2898,2905 ----
  	adapter->stats.mpc + adapter->stats.cexterr;
  
  	/* Tx Errors */
! 	ifp->if_oerrors = adapter->watchdog_timeout +
! 	    adapter->stats.ecol + adapter->stats.latecol;
  
  }
  
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-i386->freebsd-bugs 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Fri Jul 22 23:39:52 GMT 2005 
Responsible-Changed-Why:  
This does not sound i386-specific. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=77541 
State-Changed-From-To: open->closed 
State-Changed-By: glebius 
State-Changed-When: Mon Dec 12 14:14:58 UTC 2005 
State-Changed-Why:  
I've fixed this recently and merged to RELENG_6. 


Responsible-Changed-From-To: freebsd-bugs->glebius 
Responsible-Changed-By: glebius 
Responsible-Changed-When: Mon Dec 12 14:14:58 UTC 2005 
Responsible-Changed-Why:  
I've fixed this recently and merged to RELENG_6. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=77541 
>Unformatted:
 
