summaryrefslogtreecommitdiffstats
path: root/sys/pci/if_stereg.h
diff options
context:
space:
mode:
authorambrisko <ambrisko@FreeBSD.org>2002-08-07 22:31:27 +0000
committerambrisko <ambrisko@FreeBSD.org>2002-08-07 22:31:27 +0000
commit50ff7d43747a1dd2374b40b3ceb1fa3b7d3299cd (patch)
tree501f988d59778f5ebf95773846f122b048aed007 /sys/pci/if_stereg.h
parent0516dc643cb4cc01ddf0939879e53f7aca690bcf (diff)
downloadFreeBSD-src-50ff7d43747a1dd2374b40b3ceb1fa3b7d3299cd.zip
FreeBSD-src-50ff7d43747a1dd2374b40b3ceb1fa3b7d3299cd.tar.gz
Fixes for the D-Link DFE-580 card.
This is pretty much fixes any issue I can find: - Watchdog timeouts were due to starting the TX DMA engine before we had a packet ready for it. So the first packet sent never got out only if we sent more then one packet at a time did the others make it out and not blow up. Of course reseting the chip then caused us not to transmit the first packet again ie. catch-22. This required logic changes. - Combine interrupts on TX packets being queued up. - Don't keep running around the RX ring since we might get out of sync so only go around once per receive - Let the RX engine recover via the poll interface which is similar to the TX interface. This way the chip wakes up with no effort when we read enough packets. - Do better hand-shaking on RX & TX packets so they don't start of to soon. - Force a duplex setting when the link comes up after an ste_init or it will default to half-duplex and be really slow. This only happens on subsequent ste_init. The first one worked. - Don't call stat_update for every overflow. We only monitor the collisions so the tick interval is good enough for that. Just read in the collision stats to minimize bus reads. - Don't read the miibus every tick since it uses delays and delays are not good for performance. - Tie link events directly to the miibus code so the port gets set correctly if someone changes the port settings. - Reduce the extreme number of {R,T}FD's. They would consume 130K of kernel memory for each NIC. - Set the TX_THRESH to wait for the DMA engine to complete before running the TX FIFO. This hurts peak TX performance but under bi-directional load the DMA engine can't keep up with the FIFO. Testing shows that we end up in the case anyways (a la dc(4) issues but worse since the RX engine hogs everything). - When stopping the card do a reset since the reset verifies the card has stopped. Otherwise on heavy RX load the RX DMA engine is still stuffing packets into memory. If that happens after we free the DMA area memory bits get scribled in memory and bad things happen. This card still has seemingly unfixable issues under heavy RX load in which the card takes over the PCI bus. Sponsored by: Vernier Networks MFC after: 1 week
Diffstat (limited to 'sys/pci/if_stereg.h')
-rw-r--r--sys/pci/if_stereg.h22
1 files changed, 15 insertions, 7 deletions
diff --git a/sys/pci/if_stereg.h b/sys/pci/if_stereg.h
index b369d6d..c55af97 100644
--- a/sys/pci/if_stereg.h
+++ b/sys/pci/if_stereg.h
@@ -93,6 +93,10 @@
#define STE_MAR3 0x66
#define STE_STATS 0x68
+#define STE_LATE_COLLS 0x75
+#define STE_MULTI_COLLS 0x76
+#define STE_SINGLE_COLLS 0x77
+
#define STE_DMACTL_RXDMA_STOPPED 0x00000001
#define STE_DMACTL_TXDMA_CMPREQ 0x00000002
#define STE_DMACTL_TXDMA_STOPPED 0x00000004
@@ -224,13 +228,13 @@
* The number of bytes that must in present in the TX FIFO before
* transmission begins. Value should be in increments of 4 bytes.
*/
-#define STE_TXSTART_THRESH 0x1FFF
+#define STE_TXSTART_THRESH 0x1FFC
/*
* Number of bytes that must be present in the RX FIFO before
* an RX EARLY interrupt is generated.
*/
-#define STE_RXEARLY_THRESH 0x1FFF
+#define STE_RXEARLY_THRESH 0x1FFC
#define STE_WAKEEVENT_WAKEPKT_ENB 0x01
#define STE_WAKEEVENT_MAGICPKT_ENB 0x02
@@ -272,8 +276,9 @@
#define STE_IMR_RX_DMADONE 0x0400
#define STE_INTRS \
- (STE_IMR_RX_DMADONE|STE_IMR_TX_DMADONE|STE_IMR_STATS_OFLOW| \
- STE_IMR_TX_DONE|STE_IMR_HOSTERR|STE_IMR_RX_EARLY)
+ (STE_IMR_RX_DMADONE|STE_IMR_TX_DMADONE| \
+ STE_IMR_TX_DONE|STE_IMR_HOSTERR| \
+ STE_IMR_LINKEVENT)
#define STE_ISR_INTLATCH 0x0001
#define STE_ISR_HOSTERR 0x0002
@@ -406,7 +411,7 @@ struct ste_frag {
#define STE_FRAG_LAST 0x80000000
#define STE_FRAG_LEN 0x00001FFF
-#define STE_MAXFRAGS 63
+#define STE_MAXFRAGS 8
struct ste_desc {
u_int32_t ste_next;
@@ -460,9 +465,10 @@ struct ste_desc_onefrag {
#define STE_MIN_FRAMELEN 60
#define STE_PACKET_SIZE 1536
#define ETHER_ALIGN 2
-#define STE_RX_LIST_CNT 128
-#define STE_TX_LIST_CNT 256
+#define STE_RX_LIST_CNT 64
+#define STE_TX_LIST_CNT 64
#define STE_INC(x, y) (x) = (x + 1) % y
+#define STE_NEXT(x, y) (x + 1) % y
struct ste_type {
u_int16_t ste_vid;
@@ -509,10 +515,12 @@ struct ste_softc {
void *ste_intrhand;
struct ste_type *ste_info;
device_t ste_miibus;
+ device_t ste_dev;
int ste_unit;
int ste_tx_thresh;
u_int8_t ste_link;
int ste_if_flags;
+ int ste_tx_prev_idx;
struct ste_list_data *ste_ldata;
struct ste_chain_data ste_cdata;
struct callout_handle ste_stat_ch;
OpenPOWER on IntegriCloud