From owner-freebsd-questions@FreeBSD.ORG Wed Jun 15 23:48:08 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4F95716A41C for ; Wed, 15 Jun 2005 23:48:08 +0000 (GMT) (envelope-from ertr1013@student.uu.se) Received: from pne-smtpout1-sn2.hy.skanova.net (pne-smtpout1-sn2.hy.skanova.net [81.228.8.83]) by mx1.FreeBSD.org (Postfix) with ESMTP id 09A4943D1D for ; Wed, 15 Jun 2005 23:48:07 +0000 (GMT) (envelope-from ertr1013@student.uu.se) Received: from falcon.midgard.homeip.net (212.181.162.201) by pne-smtpout1-sn2.hy.skanova.net (7.2.059.6) id 42AE9D5C000737AB for freebsd-questions@freebsd.org; Thu, 16 Jun 2005 01:48:06 +0200 Received: (qmail 17312 invoked by uid 1001); 16 Jun 2005 01:48:05 +0200 Date: Thu, 16 Jun 2005 01:48:05 +0200 From: Erik Trulsson To: Steve Friedrich Message-ID: <20050615234805.GA17247@falcon.midgard.homeip.net> Mail-Followup-To: Steve Friedrich , FreeBSD Questions References: <20050615233202.4607543D4C@mx1.FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050615233202.4607543D4C@mx1.FreeBSD.org> User-Agent: Mutt/1.5.9i Cc: FreeBSD Questions Subject: Re: ethernet driver underruns X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2005 23:48:08 -0000 On Wed, Jun 15, 2005 at 07:32:08PM -0400, Steve Friedrich wrote: > Sometimes I get: > > dc0: TX underrun -- increasing TX threshold > > Can I discover what it set the threshold to and configure it accordingly? Only by looking at the sourcecode - and to change the default values you will need to recompile the kernel. Doing that is probably not worth the trouble, but if you really want to do it see below. The relevant constants are defined in /sys/pci/if_dcreg.h as follows: #define DC_TXTHRESH_MIN 0x00000000 #define DC_TXTHRESH_INC 0x00004000 #define DC_TXTHRESH_MAX 0x0000C000 DC_TXTHRESH_MIN is the starting value for the threshold. DC_TXTHRESH_INC is how much the threshold is increased each time you see the message you quote, and DC_TXTHRESH_MAX is the maximum value the threshold will be set to - after that the driver will use store-and-forward mode instead. A quick bit of arithmetic shows that the threshold will be increased at most three times. If a fourth underrun occurs it goes directly to store-and-forward mode. What all this actually means in practice is explained in the Diagnostics section of the dc(4) manpage as follows: dc%d: TX underrun -- increasing TX threshold The device generated a transmit underrun error while attempting to DMA and transmit a packet. This happens if the host is not able to DMA the packet data into the NIC's FIFO fast enough. The driver will dynamically increase the trans- mit start threshold so that more data must be DMAed into the FIFO before the NIC will start transmitting it onto the wire. dc%d: TX underrun -- using store and forward mode The device continued to generate transmit underruns even after all possible transmit start threshold settings had been tried, so the driver programmed the chip for store and forward mode. In this mode, the NIC will not begin transmis- sion until the entire packet has been transfered into its FIFO memory. -- Erik Trulsson ertr1013@student.uu.se