diff options
author | pdeuskar <pdeuskar@FreeBSD.org> | 2002-11-08 18:14:17 +0000 |
---|---|---|
committer | pdeuskar <pdeuskar@FreeBSD.org> | 2002-11-08 18:14:17 +0000 |
commit | 9918575c8a3c567575e9ef1744c2464690eb828e (patch) | |
tree | 5cda9c577e262fc3a48696655bdee05cc2c2d6a9 /sys/dev/em/if_em.h | |
parent | f3748b0c0b9b7ae4a57068095ab2eb98aaea333d (diff) | |
download | FreeBSD-src-9918575c8a3c567575e9ef1744c2464690eb828e.zip FreeBSD-src-9918575c8a3c567575e9ef1744c2464690eb828e.tar.gz |
- Set RS (Report Status) bit on all descriptors of a packet instead of just the last one.
- Set RDTR to zero by default instead of 28.
- Fixed a problem with TX hangs with jumbo frames when number of fragments in the mbuf chain
is large.
- Added support for 82540EP based cards.
MFC after: 3 days
Diffstat (limited to 'sys/dev/em/if_em.h')
-rw-r--r-- | sys/dev/em/if_em.h | 141 |
1 files changed, 122 insertions, 19 deletions
diff --git a/sys/dev/em/if_em.h b/sys/dev/em/if_em.h index f292966..d280837 100644 --- a/sys/dev/em/if_em.h +++ b/sys/dev/em/if_em.h @@ -75,23 +75,129 @@ POSSIBILITY OF SUCH DAMAGE. #include <dev/em/if_em_hw.h> -/* Tunables */ -#define MAX_TXD 256 -#define MAX_RXD 256 -#define TX_CLEANUP_THRESHOLD MAX_TXD / 8 -#define TIDV 128 -#define RIDV 28 -#define DO_AUTO_NEG 1 -#define WAIT_FOR_AUTO_NEG_DEFAULT 1 -#define AUTONEG_ADV_DEFAULT (ADVERTISE_10_HALF | ADVERTISE_10_FULL | \ - ADVERTISE_100_HALF | ADVERTISE_100_FULL | \ - ADVERTISE_1000_FULL) +/* Tunables -- Begin */ + +/* + * FlowControl + * Valid Range: 0-3 (0=none, 1=Rx only, 2=Tx only, 3=Rx&Tx) + * Default: Read flow control settings from the EEPROM + * This parameter controls the automatic generation(Tx) and response(Rx) to + * Ethernet PAUSE frames. + */ + + +/* + * TxDescriptors + * Valid Range: 80-256 for 82542 and 82543-based adapters + * 80-4096 for 82540, 82544, 82545, and 82546-based adapters + * Default Value: 256 + * This value is the number of transmit descriptors allocated by the driver. + * Increasing this value allows the driver to queue more transmits. Each + * descriptor is 16 bytes. + */ +#define EM_MAX_TXD 256 + +/* + * RxDescriptors + * Valid Range: 80-256 for 82542 and 82543-based adapters + * 80-4096 for 82540, 82544, 82545, and 82546-based adapters + * Default Value: 256 + * This value is the number of receive descriptors allocated by the driver. + * Increasing this value allows the driver to buffer more incoming packets. + * Each descriptor is 16 bytes. A receive buffer is also allocated for each + * descriptor. The maximum MTU size is 16110. + * + */ +#define EM_MAX_RXD 256 + +/* + * TxIntDelay + * Valid Range: 0-65535 (0=off) + * Default Value: 64 + * This value delays the generation of transmit interrupts in units of + * 1.024 microseconds. Transmit interrupt reduction can improve CPU + * efficiency if properly tuned for specific network traffic. If the + * system is reporting dropped transmits, this value may be set too high + * causing the driver to run out of available transmit descriptors. + */ +#define EM_TIDV 128 + +/* + * RxIntDelay + * Valid Range: 0-65535 (0=off) + * Default Value: 0 + * This value delays the generation of receive interrupts in units of 1.024 + * microseconds. Receive interrupt reduction can improve CPU efficiency if + * properly tuned for specific network traffic. Increasing this value adds + * extra latency to frame reception and can end up decreasing the throughput + * of TCP traffic. If the system is reporting dropped receives, this value + * may be set too high, causing the driver to run out of available receive + * descriptors. + * + * CAUTION: When setting RxIntDelay to a value other than 0, adapters + * may hang (stop transmitting) under certain network conditions. + * If this occurs a WATCHDOG message is logged in the system event log. + * In addition, the controller is automatically reset, restoring the + * network connection. To eliminate the potential for the hang + * ensure that RxIntDelay is set to 0. + */ +#define EM_RDTR 0 + + +/* + * This parameter controls the maximum no of times the driver will loop + * in the isr. + * Minimum Value = 1 + */ +#define EM_MAX_INTR 3 + + +/* + * This parameter determines when the hardware will report that it is + * done with the packet. + * 0 - "Done" is reported when the packet has been sent on the wire + * 1 - "Done" is reported when the packet has been DMA'ed and is on chip. + * 2 - Determine the best method. + */ #define EM_REPORT_TX_EARLY 2 + +/* + * Inform the stack about transmit checksum offload capabilities. + */ #define EM_CHECKSUM_FEATURES (CSUM_TCP | CSUM_UDP) -#define EM_MAX_INTR 3 + +/* + * This parameter controls the duration of transmit watchdog timer. + */ #define EM_TX_TIMEOUT 5 /* set to 5 seconds */ +/* + * This parameter controls when the driver calls the routine to reclaim + * transmit descriptors. + */ +#define EM_TX_CLEANUP_THRESHOLD EM_MAX_TXD / 8 + +/* + * This parameter controls whether or not autonegotation is enabled. + * 0 - Disable autonegotiation + * 1 - Enable autonegotiation + */ +#define DO_AUTO_NEG 1 + +/* + * This parameter control whether or not the driver will wait for + * autonegotiation to complete. + * 1 - Wait for autonegotiation to complete + * 0 - Don't wait for autonegotiation to complete + */ +#define WAIT_FOR_AUTO_NEG_DEFAULT 1 + + +/* Tunables -- End */ +#define AUTONEG_ADV_DEFAULT (ADVERTISE_10_HALF | ADVERTISE_10_FULL | \ + ADVERTISE_100_HALF | ADVERTISE_100_FULL | \ + ADVERTISE_1000_FULL) #define EM_VENDOR_ID 0x8086 #define EM_MMBA 0x0010 /* Mem base address */ #define EM_ROUNDUP(size, unit) (((size) + (unit) - 1) & ~((unit) - 1)) @@ -138,8 +244,7 @@ POSSIBILITY OF SUCH DAMAGE. * should load. * * ******************************************************************************/ -typedef struct _em_vendor_info_t -{ +typedef struct _em_vendor_info_t { unsigned int vendor_id; unsigned int device_id; unsigned int subvendor_id; @@ -151,10 +256,9 @@ typedef struct _em_vendor_info_t struct em_tx_buffer { STAILQ_ENTRY(em_tx_buffer) em_tx_entry; struct mbuf *m_head; - u_int32_t num_tx_desc_used; + struct em_tx_desc *used_tx_desc; }; - /* ****************************************************************************** * This structure stores information about the 2k aligned receive buffer * into which the E1000 DMA's frames. @@ -204,7 +308,6 @@ struct adapter { struct em_tx_desc *first_tx_desc; struct em_tx_desc *last_tx_desc; struct em_tx_desc *next_avail_tx_desc; - struct em_tx_desc *oldest_used_tx_desc; struct em_tx_desc *tx_desc_base; volatile u_int16_t num_tx_desc_avail; u_int16_t num_tx_desc; @@ -232,8 +335,8 @@ struct adapter { unsigned long dropped_pkts; unsigned long mbuf_alloc_failed; unsigned long mbuf_cluster_failed; - unsigned long xmit_pullup; - unsigned long no_tx_desc_avail; + unsigned long no_tx_desc_avail1; + unsigned long no_tx_desc_avail2; unsigned long no_tx_buffer_avail1; unsigned long no_tx_buffer_avail2; #ifdef DBG_STATS |