summaryrefslogtreecommitdiffstats
path: root/sys/pci/if_vrreg.h
diff options
context:
space:
mode:
authorsilby <silby@FreeBSD.org>2003-01-31 07:37:06 +0000
committersilby <silby@FreeBSD.org>2003-01-31 07:37:06 +0000
commit208fd6117875dd3e9fd3a38d22cf826aa55f0388 (patch)
tree22389d3c3d106f820d9fe088adc19aafa283dcb7 /sys/pci/if_vrreg.h
parent7e4761fc23646b73a765d4e0300fa365f3d8c668 (diff)
downloadFreeBSD-src-208fd6117875dd3e9fd3a38d22cf826aa55f0388.zip
FreeBSD-src-208fd6117875dd3e9fd3a38d22cf826aa55f0388.tar.gz
Fixes from Thomas Nystrom to fix hanging problems experienced by vr cards
under load. This patch has been tested by Thomas and other for more than a month now, and all (known) hangs seem to be solved. Thomas's explanation of the patch: * Fix the problem with the printing of the RX-error. * Code from if_fet do better deal with the RX-recovery including a timeout of the RX-turnoff. * The call to vr_rxeof before vr_rxeoc have been moved to a point where the RX-part of the chip is turned off. Otherwise there is a window where new data could have been written to the buffer chain before the RX-part is turned off. If this happens the chip will see a busy rx-buffer. I have no evidence that this have occured but god knows what the chip will do in this case! * I have added a timeout of the TX-turnoff. I have checked and in my 900 MHz system the flags for turnoff (both RX & TX) is seen at the first check in the loop. * I could see that I got the VR_ISR_DROPPED interrupt sometimes and started to thinking about this. I then realized that no recovery is needed for this case and therefore I only count it as an rxerror (which was not done before). * Finally I have changed the FIFO RX threshhold to 128 bytes. When I did this the VR_ISR_DROPPED interrupt went away. Theory: The chip will receive a complete frame before it tries to write it out to memory then the RX threshold is set to store'n'forward. IF the frame is large AND the next rx frame also is large AND the bus is busy transfering a TX frame to the TX fifo THEN the second received frame wont fit in the FIFO and is then dropped. By having the RX threshold set to 128 the RX fifo is emptied faster. MFC after: 5 days
Diffstat (limited to 'sys/pci/if_vrreg.h')
-rw-r--r--sys/pci/if_vrreg.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/pci/if_vrreg.h b/sys/pci/if_vrreg.h
index f747881..b7903c1 100644
--- a/sys/pci/if_vrreg.h
+++ b/sys/pci/if_vrreg.h
@@ -464,12 +464,15 @@ struct vr_softc {
u_int8_t vr_unit; /* interface number */
u_int8_t vr_type;
u_int8_t vr_revid; /* Rhine chip revision */
+ u_int8_t vr_flags; /* See VR_F_* below */
struct vr_list_data *vr_ldata;
struct vr_chain_data vr_cdata;
struct callout_handle vr_stat_ch;
struct mtx vr_mtx;
};
+#define VR_F_RESTART 0x01 /* Restart unit on next tick */
+
#define VR_LOCK(_sc) mtx_lock(&(_sc)->vr_mtx)
#define VR_UNLOCK(_sc) mtx_unlock(&(_sc)->vr_mtx)
OpenPOWER on IntegriCloud