From owner-freebsd-bugs Tue Aug 10 18:20:14 1999 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id 3C47414BD4 for ; Tue, 10 Aug 1999 18:20:08 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id SAA43697; Tue, 10 Aug 1999 18:20:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from doubleday.csl.cornell.edu (DOUBLEDAY.CSL.CORNELL.EDU [132.236.71.12]) by hub.freebsd.org (Postfix) with ESMTP id AF4CD14D2F for ; Tue, 10 Aug 1999 18:11:56 -0700 (PDT) (envelope-from rajit@csl.cornell.edu) Received: (from rajit@localhost) by doubleday.csl.cornell.edu (8.9.3/8.9.2) id VAA01577; Tue, 10 Aug 1999 21:09:05 -0400 (EDT) (envelope-from rajit) Message-Id: <199908110109.VAA01577@doubleday.csl.cornell.edu> Date: Tue, 10 Aug 1999 21:09:05 -0400 (EDT) From: Rajit Manohar Reply-To: rajit@csl.cornell.edu To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: kern/13062: lnc ethernet xmit underflow problem Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >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 /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 *** 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