Date: Tue, 26 Feb 2002 00:50:19 -0800 (PST) From: Pavel Plesov <mclap@ulstu.ru> To: freebsd-gnats-submit@FreeBSD.org Subject: kern/35339: Increase of the counter of collisions at use of the device rl0 Message-ID: <200202260850.g1Q8oJP08843@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200202260850.g1Q8oJP08843>
