ethernet driver underruns

Erik Trulsson ertr1013 at
Wed Jun 15 23:48:08 GMT 2005

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 at

More information about the freebsd-questions mailing list