Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 Jun 2005 01:48:05 +0200
From:      Erik Trulsson <ertr1013@student.uu.se>
To:        Steve Friedrich <freeBSD@InsightBB.com>
Cc:        FreeBSD Questions <freebsd-questions@freebsd.org>
Subject:   Re: ethernet driver underruns
Message-ID:  <20050615234805.GA17247@falcon.midgard.homeip.net>
In-Reply-To: <20050615233202.4607543D4C@mx1.FreeBSD.org>
References:  <20050615233202.4607543D4C@mx1.FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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.





-- 
<Insert your favourite quote here.>
Erik Trulsson
ertr1013@student.uu.se



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050615234805.GA17247>