Commit Graph

128 Commits

Author SHA1 Message Date
John Baldwin
5c356a4834 Fix compile with BCE_DEBUG. The last one tripped up gcc 2.95 on 4.x even
with BCE_DEBUG turned off.
2006-12-06 22:53:22 +00:00
Scott Long
46222d084a Due to an incorrect macro, it appears that this driver has always been
accidentally truncating off the VLAN tag field in the TX descriptor.  Fix
this by splitting up the vlan_tag and flags fields into separate fields,
and handling them appropriately.

Sponsored by: Ironport
MFC After: 3 days
2006-11-16 06:28:54 +00:00
John Polstra
6e7b2160a4 In bce_start_locked, check the used_tx_bd count rather than the
descriptor's mbuf pointer to see if the transmit ring is full.  The
mbuf pointer is set only in the last descriptor of a
multi-descriptor packet.  By relying on the mbuf pointers of the
earlier descriptors, the driver would sometimes overwrite a
descriptor belonging to a packet that wasn't completed yet.  Also,
tx_chain_prod wasn't updated inside the loop, causing the wrong
descriptor to be checked after the first iteration.  The upshot of
all this was the loss of some transmitted packets at medium to high
packet rates.

In bce_tx_encap, remove a couple of old statements that shuffled
around the tx_mbuf_map pointers.  These now correspond 1-to-1 with
the transmit descriptors, and they are not supposed to be changed.

Correct a couple of inaccurate comments.

MFC after:	1 month
2006-11-16 04:04:07 +00:00
John Baldwin
280388afe5 Add MSI support to em(4), bce(4), and mpt(4). For now, we only support
devices that support a maximum of 1 message, and we use that 1 message
instead of the INTx rid 0 IRQ with the same interrupt handler, etc.
2006-11-15 20:04:57 +00:00
Scott Long
9df92bda76 Fix a typo in the device ID table that prevented 5708S chips from being
detected.

Submitted by: pyun
2006-10-31 03:28:25 +00:00
Scott Long
4eaefb8160 Refine the checksum hack a little. It appears that the chip can handle UDP
and TCP checksum offloading fine, it only has a problem with IP checksums on
IP fragments..  Barring a fix or workaround available from the hardware, the
real solution would be to have finer grained control in the stack over what
can and cannot be assisted in hardware.
2006-10-24 08:24:31 +00:00
Scott Long
49caa8a9f8 There seems to be a problem with txcsum and UDP. Turn it off until it is
understood better.  This fixes timeout problems with NFS.
2006-10-21 20:41:08 +00:00
Scott Long
61a1e7e66d Be more like the BGE driver. Ensure that at least 16 TX descriptors are
kept unused in the ring.  This check should probably be moved up to
bce_start_locked at some point, as it'll make the loop up there slightly
more efficient, and will eliminate a costly set of busdma operations when
the ring is full.  But this works for now.

This makes all of my UDP torture tests work.  I'll cautiously say that
it might even work for other users now.  Feedback is appreciated.
2006-10-21 07:54:39 +00:00
Scott Long
e06c706542 I can't find any reason why an 8 byte alignment should be enforced on rx
and tx buffers.  Fix it there, and also don't have it be overridden by the
parent tag.
2006-10-19 08:01:43 +00:00
Scott Long
ae4991a54c Remove some spurious debugging, and use more complete error handling for
tx load and fragmentation problems.
2006-10-19 06:58:01 +00:00
Scott Long
c5a01a410c Overhaul the transmit and dma paths:
- Use bus_dmamap_load_mbuf_sg() to eliminate the need for the callback and
all of the extra bookkeeping associated with it.
- Eliminate the bce_dmamap_arg structure and streamline the memory allocation
routines to not need it.  This does change some of the debugging messages.
- Refactor the loop that fills the buffer descriptor so that it can be done
with a single set of logic in a single loop instead of two sets of logic.
- Eliminate the need to cache and pass descriptor indexes between the start
loop and the encap function.
- Change the start loop to always check the ifnet sendq for more work.

This significantly helps the driver withstand large UDP workloads, though
it's still not perfect.  I suspect the remaining work lies with handling
the OACTIVE flag, and also in possibly streamlining the interrupt handler
some.  It is, however, nearly on par with the other popular gigabit drivers
in terms of stability now.
2006-10-15 23:42:56 +00:00
Scott Long
f77d2d79f1 Simplify the arguments to bce_tx_encap. 2006-10-14 05:30:12 +00:00
Scott Long
a1f63be099 More small whitespace cleanups 2006-10-14 04:28:23 +00:00
Scott Long
ec6887f825 Don't copy the bd_chain head pointers into temporary objects, they are
available globally.
2006-10-14 03:58:59 +00:00
Scott Long
2711d96ad4 Fix some whitespace 2006-10-13 05:18:03 +00:00
Doug Ambrisko
796ddce11d Add a new 'bce_mgmt_init_locked' function to enable the minimal parts
of the chip to let ASF/IPMI firmware to respond to IPMI after attaching
and when the chip is down.  David looked at it but could really say
what they right minimal config. stuff would be.  It's not documented.
I figured this out via trial and error.

Reviewed by:	davidch
2006-09-20 18:55:16 +00:00
Andre Oppermann
78ba57b9e1 Move ethernet VLAN tags from mtags to its own mbuf packet header field
m_pkthdr.ether_vlan.  The presence of the M_VLANTAG flag on the mbuf
signifies the presence and validity of its content.

Drivers that support hardware VLAN tag stripping fill in the received
VLAN tag (containing both vlan and priority information) into the
ether_vtag mbuf packet header field:

	m->m_pkthdr.ether_vtag = vlan_id;	/* ntohs()? */
	m->m_flags |= M_VLANTAG;

to mark the packet m with the specified VLAN tag.

On output the driver should check the mbuf for the M_VLANTAG flag to
see if a VLAN tag is present and valid:

	if (m->m_flags & M_VLANTAG) {
		... = m->m_pkthdr.ether_vtag;	/* htons()? */
		... pass tag to hardware ...
	}

VLAN tags are stored in host byte order.  Byte swapping may be necessary.

(Note: This driver conversion was mechanic and did not add or remove any
byte swapping in the drivers.)

Remove zone_mtag_vlan UMA zone and MTAG_VLAN definition.  No more tag
memory allocation have to be done.

Reviewed by:	thompsa, yar
Sponsored by:	TCP/IP Optimization Fundraise 2005
2006-09-17 13:33:30 +00:00
Julian Elischer
772b4799a4 Remove extra '*/' comment close. In code not normally compiled but a bug never the less. 2006-08-15 04:56:29 +00:00
John Baldwin
12d08f315b Expand locking coverage slightly to cover if_drv_flags in a few places
where it wasn't locked.

MFC after:	3 days
Reviewed by:	davidch
2006-07-20 18:41:00 +00:00
Doug Ambrisko
4b14416350 Fix ifconfig up when the HW was down. If the driver isn't running
then we need to call init otherwise just start the rx.

Interestingly dhclient seemed to work but ifconfig <IP> didn't
for me.

Reviewed by:	jhb
2006-07-12 23:13:09 +00:00
David Christensen
e6c54ad9d7 Log:
- Removed updates to if_ibytes, if_obytes, if_imcasts, and if_omcasts.
  These should not be handled by the driver.
- Add code to handle excessively fragmented mbufs when mapping TX frames.

Reviewed by:	ps
Approved by:	ps (mentor)
MFC after:	1 week
2006-06-08 18:31:21 +00:00
Poul-Henning Kamp
c40da00ca3 Since DELAY() was moved, most <machine/clock.h> #includes have been
unnecessary.
2006-05-16 14:37:58 +00:00
Matt Jacob
179162e836 Gratuitous tag alignment. It bugged me. 2006-05-04 00:34:07 +00:00
Paul Saab
262af1c828 Only use the low address for stats collection. 2006-04-26 16:33:58 +00:00
John Baldwin
75231ae311 Fix half of the current i386 tinderbox failure. max_bus_addr should be a
bus_addr_t rather than a bus_size_t.
2006-04-25 19:18:48 +00:00
Ruslan Ermilov
28db813d07 Fix DEVICE_POLLING support (compile-only tested). 2006-04-13 14:12:26 +00:00
Paul Saab
d8636a9ab7 Hook bce up to the build 2006-04-10 20:04:22 +00:00
Paul Saab
6caf734fd9 Add a driver for the Broadcom NetXtreme II (BCM5706/BCM5708)
PCI/PCIe Gigabit Ethernet adapeter.

Submitted by:	David Christensen
2006-04-10 19:55:23 +00:00