summaryrefslogtreecommitdiff
path: root/sys/dev/bce
Commit message (Collapse)AuthorAgeFilesLines
* MFC r206268Pyun YongHyeon2010-04-152-2839/+3118
| | | | | | | | | | - Fixed 5708S 2.5G support broken in last commit. - Added some new debug helper routines to systcl. - Fixed many of the style(9) violations that have crept into the code due to my use of a "smart" editor. Notes: svn path=/stable/8/; revision=206682
* MFC r205300:Pyun YongHyeon2010-04-153-386/+285
| | | | | | | | | | | | - Added support for 5709S/5716S PHYs. - Update copyright to 2010. - Add new debug code for RV2P block. - Improve output formatting for various debug functions. PR: kern/134658, kern/136417, kern/139761, kern/140970 Notes: svn path=/stable/8/; revision=206680
* MFC r204373-204374:Pyun YongHyeon2010-03-231-71/+124
| | | | | | | | | | | | | | | | | | | | r204373: Move TSO setup to new function bce_tso_setup(). Also remove VLAN parsing code in TSO path as the controller requires VLAN hardware tagging to make TSO work over VLANs. While parsing the mbuf in TSO patch, always perform check for writable mbuf as bce(4) have to reset IP length and IP checksum field of IP header and make sure to ensure contiguous buffer before accessing IP/TCP headers. While I'm here replace magic number 40 to more readable sizeof(struct ip) + sizeof(struct tcphdr). r204374: Add TSO support on VLANs. bce(4) controllers require VLAN hardware tagging to make TSO work on VLANs so explicitly disable TSO on VLAN if VLAN hardware tagging is disabled. Notes: svn path=/stable/8/; revision=205547
* MFC r204368,204370-204372:Pyun YongHyeon2010-03-231-41/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | r204368: Allow disabling VLAN hardware tag stripping with software work around. Management firmware(ASF/IPMI/UMP) requires the VLAN hardware tag stripping so don't actually disable VLAN hardware tag stripping. If VLAN hardware tag stripping was disabled, bce(4) manually reconstruct VLAN frame by appending stripped VLAN tag. Also remove unnecessary IFCAP_VLAN_MTU message. r204370: Make sure to stop controller first before changing MTU. And if interface is not running don't initialize controller. While here remove unnecessary update of error variable. r204371: Make toggling TSO, VLAN hardware checksum offloading work. Also fix TX/RX checksum handler to set/clear relavant assist bits which was used to cause unexpected results. With this change, bce(4) can be bridged with other interfaces that lack TSO, VLAN checksum offloading. r204372: Prefer m_collapse(9) over m_defrag(9). Notes: svn path=/stable/8/; revision=205544
* MFC r202717:Pyun YongHyeon2010-03-192-29/+137
| | | | | | | | | | | | | | - Added a workaround for NC-SI management firmware that would allow frames to be accepted while the driver is resetting the hardware. This failure is generally observed when broadcast frames are received during driver load and will generate "Unable to write CTX memory" errors. - Small changes to driver flags display. PR: kern/135836, kern/140684 Notes: svn path=/stable/8/; revision=205303
* - MFC r198320:Stanislav Sedov2009-11-152-47/+47
| | | | | | | | | Introduce new option BCE_JUMBO_HDRSPLIT that allows user to enable header in bce(4) instead of (ab)using ZERO_COPY_SOCKETS that was not into if_bce.c anyway. It is disabled by default. Notes: svn path=/stable/8/; revision=199288
* Use if_maddr_rlock()/if_maddr_runlock() rather than IF_ADDR_LOCK()/Robert Watson2009-06-261-2/+2
| | | | | | | | | | | | | | | | IF_ADDR_UNLOCK() across network device drivers when accessing the per-interface multicast address list, if_multiaddrs. This will allow us to change the locking strategy without affecting our driver programming interface or binary interface. For two wireless drivers, remove unnecessary locking, since they don't actually access the multicast address list. Approved by: re (kib) MFC after: 6 weeks Notes: svn path=/head/; revision=195049
* - Added code to read bootcode firwmare version.David Christensen2009-06-232-42/+130
| | | | | | | | | - Created dedicated shared memory access routines. MFC after: One week Notes: svn path=/head/; revision=194781
* DMA synchronization fixes:Xin LI2009-05-181-16/+13
| | | | | | | | | | | | | | | | | | - In bce_rx_intr(), use BUS_DMASYNC_POSTREAD instead of BUS_DMASYNC_POSTWRITE, as we want to "read" from the rx page chain pages. - Document why we need to do PREWRITE after we have updated the rx page chain pages. - In bce_intr(), use BUS_DMASYNC_POSTREAD and BUS_DMASYNC_PREREAD when before and after CPU "reading" the status block. - Adjust some nearby style mismatches/etc. Pointed out by: yongari Approved by: davidch (no objection) but bugs are mine :) Notes: svn path=/head/; revision=192281
* - Fixed incorrect packet length problem caused be earlier change toDavid Christensen2009-05-082-2/+6
| | | | | | | | | | support ZERO_COPY_SOCKETS. - Created #define for context initialization retry count. MFC after: 1 week Notes: svn path=/head/; revision=191923
* - Updated firmware to latest 4.6.X release.David Christensen2009-03-043-13581/+13987
| | | | | | | | | | | - Added missing firmware for 5709 A1 controllers. - Changed some debug statistic variable names to be more consistent. Submitted by: davidch MFC after: Two weeks Notes: svn path=/head/; revision=189325
* - Update copyright to 2009.David Christensen2009-02-273-42/+65
| | | | | | | | | | | - Only enable split header operation when ZERO_COPY_SOCKETS is enabled in the kernel. Submitted by: davidch MFC after: 1 week Notes: svn path=/head/; revision=189117
* Changes to match "Marketing Description" from Broadcom for HP servers.Xin LI2009-01-151-12/+14
| | | | | | | | Submitted by: davidch MFC after: 2 months Notes: svn path=/head/; revision=187317
* Remove intermediate variable busaddr and have bus_* operate directly onXin LI2009-01-131-13/+6
| | | | | | | | | | softc members upon initialization. Reviewed by: davidch MFC after: 1 month Notes: svn path=/head/; revision=187204
* Add several HP OEM parts' PCI IDs.Xin LI2009-01-131-0/+22
| | | | | | | MFC after: 2 months Notes: svn path=/head/; revision=187133
* Don't count InFramesL2FilterDiscards into Ierr. This value does not representXin LI2008-12-161-1/+0
| | | | | | | | | | | | a real packet error but simply indicate that an unexpected unicast or multicast error was received by the NIC, which was not counted in the past as well. Reported by: many (on -stable@) Reviewed by: davidch MFC after: 3 days Notes: svn path=/head/; revision=186169
* Test whether sc->tx_mbuf_map[i], not whether sc->tx_mbuf_map is NULL beforeXin LI2008-12-161-1/+1
| | | | | | | | | doing bus_dmamap_sync() since it operates on the former, not the latter. Reviewed by: davidch Notes: svn path=/head/; revision=186168
* Don't attempt to clear status updates if we did not do a link stateXin LI2008-12-031-5/+6
| | | | | | | | | | | change. As a side effect, this makes the excessive interrupts to disappear which has been observed as a regression in recent stable/7. Reported by: many (on -stable@) Reviewed by: davidch Notes: svn path=/head/; revision=185593
* - bump __FreeBSD version to reflect added buf_ring, memory barriers,Kip Macy2008-11-221-0/+3
| | | | | | | | | | | | | | | | | | | | and ifnet functions - add memory barriers to <machine/atomic.h> - update drivers to only conditionally define their own - add lockless producer / consumer ring buffer - remove ring buffer implementation from cxgb and update its callers - add if_transmit(struct ifnet *ifp, struct mbuf *m) to ifnet to allow drivers to efficiently manage multiple hardware queues (i.e. not serialize all packets through one ifq) - expose if_qflush to allow drivers to flush any driver managed queues This work was supported by Bitgravity Inc. and Chelsio Inc. Notes: svn path=/head/; revision=185162
* Correct a logic error when testing BCE_PHY_SERDES_FLAG.Xin LI2008-11-191-1/+1
| | | | | | | | | | PR: kern/128801 Pointed out by: Adam Morrison Ok'ed by: davidch MFC after: 3 days Notes: svn path=/head/; revision=185082
* - Updated support for 5716.David Christensen2008-08-272-289/+537
| | | | | | | | | | | | | | - Added some additional code for debug builds. - Fixed a problem printing physical memory on 64bit system during debugging. - Modified some of the context memory and mailbox register names to more clearly distinguish their use. - Added memory barriers for Intel CPUs when accessing host memory data structures which are written by hardware. MFC after: Two weeks. Notes: svn path=/head/; revision=182293
* - Added support for BCM5709 and BCM5716 controllers.David Christensen2008-06-133-5964/+15967
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=179771
* - Fixed kern/123696 by increasing firmware timeout value from 100 to 1000.David Christensen2008-06-102-54/+193
| | | | | | | | | | | | | - Fixed a problem on i386 architecture when using split header/jumbo frame firmware caused by hardware alignment requirements. - Added #define BCE_USE_SPLIT_HEADER to allow the feature to be enabled/ disabled. Enabled by default. PR: kern/123696 MFC after: 2 weeks Notes: svn path=/head/; revision=179695
* Trim an extra semi-colon.John Baldwin2008-05-301-1/+1
| | | | Notes: svn path=/head/; revision=179436
* The BCE chips appear to have an undocumented requirement that RX frames beScott Long2008-05-081-0/+8
| | | | | | | | | | | | | | | aligned on an 8 byte boundary. Prior to rev 1.36 this wasn't a problem because mbuf clusters tend be naturally aligned. The switch to using split buffers with the first buffer being the embedded data area of the mbuf has broken this assumption, at least on i386, causing a complete failure of RX functionality. Fix this for now by using a full cluster for the first RX buffer. A more sophisticated approach could be done with the old buffer scheme to realign the m_data pointer with m_adj(), but I'm also not clear on performance benefits of this old scheme or the performance implications of adding an m_adj() call to every allocation. Notes: svn path=/head/; revision=178853
* Remove some remnant alpha hacks.Marius Strobl2008-04-261-1/+1
| | | | | | | Approved by: PCI-maintainers (imp, jhb) Notes: svn path=/head/; revision=178588
* - Fixed a problem with the send chain consumer index which would causeDavid Christensen2008-04-113-1657/+1612
| | | | | | | | | | | | | | TX traffic to sit in the send chain until a received packet kick started the interrupt handler. This would cause extremely slow performance when used with NFS over UDP. - Removed untested polling code. - Updated copyright year in the file header. - Removed inadvertent ^M's created by DOS text editor. MFC after: 2 weeks Notes: svn path=/head/; revision=178132
* MFC after: 4 weeksDavid Christensen2008-02-223-5529/+7951
| | | | | | | | | | | | - Added loose RX MTU functionality to allow frames larger than 1500 bytes to be accepted even though the interface MTU is set to 1500. - Implemented new TCP header splitting/jumbo frame support which uses two chains for receive traffic rather than the original single recevie chain. - Added additional debug support code. Notes: svn path=/head/; revision=176448
* Fix function prototype for device_shutdown method.Pyun YongHyeon2007-11-221-3/+5
| | | | Notes: svn path=/head/; revision=173839
* - Fixed a problem that would cause kernel panics and "bce0: discard frame .."David Christensen2007-07-313-119/+240
| | | | | | | | | | | | | | | errors (especially when jumbo frames are enabled or in low memory systems) because the RX chain was corrupted when an mbuf was mapped to an unexpected number of buffers. - Fixed a problem that would cause kernel panics when an excessively fragmented TX mbuf couldn't be defragmented and was released by bce_tx_encap(). Approved by: re(hrs) MFC after: 7 days Notes: svn path=/head/; revision=171667
* - Migrated IPMI fix from RELENG_6.David Christensen2007-06-162-205/+362
| | | | | | | - Added additional debug code. Notes: svn path=/head/; revision=170810
* New Features:David Christensen2007-06-072-410/+412
| | | | | | | | | - Added 2.5G support for BCM5708S. MFC after: 4 weeks Notes: svn path=/head/; revision=170392
* - Added TSO supportDavid Christensen2007-05-163-3483/+6210
| | | | | | | | | | | | | | | - Updated firmware to latest release (v3.4.8) to fix TSO + jumbo frame lockup - Added MSI (hw.bce.msi_enable) and TSO (hw.bce.tso_enable) sysctls - Fixed kernel panic when MSI is used and module is unloaded - Added several new debug routines - Removed slack space for RX/TX chains since it only covers sloppy coding - Fixed a potential problem when programming jumbo MTU size in hardware - Various other comment changes MFC after: 4 weeks Notes: svn path=/head/; revision=169632
* MFC after: 2 weeksDavid Christensen2007-05-043-312/+515
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Updated copyright date to 2007. Tested with BCM5706 A3. Added ID for BCM5708 B2. Removed unused driver version string. Modified BCE_PRINTF macro to automatically fill-in the sc pointer. Fixed a kernel panic when the driver was loaded as a module from the command-line because the MII bus pointer was null (i.e. the MII bus hadn't been enumerated yet). Added fix proposed by Vladimir Ivanov <wawa@yandex-team.ru> to prevent driver state corruption when releasing the lock during the ISR in bce_rx_intr() to send packets up the stack. Added new TX chain and register read sysctl interfaces for debugging. Cleaned up formatting for various other debug routines. Added a new statistic maintained by firmware which tracks the number of received packets dropped because no receive buffers are available. Notes: svn path=/head/; revision=169271
* Catch up the rest of the drivers with the ether_vlan_mtap modifications.Christian S.J. Peron2007-03-041-1/+1
| | | | | | | | | | | | | If these drivers are setting M_VLANTAG because they are stripping the layer 2 802.1Q headers, then they need to be re-inserting them so any bpf(4) peers can properly decode them. It should be noted that this is compiled tested only. MFC after: 3 weeks Notes: svn path=/head/; revision=167190
* o break newbus api: add a new argument of type driver_filter_t toPaolo Pisati2007-02-231-1/+1
| | | | | | | | | | | | | | | | bus_setup_intr() o add an int return code to all fast handlers o retire INTR_FAST/IH_FAST For more info: http://docs.freebsd.org/cgi/getmsg.cgi?fetch=465712+0+current/freebsd-current Reviewed by: many Approved by: re@ Notes: svn path=/head/; revision=166901
* Add support for SERDES PHY configurations. These are commonly found inDoug White2007-01-261-43/+13
| | | | | | | | | | blade systems, such as the Dell 1955 and the Intel SBXD132. Development hardware for this work was provided by Broadcom and iXsystems. A SBXD132 blade for testing was provided by Iron Systems. Notes: svn path=/head/; revision=166261
* The multicast hash table has 8 slots in the BCE hardware, not 4 slots likeScott Long2007-01-201-4/+4
| | | | | | | | | | the BGE hardware. Adapt the driver for this. Submitted by: Mike Karels MFC After: 3 days Notes: svn path=/head/; revision=166153
* - Add a locked variant of bce_ifmedia_upd() for use within the driver andJohn Baldwin2007-01-131-7/+18
| | | | | | | | | | | add missing locking to bce_ifmedia_upd(). - While I'm here, unexpand an instance of LIST_FOREACH(). MFC after: 2 weeks Reviewed by: scottl Notes: svn path=/head/; revision=165994
* Space cleanup.Xin LI2007-01-111-1/+1
| | | | Notes: svn path=/head/; revision=165934
* - Instead of if_watchdog/if_timer interface use our own timerXin LI2007-01-112-29/+28
| | | | | | | | | | | | that piggybacks on bce_tick() callout. - Instead of unconditionally resetting the controller, try to skip the reset in case we got a pause frame, like em(4) did. - Lock bce_tick() using callout_init_mtx(). Discussed with/Reviewed by: glebius, scottl, davidch Notes: svn path=/head/; revision=165933
* Fix compile with BCE_DEBUG. The last one tripped up gcc 2.95 on 4.x evenJohn Baldwin2006-12-061-4/+4
| | | | | | | with BCE_DEBUG turned off. Notes: svn path=/head/; revision=164968
* Due to an incorrect macro, it appears that this driver has always beenScott Long2006-11-162-14/+18
| | | | | | | | | | | | 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 Notes: svn path=/head/; revision=164329
* In bce_start_locked, check the used_tx_bd count rather than theJohn Polstra2006-11-161-8/+8
| | | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=164327
* Add MSI support to em(4), bce(4), and mpt(4). For now, we only supportJohn Baldwin2006-11-151-3/+11
| | | | | | | | 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. Notes: svn path=/head/; revision=164305
* Fix a typo in the device ID table that prevented 5708S chips from beingScott Long2006-10-311-2/+2
| | | | | | | | | detected. Submitted by: pyun Notes: svn path=/head/; revision=163814
* Refine the checksum hack a little. It appears that the chip can handle UDPScott Long2006-10-241-3/+7
| | | | | | | | | | 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. Notes: svn path=/head/; revision=163642
* There seems to be a problem with txcsum and UDP. Turn it off until it isScott Long2006-10-211-0/+5
| | | | | | | understood better. This fixes timeout problems with NFS. Notes: svn path=/head/; revision=163593
* Be more like the BGE driver. Ensure that at least 16 TX descriptors areScott Long2006-10-211-8/+11
| | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=163558
* I can't find any reason why an 8 byte alignment should be enforced on rxScott Long2006-10-191-3/+3
| | | | | | | | and tx buffers. Fix it there, and also don't have it be overridden by the parent tag. Notes: svn path=/head/; revision=163501