freebsd-dev/sys/pci
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
..
adv_pci.c $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
adw_pci.c $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
ahc_pci.c When booting verbose, indicate if we are using manual termination 1999-12-12 04:54:14 +00:00
alpm.c Remove the 'ivars' arguement to device_add_child() and 1999-12-03 08:41:24 +00:00
amd.c Properly set the alignment argument to bus_dma_tag_create(). If we 1999-08-16 01:52:21 +00:00
amd.h First cut at a driver for the amd53c974 PCI SCSI host adapter. This 1999-05-22 21:50:40 +00:00
cy_pci.c $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
cy_pcireg.h $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
dc21040reg.h s/Id/FreeBSD/ 1999-08-09 12:52:49 +00:00
ida_pci.c Removal of sys/device.h 1999-10-05 21:19:41 +00:00
ide_pci.c Remove some horrible #if 0'd code that has no hope of working now. It 1999-12-12 14:47:23 +00:00
ide_pcireg.h $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
if_ar_p.c Add support for the PCI version of the Digi SYNC/570i cards. 1999-10-17 09:40:04 +00:00
if_dc.c It appears that under certain circumstances that I still can't quite pin 2000-01-03 15:28:47 +00:00
if_dcreg.h Fix some problems reported by Mike Pritchard: 1999-12-13 21:45:13 +00:00
if_de.c Remove NBPF conditionality of bpf calls in most of our network drivers. 1999-09-25 12:06:01 +00:00
if_devar.h A little more tidying up. 1999-08-09 14:43:39 +00:00
if_en_pci.c Clean up after removing sys/eventhandler.h from sys/systm.h at the last 1999-08-21 22:10:49 +00:00
if_fpa.c $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
if_fxp.c Make the fxp driver work on alpha, rather than panic the machine on boot 1999-09-30 19:03:12 +00:00
if_fxpreg.h Make the fxp driver work on alpha, rather than panic the machine on boot 1999-09-30 19:03:12 +00:00
if_fxpvar.h Make the fxp driver work on alpha, rather than panic the machine on boot 1999-09-30 19:03:12 +00:00
if_lnc_p.c $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
if_mn.c Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL" 1999-12-29 05:07:58 +00:00
if_rl.c Fix a small typo in the comments. 1999-12-28 06:04:29 +00:00
if_rlreg.h Make some tweaks to the RealTek driver: 1999-10-21 19:42:03 +00:00
if_sf.c Modify the Adaptec "starfire" driver to reset the PHY on the MII bus 1999-12-05 20:02:45 +00:00
if_sfreg.h Modify the Adaptec "starfire" driver to reset the PHY on the MII bus 1999-12-05 20:02:45 +00:00
if_sis.c Change contigmalloc() lower memory bound from 1MB to 0 to improve 1999-09-25 17:29:02 +00:00
if_sisreg.h This commit adds driver support for the Silicon Integrated Systems 1999-09-05 21:01:03 +00:00
if_sk.c Call sk_start() at the end of sk_intr() if there's packets in the 1999-09-25 04:50:27 +00:00
if_skreg.h Fix the mechanism used to choose the unit numbers for the IP interfaces 1999-09-18 04:01:31 +00:00
if_sr_p.c $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
if_ste.c Spruce up the Sundance ST201 driver: 1999-12-07 20:14:42 +00:00
if_stereg.h Spruce up the Sundance ST201 driver: 1999-12-07 20:14:42 +00:00
if_ti.c As suggested by phk, unconditionalize BPF support in these drivers. Since 1999-09-23 03:32:57 +00:00
if_tireg.h Update the Tigon driver firmware images to the latest release from 1999-09-22 06:43:16 +00:00
if_tl.c Change contigmalloc() lower memory bound from 1MB to 0 to improve 1999-09-25 17:29:02 +00:00
if_tlreg.h Make some small performance tweaks to the tl driver. This should hopefully 1999-09-19 22:39:24 +00:00
if_tx.c Change incorrect NULLs to 0s 1999-12-21 11:14:12 +00:00
if_txvar.h Added code to enable BusMaster operations. 1999-10-29 09:56:52 +00:00
if_vr.c Change contigmalloc() lower memory bound from 1MB to 0 to improve 1999-09-25 17:29:02 +00:00
if_vrreg.h Convert the VIA Rhine driver to miibus. 1999-09-19 22:03:31 +00:00
if_vx_pci.c Clean up after removing sys/eventhandler.h from sys/systm.h at the last 1999-08-21 22:10:49 +00:00
if_wb.c Change contigmalloc() lower memory bound from 1MB to 0 to improve 1999-09-25 17:29:02 +00:00
if_wbreg.h Convert the Adaptec and Winbond drivers to miibus. 1999-08-30 23:08:32 +00:00
if_xl.c It appears that under certain circumstances that I still can't quite pin 2000-01-03 15:28:47 +00:00
if_xlreg.h Update the xl driver to recognize yet another 3c905B/3c905C class NIC: 1999-12-16 18:33:57 +00:00
intpm.c Remove the 'ivars' arguement to device_add_child() and 1999-12-03 08:41:24 +00:00
intpmreg.h $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
isp_pci.c Add Dual LVD bus (1280) support 1999-12-16 05:42:02 +00:00
locate.pl MFS: Change path to perl. 1999-08-30 14:41:09 +00:00
meteor_reg.h Convert DEVFS hooks in (most) drivers to make_dev(). 1999-08-23 20:59:21 +00:00
meteor.c Remove five now unused fields from struct cdevsw. They should never 1999-09-25 18:24:47 +00:00
ncr.c Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL" 1999-12-29 05:07:58 +00:00
ncrreg.h $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
ohci_pci.c Remove the 'ivars' arguement to device_add_child() and 1999-12-03 08:41:24 +00:00
pccbb.c Initial import of cardbus bridge driver (cbb) from the latest 1999-11-18 07:14:54 +00:00
pccbbreg.h Initial import of cardbus bridge driver (cbb) from the latest 1999-11-18 07:14:54 +00:00
pccbbvar.h Initial import of cardbus bridge driver (cbb) from the latest 1999-11-18 07:14:54 +00:00
pci_compat.c * Implement bus_set/get/delete_resource for pci. 1999-10-14 21:38:33 +00:00
pci_if.m $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
pci.c Make the usb and ide/ata device identification a little saner. Rather than 1999-12-10 17:44:22 +00:00
pcic_p.c Fill in the blanks for some of the Texas Instruments cardbus controllers. 1999-12-31 07:22:24 +00:00
pcic_p.h Fill in the blanks for some of the Texas Instruments cardbus controllers. 1999-12-31 07:22:24 +00:00
pcireg.h Add the 16550 programming interface code for PCIS_SIMPLECOMM_UART. 1999-10-09 16:00:56 +00:00
pcisupport.c Update NeoMagic entries. 2000-01-03 10:04:01 +00:00
pcivar.h Make the usb and ide/ata device identification a little saner. Rather than 1999-12-10 17:44:22 +00:00
scsiiom.c Use [u]intptr_t instead of [unsigned] long to convert and/or represent 1998-08-10 17:21:49 +00:00
simos.c $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
simos.h $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
ti_fw2.h Update the Tigon driver firmware images to the latest release from 1999-09-22 06:43:16 +00:00
ti_fw.h Update the Tigon driver firmware images to the latest release from 1999-09-22 06:43:16 +00:00
uhci_pci.c Remove the 'ivars' arguement to device_add_child() and 1999-12-03 08:41:24 +00:00
xmaciireg.h $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
xrpu.c Remove five now unused fields from struct cdevsw. They should never 1999-09-25 18:24:47 +00:00