Received: with ECARTIS (v1.0.0; list netdev); Sat, 26 Feb 2005 10:36:28 -0800 (PST) Received: from e34.co.us.ibm.com (e34.co.us.ibm.com [32.97.110.132]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j1QIaOf5011617 for ; Sat, 26 Feb 2005 10:36:24 -0800 Received: from westrelay01.boulder.ibm.com (westrelay01.boulder.ibm.com [9.17.195.10]) by e34.co.us.ibm.com (8.12.10/8.12.9) with ESMTP id j1QIaIMN429560 for ; Sat, 26 Feb 2005 13:36:18 -0500 Received: from d03av01.boulder.ibm.com (d03av01.boulder.ibm.com [9.17.195.167]) by westrelay01.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id j1QIaIjF132822 for ; Sat, 26 Feb 2005 11:36:18 -0700 Received: from d03av01.boulder.ibm.com (loopback [127.0.0.1]) by d03av01.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id j1QIaIvk014884 for ; Sat, 26 Feb 2005 11:36:18 -0700 Received: from sig-9-65-35-105.mts.ibm.com (sig-9-65-35-105.mts.ibm.com [9.65.35.105]) by d03av01.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id j1QIaHPp014878; Sat, 26 Feb 2005 11:36:18 -0700 From: Jon Mason Organization: IBM To: Jeff Garzik Subject: Re: [PATCH]: r8169: Expose hardware stats via ethtool Date: Sat, 26 Feb 2005 12:36:17 -0600 User-Agent: KMail/1.7.2 Cc: Richard Dawe , Francois Romieu , netdev@oss.sgi.com References: <42208D83.80803@phekda.gotadsl.co.uk> <200502261132.29261.jdmason@us.ibm.com> <4220B9C6.1010106@pobox.com> In-Reply-To: <4220B9C6.1010106@pobox.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200502261236.17332.jdmason@us.ibm.com> X-Virus-Scanned: ClamAV 0.83/725/Fri Feb 25 03:28:29 2005 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 2077 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jdmason@us.ibm.com Precedence: bulk X-list: netdev Content-Length: 1931 Lines: 59 On Saturday 26 February 2005 12:02 pm, Jeff Garzik wrote: [...] > > @@ -255,6 +258,9 @@ enum RTL8169_register_content { > > Cfg9346_Lock = 0x00, > > Cfg9346_Unlock = 0xC0, > > > > + /* StatsAddr register */ > > + DumpStats = (1 << 3), > > + > > > > Wouldn't this be better as "0x08"? Also, RTL8169_register_content could > > do with a bit of tidying (values are expressed in decimal and hex, some > > are aligned and others not, etc). I'll try and come-up with a patch here > > in a bit. > > The form "(1 << n)" is preferred, since that form makes plain the bit > number, with zero neural transformation required. > > Use the more readable form. Cleanup patches accepted. My suggestion was based on code uniformity (as the rest of the values are defined as dex or decimal numbers). Which takes presidense, uniformity or readablity? If it is the latter, should the rest of thse values be redefined? > > > /* rx_mode_bits */ > > AcceptErr = 0x20, > > AcceptRunt = 0x10, > > @@ -380,6 +386,22 @@ struct ring_info { > > u8 __pad[sizeof(void *) - sizeof(u32)]; > > }; > > > > +struct rtl8169_stats { > > + u64 tx_ok; > > + u64 rx_ok; > > + u64 tx_err; > > + u32 rx_err; > > + u16 rx_fifo; > > + u16 frame_align; > > + u32 tx_ok_1col; > > + u32 tx_ok_mcol; > > + u64 rx_ok_phys; > > + u64 rx_ok_bcast; > > + u32 rx_ok_mcast; > > + u16 tx_abort; > > + u16 tx_underrun; > > +} __attribute__((packed)); > > + > > > > > > These could all be u64's. It would take-up more memory (and a bit more code in the register dump), but the values would be more accurate. Just an idea. > > No, this is the representation of the hardware DMA structure. > > It is defined by the hardware, not the programmer. Sorry, didn't see that on the first pass. My apologies. Jon