freebsd-dev/sys
Bill Paul 73bf949c34 It appears that under certain circumstances that I still can't quite pin
down, the dc driver and receiver can fall out of sync with one another,
resulting in a condition where the chip continues to receive packets
but the driver never notices. Normally, the receive handler checks each
descriptor starting from the current producer index to see if the chip
has relinquished ownership, indicating that a packet has been received.
The driver hands the packet off to ether_input() and then prepares the
descriptor to receive another frame before moving on to the next
descriptor in the ring. But sometimes, the chip appears to skip a
descriptor. This leaves the driver testing the status word in a descriptor
that never gets updated. The driver still gets "RX done" interrupts but
never advances further into the RX ring, until the ring fills up and the
chip interrupts again to signal an error condition. Sometimes, the
driver will remain in this desynchronized state, resulting in spotty
performance until the interface is reset.

Fortunately, it's fairly simple to detect this condition: if we call
the rxeof routine but the number of received packets doesn't increase,
we suspect that there could be a problem. In this case, we call a new
routine called dc_rx_resync(), which scans ahead in the RX ring to see
if there's a frame waiting for us somewhere beyond that the driver thinks
is the current producer index. If it finds one, it bumps up the index
and calls the rxeof handler again to snarf up the packet and bring the
driver back in sync with the chip. (It may actually do this several times
in the event that there's more than one "hole" in the ring.)

So far the only card supported by if_dc which has exhibited this problem
is a LinkSys LNE100TX v2.0 (82c115 PNIC II), and it only seems to happen
on one particular system, however the fix is general enough and has low
enough overhead that we may as well apply it for all supported chipsets.
I also implemented the same fix for the 3Com xl driver, which is apparently
vulnerable to the same problem.

Problem originally noted and patch tested by: Matt Dillon
2000-01-03 15:28:47 +00:00
..
alpha untangle some includes and clean up for compilation cleanliness. 2000-01-03 09:36:55 +00:00
amd64 Move the "sti" instruction to right before the "hlt" to close a tiny 2000-01-02 15:18:12 +00:00
boot Fixed to get the BIOS geometry. 2000-01-03 15:28:05 +00:00
cam Widen width of tag && initiator ids to u_int 2000-01-03 08:54:51 +00:00
coda Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL" 1999-12-29 05:07:58 +00:00
compat Introduce NDFREE (and remove VOP_ABORTOP) 1999-12-15 23:02:35 +00:00
compile Stop cvs up -P from removing empty compile directories. 1994-08-25 16:20:16 +00:00
conf Synced with sys/i386/conf/Makefile.i386 rev 1.170. 2000-01-03 05:34:48 +00:00
contrib Garbage collect oltr_pci_shutdown 1999-12-21 08:21:36 +00:00
crypto Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL" 1999-12-29 05:07:58 +00:00
ddb
dev It appears that under certain circumstances that I still can't quite pin 2000-01-03 15:28:47 +00:00
fs Return ENXIO if there is no device. 2000-01-02 15:16:17 +00:00
geom Remove unused variable 1999-12-21 08:20:36 +00:00
gnu Don't allow mounting (or mounting R/W) of filesystems with unsupported 2000-01-02 17:40:02 +00:00
i4b update to isdn4bsd beta release 0.90 1999-12-14 20:54:38 +00:00
i386 Move the "sti" instruction to right before the "hlt" to close a tiny 2000-01-02 15:18:12 +00:00
isa Recognize the CSC0101 ID for the Thinkpad series. 1999-12-30 20:07:20 +00:00
isofs/cd9660 Return ENXIO if there is no device. 2000-01-02 15:16:17 +00:00
kern truss /usr/bin/su 2000-01-03 14:26:47 +00:00
libkern Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL" 1999-12-29 05:07:58 +00:00
miscfs Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL" 1999-12-29 05:07:58 +00:00
modules Remove -g compiler flag. 2000-01-03 12:01:30 +00:00
msdosfs Fix the mess with signed/unsigned longs and ints (inspired by bde). 2000-01-02 03:30:42 +00:00
net Prevent kernel panic at ifconfig up after Note PC resume. 1999-12-30 18:29:55 +00:00
netatalk Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL" 1999-12-29 04:46:21 +00:00
netatm
netgraph Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL" 1999-12-29 04:46:21 +00:00
netinet Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL" 1999-12-29 04:46:21 +00:00
netinet6 Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL" 1999-12-29 04:46:21 +00:00
netipx Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL" 1999-12-29 04:46:21 +00:00
netkey Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL" 1999-12-29 04:46:21 +00:00
netnatm Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL" 1999-12-29 04:46:21 +00:00
netncp Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL" 1999-12-29 04:46:21 +00:00
netns Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL" 1999-12-29 04:46:21 +00:00
nfs Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL" 1999-12-29 05:07:58 +00:00
nfsclient Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL" 1999-12-29 05:07:58 +00:00
nfsserver Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL" 1999-12-29 05:07:58 +00:00
ntfs Second pass commit to introduce new ACL and Extended Attribute system 1999-12-19 06:08:07 +00:00
nwfs Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL" 1999-12-29 05:07:58 +00:00
pc98 - Add commented out USB driver entries. 2000-01-03 07:12:56 +00:00
pccard Fill in the blanks for some of the Texas Instruments cardbus controllers. 1999-12-31 07:22:24 +00:00
pci It appears that under certain circumstances that I still can't quite pin 2000-01-03 15:28:47 +00:00
posix4 Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL" 1999-12-29 05:07:58 +00:00
powerpc untangle some includes and clean up for compilation cleanliness. 2000-01-03 09:36:55 +00:00
rpc
svr4 Introduce NDFREE (and remove VOP_ABORTOP) 1999-12-15 23:02:35 +00:00
sys Update FreeBSD(98) copyright. 2000-01-03 07:17:01 +00:00
tools
ufs Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL" 1999-12-29 05:07:58 +00:00
vm Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL" 1999-12-29 05:07:58 +00:00
Makefile ${MACHINE} -> ${MACHINE_ARCH} 1999-11-14 13:54:44 +00:00