From owner-freebsd-hackers Wed Mar 25 03:19:24 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id DAA21408 for freebsd-hackers-outgoing; Wed, 25 Mar 1998 03:19:24 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from bleep.ishiboo.com (user7201@bleep.ishiboo.com [206.64.4.226]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id DAA21403 for ; Wed, 25 Mar 1998 03:19:21 -0800 (PST) (envelope-from black@bleep.ishiboo.com) From: black@bleep.ishiboo.com Received: (qmail 16877 invoked by uid 1018); 25 Mar 1998 11:21:44 -0000 Message-ID: <19980325112144.20157.qmail@bleep.ishiboo.com> Subject: interface byte count insanity To: freebsd-hackers@FreeBSD.ORG Date: Wed, 25 Mar 1998 06:21:43 -0500 (EST) X-Mailer: ELM [version 2.4ME+ PL32 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG i've been mucking around with struct if_data to get useful interface statistics out of the kernel and have stumbled upon some rather ugly behavior. theo deraadt wrote a little kernel patch for me that adds a socket ioctl call to return the if_data structure for an interface, and i then modified ifconfig to print interface stats using the new ioctl. i tested on a P6-200 running vanilla 2.2.5R using de, fxp, and vx cards. for all cards tested the byte counts for both input and output are complete, though slowly increasing, garbage. after transferring over 100MB through the interface i saw this: de0: flags=8843 mtu 1500 82632 packets input, 39371 bytes, 0 drops, 0 errors 39371 packets output, 2178386 bytes, 154 collisions, 0 errors inet 172.21.8.239 netmask 0xffffff00 broadcast 172.21.8.255 ether 00:40:05:41:10:18 media: autoselect (10baseT/UTP) status: active the packet counts are about right, but the byte counts are obviously silly. another oddity is the higher collision rate with the de card vs. the fxp card. i saw single digit collisions for the same amount of data with the fxp. i will re-run the tests to verify this behavior. do any of the current ethernet drivers correctly increment their byte counts? would anyone be averse to expanding struct if_data to include more detailed stats on errors and collision types? would the kernel and ifconfig patches be worth commiting to the tree (the kernel patch is particularly useful because it allows a modified netstat to run without being setgid kmem)? ben To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message