Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 Aug 1999 21:09:05 -0400 (EDT)
From:      Rajit Manohar <rajit@csl.cornell.edu>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   kern/13062: lnc ethernet xmit underflow problem
Message-ID:  <199908110109.VAA01577@doubleday.csl.cornell.edu>

next in thread | raw e-mail | index | archive | help

>Number:         13062
>Category:       kern
>Synopsis:       lnc ethernet xmit underflow problem
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Aug 10 18:20:00 PDT 1999
>Closed-Date:
>Last-Modified:
>Originator:     Rajit Manohar
>Release:        FreeBSD 3.2-RELEASE i386
>Organization:
Cornell Computer Systems Laboratory
>Environment:

Running a cluster of Dell (xl0 driver, 3c905B PCI nic) and HP Kayak XU
(lnc1 driver PCnet-FAST+ PCI, Am79C972 nic) connected by a 100Mbps
switched ethernet.  The Dells run FreeBSD 3.1-RELEASE, and the Kayaks
run 3.2-RELEASE.

>Description:

The PCI lnc driver on the Kayak reports transmit underflow errors. The
following message appears on console repeatedly:

Aug  6 12:00:00 <host> /kernel: lnc1: Transmit underflow error -- Resetting

The system also exhibits poor throughput; an ftp between two Kayaks
results in transmit rates of between 300KB/sec and 700KB/sec, well
below the 100Mbps transfer rate.

>How-To-Repeat:

ftp a file (like /kernel) from one machine to another. Any sustained
network activity results in the above problem.

>Fix:
	
It appears that under certain cases, the data being transferred from
memory to the nic does not arrive in time for the transmitter,
resulting in the underflow. The Am79C972 nic has a bus control bit
that can be set to prevent any message transmits until the entire
message is DMAed to the network card SRAM. Setting this bit solves
both the transmit underflow problem as well as the throughput problem,
since the card is no longer periodically reset. I've included a patch
for i386/isa/if_lnc.c for 3.2-RELEASE.

I check that the nic # is > PCnet_FAST (i.e. == PCnet_FASTplus) before 
changing the bus control register. This might work on the Am79C97x,
but I only have Am79C972 nics.

After the modifications, I no longer get any transmit underflow
errors, and I can ftp files at 10MB/sec between the Kayaks. :)

-Rajit Manohar <rajit@csl.cornell.edu>


*** if_lnc.c.orig	Mon Aug  9 16:23:27 1999
--- if_lnc.c	Tue Aug 10 12:10:07 1999
***************
*** 1504,1516 ****
  
  	write_csr(sc, CSR3, 0);
  
  	/* Let's see if it starts */
  
  	write_csr(sc, CSR0, INIT);
  	for (i = 0; i < 1000; i++)
  		if (read_csr(sc, CSR0) & IDON)
  			break;
- 
  	/*
  	 * Now that the initialisation is complete there's no reason to
  	 * access anything except CSR0, so we leave RAP pointing there
--- 1504,1528 ----
  
  	write_csr(sc, CSR3, 0);
  
+ 	/* 
+ 	 * If we have a Am79C972 card, we set the NOUFLO bit
+ 	 * (bit 11) in BCR18 to avoid underflow errors.
+ 	 * The #define's really should go into ic/
+ 	 */
+ #define BCR18 18
+ #define NOUFLO 0x0800
+ 	if (sc->nic.ic > PCnet_FAST) {
+ 	  u_short oval;
+ 	  oval = read_bcr (sc, BCR18);
+ 	  write_bcr (sc, BCR18, oval|NOUFLO);
+ 	}
+ 
  	/* Let's see if it starts */
  
  	write_csr(sc, CSR0, INIT);
  	for (i = 0; i < 1000; i++)
  		if (read_csr(sc, CSR0) & IDON)
  			break;
  	/*
  	 * Now that the initialisation is complete there's no reason to
  	 * access anything except CSR0, so we leave RAP pointing there



>Release-Note:
>Audit-Trail:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




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