Commit Graph

90 Commits

Author SHA1 Message Date
thorpej 505f0442e5 Eliminate use of M_HASFCS. 2005-01-30 17:33:48 +00:00
briggs 87dda823cf Minor tweak to add newline to an aprint_error(). 2004-11-30 03:08:27 +00:00
briggs 83931ac682 The 8254x apparently doesn't respond well to I/O accesses at 0. Do not
attempt to map the I/O BAR if it is 0.  This will have the side-effect
of causing the wm_reset() routine to fall back to memory BAR accesses
for those chips on which it would attempt I/O BAR accesses for the reset.

Also update the comments about why we attempt the I/O BAR accesses for
the reset in favor of the memory BAR accesses.
2004-11-24 15:14:13 +00:00
thorpej 38f94c5d99 Don't bother caching the checksum context. Other drivers for this chip
don't, and it seems as though doing it may cause some problems.
2004-11-24 00:02:50 +00:00
thorpej 978214ebe8 If we have to do an m_pullup() when setting up offload parameters,
make sure that the pullup was done into trailing space at the end of
the existing first-mbuf-in-chain.  If not, log an error and drop the
packet, because the mbuf chain no longer corresponds to the DMA map,
and we are already committed to transmitting the packet.
2004-11-23 23:05:33 +00:00
thorpej 0d16742b72 Also toggle the second port's Ethernet address lsb on the WM_T_82546_3. 2004-11-23 21:36:38 +00:00
thorpej 0d68f66da9 Use log() instead of printf(). 2004-11-22 19:28:37 +00:00
thorpej e9818f5b5e When adding/deleting multicast addresses, only whack the address
filter if the interface is marked RUNNING.

Fixes kern/27678.
2004-10-30 18:08:34 +00:00
thorpej 57024fd924 Define a WM_MAXTXDMA constant to represent the largest Tx DMA any given
packet will require.
2004-10-06 05:29:51 +00:00
thorpej 7ee6d38e39 Sync the Tx DMA map after offload stuff has been dealt with, since the
offload set-up digs into the packet.
2004-10-06 05:23:05 +00:00
thorpej eeee37654e Restructure the loop in wm_start() that passes over the DMA map segments
slightly to make it easier to drop in errata work-arounds that require
adding extra descriptors onto the end of the packet.
2004-10-06 00:04:01 +00:00
thorpej 09421fe870 Largest Tx descriptor buffer size is actually 4K. 2004-10-05 21:29:56 +00:00
thorpej d1c33ede84 Work around another problem (that causes horrible performance) on the 82547:
- Change the Tx:Rx on-chip RAM allocation ratio based on MTU:
  => 82547: > 8192 18K:22K, else 10K:30K
  => others: > 8192 24K:40K, else 16K:48K
  Values derived from Linux driver.
- On the 82547, keep track of how much of the Tx FIFO has been used.
  When in half-duplex mode, don't let packets wrap around the FIFO ring
  buffer, because that causes the chip to croak.  Detect this, stall the
  Tx queue, use a timer to wait for the packets to drain from the Tx FIFO,
  reset the internal FIFO pointers, and restart the Tx queue.  Basic
  algorithm (and some magic numbers) derived from FreeBSD and Linux drivers.
2004-10-05 20:14:52 +00:00
simonb 35817977ee Remove an unused event counter. 2004-09-14 08:40:26 +00:00
thorpej 383b485d9a Make the product table static. 2004-08-21 22:23:13 +00:00
thorpej 867e9734f2 - Dump the mbuf chain if we encounter a "too many DMA segments" error
on transmit.
- On 82544 and up, allocate 4096 Tx descriptors rather than just 256.
  82543 and down must still use 256, due to errata.
- Allow up to 256 DMA segments per packet.  I have observed some truly
  pathological mbuf chains under certain (admittedly uncommon) workloads
  when jumbo frames are in use.
2004-08-05 19:11:11 +00:00
tron 0237ca34a7 Reduce transmit queue len to 16 for the Intel i82547 to avoid FIFO
overruns. This fixes the horrible send performance reported in
PR kern/23782. Reviewed by Frank van der Linden and Jason R. Thorpe.
2004-07-15 15:21:57 +00:00
tron 742e1a4221 The Intel i82547EI gigabit ethernet controller isn't really a PCI
device. So instead trying to find and print out the PCI bus properties
mark it as a CSA device.
2004-07-13 07:29:37 +00:00
tron 7df6314408 Make this build if WM_DEBUG is defined. 2004-07-12 14:04:36 +00:00
thorpej 47e9c860d9 Add flow control support, based on work by HITOSHI Osada. 2004-05-16 02:34:47 +00:00
ragge f62c3ab365 Remove the "panic("wm_init: MCLBYTES > 2048 not supported.");" stuff,
the driver works very well with larger MCLBYTES.
2004-05-06 10:06:50 +00:00
thorpej c235249183 Add support for 64-bit PCI DMA addressing. 2004-04-09 17:51:18 +00:00
thorpej 816a869868 s/WTC_DTYP_D/WTX_DTYP_D/ 2004-02-19 05:19:52 +00:00
thorpej 881b8b9966 Fix typo in debug message. From Jeffrey Hsu. 2004-02-19 05:18:47 +00:00
thorpej fd4acf29d4 Add missing txseg20 counter name. Pointed out by Jeffrey Hsu. 2004-02-19 02:13:23 +00:00
tsutsui 6353b12d1a Fix hardware cksum problem on big endian machines.
Tested on macppc by HATANO Hiromichi.

Note I guess this bug could be fixed only adding one htole32(),
but I'd rather clean up endianness handling:
- Use htole32() only to accesses against DMA descriptors.
- Don't use uint32_t union member  with htole32()/le32toh()
  to access uint8_t/uint16_t descriptors.
- Add le32toh() in some DPRINTF.
  (XXX: strictly speaking, bus_dmamap_sync() is needed for these DPRINTF)
2004-01-14 14:29:48 +00:00
thorpej c0ddd8220b Bump the Tx DMA segment count to 40. Apparently, it's common to have
DMA segment counts in this ballpark when using jumbo frames (so says
the "ti" driver).
2003-12-04 06:57:37 +00:00
thorpej f6c3c3450e Add a missing i82541 ID to the table. 2003-11-22 08:32:12 +00:00
thorpej 32ddb3f486 Fix brain'o in PCIX speed detection. kern/23375 (John R. Shannon). 2003-11-07 06:03:52 +00:00
thorpej 73fea8467b Enable i82541 and i82547 chips - it works well enough to get broader
testing.  Update the TODO list.
2003-11-04 19:09:39 +00:00
ichiro 8b115395c7 Fix uninitialized variable warnings 2003-11-03 03:05:25 +00:00
christos 125ccd91b1 Fix uninitialized variable warnings 2003-10-25 18:29:12 +00:00
ragge c4690aa593 Set snd queue size to max(WM_IFQUEUELEN, IFQ_MAXLEN), instead of hard to
WM_IFQUEUELEN.
2003-10-23 12:53:02 +00:00
thorpej 0f781c4abb Add support for the SPI EEPROM found on the newer i82541 and i82547
chips.  Add the i82541 and i82547 product IDs to the table, #if 0'd
out, for now (there are still more changes to come for these new chips
to work properly).
2003-10-22 15:50:39 +00:00
thorpej 3e560e2b48 Add a TODO list item. 2003-10-21 16:52:08 +00:00
thorpej c50f2ac573 - Move the i82540EM (LOM) along with the other i82540 product IDs.
- Match the i82545GM (1000BASE-T and 1000BASE-X) and i82546GB
  (1000BASE-T and 1000BASE-X) product IDs.
2003-10-21 16:51:17 +00:00
thorpej a866babe44 If we're on PCI-X, look up the PCI-X capability. Verify that the
max memory read byte count in the command register is <= the max designed
memory read byte count in the status register.  If not, reset it to the
status register's value.  This is necessary because some BIOSes configure
the wrong value, and the wrong value confused some versions of the PCI-X
capable chips.
2003-10-21 16:41:51 +00:00
thorpej abc7f80ca5 - Map I/O space on chips that support it. While it is not used for
normal operation, it is required to implement a bug work-around on
  some chips.
- When issuing a reset on the i82544, i82540, i82545, i82546,
  and i82541, use I/O space, if available, to work around a problem
  with the memory write cycle (problem only occurs when issuing
  a reset).
2003-10-21 05:45:11 +00:00
thorpej 2cadb9ce85 Record characteristics of the bus connection at attach time. 2003-10-21 04:35:01 +00:00
thorpej e2d086d69d - Do better error checking on EEPROM access.
- Let the EEPROM wire-protocol handler perform the loop.
2003-10-20 22:52:19 +00:00
thorpej 12c5273afa Move all the code that handles the MicroWire EEPROM protocol into
a separate function.
2003-10-20 16:28:23 +00:00
thorpej fedb07bc8d Fix a typo in the "failed to acquire eeprom" case. 2003-10-20 15:34:25 +00:00
thorpej 0ebc93fe43 Move the code that reads a series of bits from the EEPROM into a
separate function.
2003-10-20 15:33:48 +00:00
thorpej 17aaa92402 Make all of the functions in this file static. 2003-10-20 06:00:26 +00:00
thorpej 10926a6056 Factor out the code that sends bits to the EEPROM into a separate function. 2003-10-20 05:56:17 +00:00
thorpej f5fc41219d Move the code that handle the EEPROM handshake into separate functions. 2003-10-20 05:40:03 +00:00
thorpej b0bced8029 Store the number of EEPROM address bits in the softc. 2003-10-17 21:12:48 +00:00
thorpej 2d858d3912 Add internal representation for i82545 rev 3, i82546 rev3, i82541,
i82541 rev 2, i82547, and i82547 rev 2.
2003-10-17 20:57:32 +00:00
thorpej e3ca7c2c73 Make the "align tweak" factor per-interface (since the MTU is per-interface). 2003-10-17 20:41:21 +00:00
tls ab54d7e94f Add support for jumbo (9K) frames. Add support for larger receive
descriptor sizes if larger mbuf clusters are in use -- currently
commented out because, for some reason, transmit doesn't work at
all with large mbuf cluster sizes.

Note that using actual 9K frames is a _lot_ less efficient than
using frames that are a little smaller than 8K so that they fit
in one or two pages (instead of two or three) and avoid the extra
chained descriptor with only 1K of data in it, too.  TCP will
segment things just fine for an 8K total packet size, just as it
does for 1500-byte packets.

On my system, using "mtu 8000" with ifconfig, I get an almost 50%
performance boost for TCP (930Mbit/sec instead of 660Mbit/sec) over
1500-byte frames.  "mtu 9000" yields only 770Mbit/sec.
2003-09-10 04:02:17 +00:00