From owner-cvs-all@FreeBSD.ORG Tue Dec 12 23:02:17 2006 Return-Path: X-Original-To: cvs-all@FreeBSD.org Delivered-To: cvs-all@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2441816A4D0; Tue, 12 Dec 2006 23:02:17 +0000 (UTC) (envelope-from oleg@lath.rinet.ru) Received: from lath.rinet.ru (lath.rinet.ru [195.54.192.90]) by mx1.FreeBSD.org (Postfix) with ESMTP id D5B0F44BF3; Tue, 12 Dec 2006 22:24:45 +0000 (GMT) (envelope-from oleg@lath.rinet.ru) Received: from lath.rinet.ru (localhost [127.0.0.1]) by lath.rinet.ru (8.13.8/8.13.8) with ESMTP id kBCMPn1M094945 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 13 Dec 2006 01:25:49 +0300 (MSK) (envelope-from oleg@lath.rinet.ru) Received: (from oleg@localhost) by lath.rinet.ru (8.13.8/8.13.8/Submit) id kBCMPnvh094944; Wed, 13 Dec 2006 01:25:49 +0300 (MSK) (envelope-from oleg) Date: Wed, 13 Dec 2006 01:25:49 +0300 From: Oleg Bulyzhin To: Jung-uk Kim Message-ID: <20061212222549.GD91560@lath.rinet.ru> References: <200612111800.kBBI0Zv0047909@repoman.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200612111800.kBBI0Zv0047909@repoman.freebsd.org> User-Agent: Mutt/1.5.13 (2006-08-11) Cc: cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/dev/bge if_bge.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Dec 2006 23:02:17 -0000 On Mon, Dec 11, 2006 at 06:00:35PM +0000, Jung-uk Kim wrote: > jkim 2006-12-11 18:00:35 UTC > > FreeBSD src repository > > Modified files: > sys/dev/bge if_bge.c > Log: > - Correct collision counter for BCM5705+. This register is read/clear. > - Correct RX packet drop counter for BCM5705+. This register is read/clear > and it wraps very quickly under heavy packet drops because only the lower > ten bits are valid according to the documentation. However, it seems few > more bits are actually valid and the rest bits are always zeros[1]. > Therefore, we don't mask them off here. To get accurate packet drop count, > we need to check the register from bge_rxeof(). It is commented out for now, > not to penalize normal operation. Actual performance impact should be > measured later. > - Correct integer casting from u_long to uint32_t. Casting is not really > needed for all supported platforms but we better do this correctly[2]. > > Tested by: bde[1] > Suggested by: bde[2] > > Revision Changes Path > 1.158 +13 -10 src/sys/dev/bge/if_bge.c I didnt get the point of your u_long -> uint32_t changes. As i can see your change will cause more often wraps on 64bit archs: In rev. 1.153 you have converted cnt to uint32_t. Since cnt is stored in sc->bge_* counters you have shortened(on 64bit archs) them as well. P.S. Your current change is unclear to me too: since ifp counters and sc->_bge_ are both u_long i can not see any reason of converting (u_long) cast to (uint32_t) one. -- Oleg. ================================================================ === Oleg Bulyzhin -- OBUL-RIPN -- OBUL-RIPE -- oleg@rinet.ru === ================================================================