From owner-freebsd-bugs Tue Feb 26 1: 0:29 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 25F5537B427 for ; Tue, 26 Feb 2002 01:00:10 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g1Q908j10371; Tue, 26 Feb 2002 01:00:08 -0800 (PST) (envelope-from gnats) Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 1B9D437B41E for ; Tue, 26 Feb 2002 00:50:19 -0800 (PST) Received: (from nobody@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g1Q8oJP08843; Tue, 26 Feb 2002 00:50:19 -0800 (PST) (envelope-from nobody) Message-Id: <200202260850.g1Q8oJP08843@freefall.freebsd.org> Date: Tue, 26 Feb 2002 00:50:19 -0800 (PST) From: Pavel Plesov To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-1.0 Subject: kern/35339: Increase of the counter of collisions at use of the device rl0 Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 35339 >Category: kern >Synopsis: Increase of the counter of collisions at use of the device rl0 >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Feb 26 01:00:08 PST 2002 >Closed-Date: >Last-Modified: >Originator: Pavel Plesov >Release: 4.5-RELEASE >Organization: Ulyanovsk State Technical University, ICC420 >Environment: FreeBSD sp.simtts.mv.ru 4.5-RELEASE FreeBSD 4.5-RELEASE #1: Wed Feb 6 17:48:58 MSK 2002 root@install.tts.local:/usr/src/sys/compile/O1/i386 >Description: I use network card D-Link DFE-530TX+. After network traffic (file transfer) I get collision counter to fast increase (in output of netstat -ni) with no "Oerrs" reported. media 10baseT/UTP. For first look, as can I suppose, /usr/src/sys/pci/if_rl.c do incorrect count collisions. For example, in linux driver (ftp://ftp.dlink.com/NIC/dfe530tx/Driver/dfe530tx_driver_101601.exe, or ftp://ftp.dlink.com/NIC/dfe530tx+/Driver/dfe530TX+_linux_driver_051801.zip) for this card: ---cut--- /* rtl8139.c: A RealTek RTL8129/8139 Fast Ethernet driver for Linux. */ /* Written 1997-1999 by Donald Becker. ... while (tp->cur_tx - dirty_tx > 0) { int entry = dirty_tx % NUM_TX_DESC; int txstatus = inl(ioaddr + TxStatus0 + entry*4); if ( ! (txstatus & (TxStatOK | TxUnderrun | TxAborted))) break; /* It still hasn't been Txed */ /* Note: TxCarrierLost is always asserted at 100mbps. */ if (txstatus & (TxOutOfWindow | TxAborted)) { /* There was an major error, log it. */ if (rtl8129_debug > 1) printk(KERN_NOTICE"%s: Transmit error, Tx status %8.8x.\n", dev->name, txstatus); tp->stats.tx_errors++; if (txstatus&TxAborted) { tp->stats.tx_aborted_errors++; outl((TX_DMA_BURST<<8)|0x03000001, ioaddr + TxConfig); } if (txstatus&TxCarrierLost) tp->stats.tx_carrier_errors++; if (txstatus&TxOutOfWindow) tp->stats.tx_window_errors++; #ifdef ETHER_STATS if ((txstatus & 0x0f000000) == 0x0f000000) tp->stats.collisions16++; #endif } else { if (txstatus & TxUnderrun) { /* Add 64 to the Tx FIFO threshold. */ if (tp->tx_flag < 0x00300000) tp->tx_flag += 0x00020000; tp->stats.tx_fifo_errors++; } tp->stats.collisions += (txstatus >> 24) & 15; #if LINUX_VERSION_CODE > 0x20119 tp->stats.tx_bytes += txstatus & 0x7ff; #endif tp->stats.tx_packets++; } /* Free the original skb. */ dev_free_skb(tp->tx_skbuff[entry]); tp->tx_skbuff[entry] = 0; if (test_bit(0, &tp->tx_full)) { /* The ring is no longer full, clear tbusy. */ clear_bit(0, &tp->tx_full); clear_bit(0, (void*)&dev->tbusy); mark_bh(NET_BH); } dirty_tx++; } ---cut--- And, under FreeBSD, in /usr/src/sys/pci/if_rl.c We get: ---cut--- do { txstat = CSR_READ_4(sc, RL_LAST_TXSTAT(sc)); if (!(txstat & (RL_TXSTAT_TX_OK| RL_TXSTAT_TX_UNDERRUN|RL_TXSTAT_TXABRT))) break; ifp->if_collisions += (txstat & RL_TXSTAT_COLLCNT) >> 24; ---cut--- >How-To-Repeat: FTP/Samba file transfer. >Fix: >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message