From owner-freebsd-stable@FreeBSD.ORG Thu Feb 7 23:45:20 2013 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id F3A0D431 for ; Thu, 7 Feb 2013 23:45:19 +0000 (UTC) (envelope-from jdc@koitsu.org) Received: from qmta07.emeryville.ca.mail.comcast.net (qmta07.emeryville.ca.mail.comcast.net [IPv6:2001:558:fe2d:43:76:96:30:64]) by mx1.freebsd.org (Postfix) with ESMTP id D1D587EF for ; Thu, 7 Feb 2013 23:45:19 +0000 (UTC) Received: from omta12.emeryville.ca.mail.comcast.net ([76.96.30.44]) by qmta07.emeryville.ca.mail.comcast.net with comcast id xUCg1k0060x6nqcA7blKjt; Thu, 07 Feb 2013 23:45:19 +0000 Received: from koitsu.strangled.net ([67.180.84.87]) by omta12.emeryville.ca.mail.comcast.net with comcast id xblH1k00u1t3BNj8YblJzg; Thu, 07 Feb 2013 23:45:19 +0000 Received: by icarus.home.lan (Postfix, from userid 1000) id A7FCD73A31; Thu, 7 Feb 2013 15:45:17 -0800 (PST) Date: Thu, 7 Feb 2013 15:45:17 -0800 From: Jeremy Chadwick To: Kurt Jaeger Subject: Re: ethtool-like utility for FreeBSD Message-ID: <20130207234517.GA23075@icarus.home.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20121106; t=1360280719; bh=SfqIv2hFKstjdTe5o6RJOBunsy1Tz93Z11lPg0cbiQU=; h=Received:Received:Received:Date:From:To:Subject:Message-ID: MIME-Version:Content-Type; b=c277jYvpQtiCeFVIhU4Bqyje0QdELI+Ls6UWl/5Lfq20pKJhaARRKcrQRwKTOT84R Og5sC/3Vmsxhosp8GVM2He5Vzr60hjyHOg7n5HzK6M8lbroGlCy0zrp+xQMkdWDuXQ +4JrKsJqS8PGyWZFqpKKY+p1sOWSxfke3INIV4awwyy0k4RImJJkVJo8T2PQP12Q/Y p11XY6SO+dfWYd9nh/WE193gsCfS50YpB+Bd4r3T6it9ffUCX9vO10A1MUg0j61xAE RvOnCN3DwKInWTQR6wBZI32CwdmtCgScTNzzvTbzO/cnA9LVY3KfjLQpGzQqgnja/X +p6afxDzob+8w== Cc: freebsd-stable@freebsd.org X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Feb 2013 23:45:20 -0000 > There is a posting public about Intel ethernet adapters and their > packets of death: > > http://blog.krisk.org/2013/02/packets-of-death.html > > Now, how can we test the EEPROM from FreeBSD, similar to the > ethtool of Linux ? There is no such tool. If you want to dump EEPROM contents, you can do so via one of the following ways for em(4) NICs or igb(4) NICs, as root: sysctl dev.XXX.Y.nvm=1 (for recent/newer FreeBSD) sysctl dev.XXX.Y.debug=2 (for older FreeBSD) Where XXX is either "em" or "igb" depending on your NIC and Y is the interface number (e.g. 0 = em0, 1 = em1, etc.). After this, run "dmesg" and look at the output at the bottom. You will see something like this: Interface EEPROM Dump: Offset 0x0000 3000 d248 d022 0d30 f746 00f5 ffff ffff 0x0010 0100 ffff 026b 108c 15d9 108c 8086 83df 0x0020 0008 2000 7e14 0048 1000 00d8 0000 2700 0x0030 6cc9 3150 0722 040b 0984 0000 c000 0706 Please see this page, search for "EEPROM", which documents a different bug pertaining the Intel 82573 where some EEPROMs were shipped with a power-saving bit enabled. Read it, do not skim it, because it explains the EEPROM dump endian difference WRT Linux ethtool vs. FreeBSD's driver: https://wiki.freebsd.org/BugBusting/Commonly_reported_issues There is no way on FreeBSD to change EEPROM contents. You will need to use Linux ethtool for this, or -- strongly recommended -- ask Intel for their DOS-based utility that fixes the "packet of death" setting in the EEPROM and follow their instructions. You can also ask your NIC (or motherboard) vendor and make it their problem (I'm willing to bet a lot of them aren't aware of it). To whom it may concern: these sysctls really need to be documented. They have sysctl -d descriptions but they need to be documented in man pages. I can write the man page updates if need be. Now, as far as the "packet of death" thing is concerned: cry me a river. Why is it people today think that hardware devices are immune to bugs? Is it because they're solid-state, thus give off the impression "there can be no problems?" I don't get it. *sighs* This sort of stuff seems to come as a surprise to younger generations or people who really do believe "chips never have problems". It seems to me that it stems from, as the generations have progressed, less and less people actually understanding how things work (all the way down to th bare metal). All this bloody abstracted programming and abstracted ideas do nothing but hide how things work. Really pisses me off. It might be more of a "wow, I didn't expect this to be a problem so low-level" surprise, which just further fuels my point -- people seem to think things Just Work(tm) today, when in my experience things today ***do not*** Just Work(tm). Most things are Extremely Broken(tm). Just be glad the issue is with an EEPROM setting and not silicon-level, otherwise you'd be flat out screwed barring driver-level workarounds. -- | Jeremy Chadwick jdc@koitsu.org | | UNIX Systems Administrator http://jdc.koitsu.org/ | | Mountain View, CA, US | | Making life hard for others since 1977. PGP 4BD6C0CB |