aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/em/if_em.h
Commit message (Collapse)AuthorAgeFilesLines
* Merge of the source for igb and em into dev/e1000, thisJack F Vogel2008-07-301-489/+0
| | | | | | | | | | | | | | proved to be necessary to make the static drivers work in EITHER/OR or BOTH configurations. Modules will still build in sys/modules/igb or em as before. This also updates the igb driver for support for the 82576 adapter, adds shared code fixes, and etc.... MFC after: ASAP Notes: svn path=/head/; revision=181027
* This delta has a few important items:Jack F Vogel2008-04-251-32/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | PR 122839 is fixed in both em and in igb Second, the issue on building modules since the static kernel build changes is now resolved. I was not able to get the fancier directory hierarchy working, but this works, both em and igb build as modules now. Third, there is now support in em for two new NICs, Hartwell (or 82574) is a low cost PCIE dual port adapter that has MSIX, for this release it uses 3 vectors only, RX, TX, and LINK. In the next release I will add a second TX and RX queue. Also, there is support here for ICH10, the followon to ICH9. Both of these are early releases, general availability will follow soon. Fourth: On Hartwell and ICH10 we now have IEEE 1588 PTP support, I have implemented this in a provisional way so that early adopters may try and comment on the functionality. The IOCTL structure may change. This feature is off by default, you need to edit the Makefile and add the EM_TIMESYNC define to get the code. Enjoy all!! Notes: svn path=/head/; revision=178523
* This update primarily addresses the ability to have both the emJack F Vogel2008-04-021-3/+0
| | | | | | | | | and the igb driver static in the kernel. But it also reflects some other bug fixes in my development stream at Intel. PR 122373 is also fixed in this code. Notes: svn path=/head/; revision=177867
* Need to add define of FAST interrupts as defaultJack F Vogel2008-02-291-0/+3
| | | | Notes: svn path=/head/; revision=176671
* This change introduces a split to the Intel E1000 driver, now rather thanJack F Vogel2008-02-291-28/+32
| | | | | | | | | | | | | | | | | just em, there is an igb driver (this follows behavior with our Linux drivers). All adapters up to the 82575 are supported in em, and new client/desktop support will continue to be in that adapter. The igb driver is for new server NICs like the 82575 and its followons. Advanced features for virtualization and performance will be in this driver. Also, both drivers now have shared code that is up to the latest we have released. Some stylistic changes as well. Enjoy :) Notes: svn path=/head/; revision=176667
* A minor issue with lock names, WITNESS complainsJack F Vogel2007-11-281-2/+2
| | | | | | | when the two locks are the same... Notes: svn path=/head/; revision=174029
* One nit, FAST handling is now in #ifdef's for compatibilityJack F Vogel2007-11-201-1/+6
| | | | | | | | | between RELEASES, but we want it on by default in 7 and later, add that define, and take out a fragment left from a workaround being removed. Notes: svn path=/head/; revision=173789
* Driver version 6.7.3Jack F Vogel2007-11-201-12/+24
| | | | | | | | | | | | - Bring HEAD up to the latest shared code - Fix TSO problem using limited MSS and forwarding - Dual lock implementation - New device support - For my ease, this code can compile in either 6.x or later - brings this driver in sync with the 6.3 Notes: svn path=/head/; revision=173788
* A number of small fixes:Jack F Vogel2007-09-101-1/+0
| | | | | | | | | | | | | - duplicate #define in header, thanks to Kevin Lo for pointing out. - incorrect BUSMASTER enable logic, thanks Patrick Oeschger - 82543 fails due to bogus IO BAR logic - Allow 82571 to use MSI interrupts - Checksum Offload for UDP not working on 82575 Approved by:re Notes: svn path=/head/; revision=172138
* Couple of changes, back down on last TSO change, instead make oldJack F Vogel2007-05-171-0/+2
| | | | | | | | | | | | | | adapter list still capable, but only PCI-E adapters are now enabled. The user can enable older PCI-X or PCI adapters using ifconfig. Secondly, Arthur Hartwig pointed out my MSI change was not working correctly, changed to something that now does. Thanks Arthur. There was also a fundamental bug in the 82575 MSIX code, the MSIX registers had to be mapped, opps :) Rubber-stamped by: Pdeuskar Notes: svn path=/head/; revision=169637
* This delta adds two bug fixes: one that makes HW Offload logic inJack F Vogel2007-05-161-15/+3
| | | | | | | | | | | | | legacy codepath match the 82575, without this we were seeing bridging fail on 82546 adapters. Secondly, I have limited TSO to PCI Express adapters, I meant to do this and it got dropped in the earlier delta. Next, I am dropping in the latest shared code from our development team, consensus was that this should be done frequently, so I am :) Approved by: pdeuskar Notes: svn path=/head/; revision=169589
* $FreeBSD$ tags are not compilable C code; wrap in either __FBSDID() orRobert Watson2007-05-041-1/+4
| | | | | | | | | in comments for .c and .h files respectively. Jack may want to clean up style or other aspects once he's up and about again, but this gets the kernel compiling. Notes: svn path=/head/; revision=169248
* Merge in the new driver (6.5.0) of Intel. This has a newJack F Vogel2007-05-041-80/+77
| | | | | | | | | | | | | | | | | | | shared code infrastructure that is family specific and modular. There is also support for our latest gigabit nic, the 82575 that is MSI/X and multiqueue capable. The new shared code changes some interfaces to the core code but testing at Intel has been going on for months, it is fairly stable. I have attempted to be careful in retaining any fixes that CURRENT had and we did not, I apologize in advance if any thing gets clobbered, I'm sure I'll hear about it :) Approved by pdeuskar Notes: svn path=/head/; revision=169240
* Move magic PCIe workaround constant to header - add appropriate commentKip Macy2006-11-231-0/+6
| | | | | | | Suggested by: jfvogel Notes: svn path=/head/; revision=164546
* Add MSI support to em(4), bce(4), and mpt(4). For now, we only supportJohn Baldwin2006-11-151-0/+1
| | | | | | | | 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
* Instead of using the legacy if_timer/if_watchdog interface createGleb Smirnoff2006-11-091-0/+1
| | | | | | | | | | | | | | our own watchdog that piggybacks on the em_local_timer() routine. We suppose that the if_timer/if_watchdog interface should be obsoleted, since it doesn't fit the modern SMP network stack. NIC drivers should create their own watchdogs, that check and clear the timers always holding driver's lock. In collaboration with: jfv, scottl Notes: svn path=/head/; revision=164126
* Rework the transmit register handling. In em_encap() store index ofGleb Smirnoff2006-10-311-1/+2
| | | | | | | | | | | | | | the EOP descriptor in the first descriptor of the packet. And then in em_txeof() search for DD bits set only in the EOP descriptors, embedding the cleanup of all packet's descriptors into inner loop. This change is important for future chips, where DD bit is going to be set only on the EOP descriptors. Submitted by: jfv Notes: svn path=/head/; revision=163826
* Merge new vendor release - 6.2.9.Gleb Smirnoff2006-10-311-8/+19
| | | | | | | | | | | | | | | | | | | | | Details: o if_em.c changes: - Added several new PCI ids. - Check em_check_phy_reset_block() before doing SIOCSIFMEDIA ioctl. - Don't touch TARC registers, they are now handled in shared code in if_em_hw.c. - Move RDH and RDT setting to the end of em_initialize_receive_unit(). - Declare em_read_pcie_cap_reg(), now empty. o if_em_hw.c dropped in from vendor, then restored rev. 1.15. o if_em_hw.h dropped in from vendor, then modified: - Added RX overrun interrupt flag to interrupt enable mask. - Remove declarations of em_io_read(), em_io_write(). Approved by: jfv Notes: svn path=/head/; revision=163824
* Backout bogus checkin to HEADJack F Vogel2006-10-281-94/+76
| | | | | | | Approved by: scottl Notes: svn path=/head/; revision=163730
* This is the merge of the Intel 6.2.9 driver. It provides all new shared code,Jack F Vogel2006-10-281-76/+94
| | | | | | | | new device support, and it is hoped a more stable driver for 6.2. RELEASE. This checkin was discussed and approved today by RE, scottl, jhb, and pdeuskar Notes: svn path=/head/; revision=163724
* Add support for TSO. Thanks to Andre for adding support in the stackPrafulla Deuskar2006-09-091-0/+7
| | | | | | | | | and Jack Vogel for driver changes. Submitted by: Jack Vogel Notes: svn path=/head/; revision=162171
* Just foward declare 'struct adapter' instead of declaring an actualJohn Baldwin2006-08-311-2/+3
| | | | | | | 'adapter' structure. Notes: svn path=/head/; revision=161778
* Overhaul Rx path to recover from mbuf cluster allocation failure.Pyun YongHyeon2006-08-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | o Create one more spare DMA map for Rx handler to recover from bus_dmamap_load_mbuf_sg(9) failure. o Make sure to update status bit in Rx descriptors even if we failed to allocate a new buffer. Previously it resulted in stuck condition and em_handle_rxtx task took up all available CPU cycles. o Don't blindly unload DMA map. Reuse loaded DMA map if received packet has errors. This would speed up Rx processing a bit under heavy load as it does not need to reload DMA map in case of error. (bus_dmamap_load_mbuf_sg(9) is the most expensive call in driver context.) o Update if_iqdrops counter if it can't allocate a mbuf cluster. With this change it's now possible to see queue dropped packets with netstat(1). o Update mbuf_cluster_failed counter if fixup code failed to allocate mbuf header. o Return ENOBUFS instead of ENOMEM in case of Rx fixup failure. o Make adapter->lmp NULL in case of Rx fixup failure. Strictly specking it's not necessary for correct operation but it makes the intention clear. o Remove now unused dropped_pkts member in softc. With these changes em(4) should survive mbuf cluster allocation failure on Rx path. Reviewed by: pdeuskar, glebius (with improvements) Notes: svn path=/head/; revision=161266
* Revert back changes to made in rev 1.109 of if_em.c which were unnecessary.Prafulla Deuskar2006-08-031-4/+4
| | | | | | | This makes it easier for us to get the changes into -current and to -stable quickly. Notes: svn path=/head/; revision=160956
* Merge in new driver from Intel, version 6.0.5. It adds support forGleb Smirnoff2006-08-031-2/+12
| | | | | | | | | | | | | | | | | | | | | 80003 NICs and NICs found on ICH8 mobos, and improves support for already known chips. Details: - if_em.c. Merged manually, viewing diff between new vendor driver and previous one. This was an easy task, because most changes between 5.1.5 and 6.0.5 are bugfixes taken from FreeBSD. - if_em_hw.h. Dropped in from vendor, and then restored revisions 1.16, 1.17, 1.18. - if_em_hw.c. Dropped in from vendor, and then restored revision 1.15. - if_em_osdep.h. Added new required macros from vendor file and add a hack against define namespace mangling in if_em_hw.h. Intel made another hack, but I prefer mine. Notes: svn path=/head/; revision=160949
* Since resetting hardware takes a very long time and results in linkPyun YongHyeon2006-07-201-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | renegotiation, we only initialize the hardware only when it is absolutely required. Process SIOCGIFADDR ioctl in em(4) when we know an IPv4 address is added. Handling SIOCGIFADDR in a driver is layering violation but it seems that there is no easy way without rewritting hardware initialization code to reduce settle time after reset. This should fix a long standing bug which didn't send ARP packet when interface address is changed or an alias address is added. Another effect of this fix is it doesn't need additional delays anymore when adding an alias address to the interface. While I'm here add a new if_flags into softc which remembers current prgroammed interface flags and make use of it when we have to program promiscuous mode. Tested by: Atanas <atanas AT asd DOT aplus DOT net> Analyzed by: rwatson Discussed with: -stable Notes: svn path=/head/; revision=160519
* - Second style(9) megacleanup.Gleb Smirnoff2006-02-151-120/+119
| | | | | | | | | - Rename "adapter" to "sc"/"softc", to be like other drivers. (-13 Kb less source code) Notes: svn path=/head/; revision=155709
* Move includes from if_em.h to if_em.c and sort them.Gleb Smirnoff2006-02-141-40/+0
| | | | Notes: svn path=/head/; revision=155674
* Now that the em driver no longer needs to directly touch the scheduler, ↵Scott Long2006-02-041-3/+0
| | | | | | | | | remove some unneeded headers. Notes: svn path=/head/; revision=155305
* Significant performance improvements for the if_em driver:Scott Long2006-01-111-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Only update the rx ring consumer pointer after running through the rx loop, not with each iteration through the loop. - If possible, use a fast interupt handler instead of an ithread handler. Use the interrupt handler to check and squelch the interrupt, then schedule a taskqueue to do the actual work. This has three benefits: - Eliminates the 'interrupt aliasing' problem found in many chipsets by allowing the driver to mask the interrupt in the NIC instead of the OS masking the interrupt in the APIC. - Allows the driver to control the amount of work done in the interrupt handler. This results in what I call 'adaptive polling', where you get the latency benefits of a quick response to interrupts with the interrupt mitigation and work partitioning of polling. Polling is still an option in the driver, but I consider it orthogonal to this work. - Don't hold the driver lock in the RX handler. The handler and all data associated is effectively serialized already. This eliminates the cost of dropping and reaquiring the lock for every receieved packet. The result is much lower contention for the driver lock, resulting in lower CPU usage and lower latency for interactive workloads. The amount of work done in the taskqueue is controlled by the sysctl dev.em.N.rx_processing_limit and tunable hw.em.rx_process_limit Setting these to -1 effectively removes the limit. The fast interrupt and taskqueue can be disabled by defining NO_EM_FASTINTR. This work has been shown to increase fast-forwarding from ~570 kpps to ~750 kpps (note that the same NIC hardware seems unable to transmit more than 800 kpps, so this increase appears to be limited almost solely by the hardware). Gains have been shown in other workloads, ranging from better performance to elimination of over-saturation livelocks. Thanks to Andre Opperman for his time and resources from his network performance project in performing much of the testing. Thanks to Gleb Smirnoff and Danny Braniss for their help in testing also. Notes: svn path=/head/; revision=154204
* busdma cleanup for em(4).Pyun YongHyeon2005-11-211-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | - don't force busdma to pre-allocate bounce pages for parent tag. - use system supplied roundup2 macro instead of rolling its own version. - TX/RX decriptor length should be multiple of 128. There is no no need to expand the size with the multiple of 4096. - don't create/destroy DMA maps in TX/RX handlers. Use pre-allocated DMA maps. Since creating DMA maps on sparc64 is time consuming operations(resource mananger overhead), this change should boost performance on sparc64. I could get > 2x speedup on Ultra60. - TX/RX descriptors could be aligned on 128 boundary. Aligning them on PAGE_SIZE is waste of resource. - don't blindly create TX DMA tag with size of MCLBYTES * 8. The size is only valid under jumbo frame environments. Instead of using the hardcoded value, re-compute necessary size on the fly. - RX side bus_dmamap_load_mbuf_sg(9) support. - remove unused macro EM_ROUNDUP and constant EM_MMBA. Reviewed by: scottl Tested by: glebius Notes: svn path=/head/; revision=152645
* - Backout last change, since it is memory overkill for a non busy host orGleb Smirnoff2005-11-171-4/+8
| | | | | | | | | | | | | | | | | | for a notebook with em(4) adapter. - Introduce tunables em.hw.txd and em.hw.rxd, which allow administrator to configure number of transmit and receive descriptors. - Check em.hw.txd and em.hw.rxd against hardware limits [*] and require them to be multiple of 128. [*] According to comments in if_em.h the 82540EM/82541ER chips can handle more than 256 descriptors. Since we don't have this hardware to test, we decided to mimic NetBSD wm(4) driver, that limits these chips to 256 descriptors. In collaboration with: yongari Notes: svn path=/head/; revision=152545
* Give a try to autoconfiguring the number of transmit and receiveGleb Smirnoff2005-11-101-5/+7
| | | | | | | descriptors depending on chip revision. Notes: svn path=/head/; revision=152276
* - Introduce two more stat counters, counting number of RXGleb Smirnoff2005-11-091-1/+2
| | | | | | | | | | | | | | | | overruns and number of watchdog timeouts. - Do not log(9) RX overrun events, since this pessimizes things under load [1]. - Do not increase if->if_oerrors in em_watchdog(), since this leads to counter slipping back, when if->if_oerrors is recalculated in em_update_stats_counters(). Instead increase watchdog counter in em_watchdog() and take it into account in em_update_stats_counters(). Submitted by: ade [1] Notes: svn path=/head/; revision=152247
* Make em(4) work on big-endian architectures.Pyun YongHyeon2005-11-091-14/+10
| | | | | | | | | | | | | | | | | | | | - disable jumbo frame support on strict alignment architectures due to the limitation of hardware. The driver needs a fix-up code for RX side. The fix will show up in near future. - fix endian issue for 82544 on PCI-X bus. I couldn't test this as I don't have the NIC/hardware. - prefer PCIR_BAR to hardcoded EM_MMBA. - Properly checks for for 64bit BAR [1] - replace inl/outl with bus_space(9) [1] - fix endian issue on VLAN handling. - reorder header files and remove unnecessary one. Reviewed by: cognet No response from: pdeuskar, tackerman Obtained from: OpenBSD [1] Notes: svn path=/head/; revision=152225
* Some more minor cleanups of em(4) driver:Gleb Smirnoff2005-10-201-3/+0
| | | | | | | | | | | | | | | - Destroy mutex in case of attach failure. [1] - Lock properly em_watchdog(). [1] - Lock properly em_sysctl_int_delay(). [1] - Remove unused global adapter linked list. - Remove unused dma_size field from struct em_dma_alloc. - Do not touch interface statistics, that must be edited only by upper layers. [1] Submitted by: yongari [1] Notes: svn path=/head/; revision=151495
* Revamp interrupt handling in em(4) driver:Gleb Smirnoff2005-10-201-8/+1
| | | | | | | | | | | | | | | | | | | | | | | | o Do not mask the RX overrun interrupt. o Rewrite em_intr(): - Axe EM_MAX_INTR. - Cycle acknowledging interrupts and processing packets until zero interrupt cause register is read. - If RX overrun comes in log this fact. [ NetBSD also resets adapter in this case, but my tests showed that this is not needed and only pessimizes behavior under heavy load. ] - Since almost all functions is rewritten, style the remaining lines. This fixes em(4) interfaces wedging under high load. In collaboration with: wpaul, cognet Obtained from: NetBSD Notes: svn path=/head/; revision=151494
* Remove bridge(4) from the tree. if_bridge(4) is a full functionalMax Laier2005-09-271-1/+0
| | | | | | | | | | | replacement and has additional features which make it superior. Discussed on: -arch Reviewed by: thompsa X-MFC-after: never (RELENG_6 as transition period) Notes: svn path=/head/; revision=150636
* Stop embedding struct ifnet at the top of driver softcs. Instead theBrooks Davis2005-06-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | struct ifnet or the layer 2 common structure it was embedded in have been replaced with a struct ifnet pointer to be filled by a call to the new function, if_alloc(). The layer 2 common structure is also allocated via if_alloc() based on the interface type. It is hung off the new struct ifnet member, if_l2com. This change removes the size of these structures from the kernel ABI and will allow us to better manage them as interfaces come and go. Other changes of note: - Struct arpcom is no longer referenced in normal interface code. Instead the Ethernet address is accessed via the IFP2ENADDR() macro. To enforce this ac_enaddr has been renamed to _ac_enaddr. - The second argument to ether_ifattach is now always the mac address from driver private storage rather than sometimes being ac_enaddr. Reviewed by: sobomax, sam Notes: svn path=/head/; revision=147256
* Changes to update driver with latest Intel driver version 2.1.7Tony Ackerman2005-05-261-6/+1
| | | | | | | | | | | | | | - Changed from using explicit devices id to using descriptive labels. - Added support for 82573 and 82546 Quad adapters. - Corrected support for 82547EI and 82541ER (mac_type was not assigned) - Removed #ifdef DBG_STATS and extraneous code. if_em_hw.c/if_em_hw.h - Added support for 82573 and 82546 Quad adapters. - Brought forward Intel's most current mac and phy changes. Notes: svn path=/head/; revision=146662
* Convert if_em to the new bus_dmamap_load_sg() interface. The old callbackScott Long2005-01-151-6/+0
| | | | | | | was really just a waste of cycles, so this streamlines it considerably. Notes: svn path=/head/; revision=140318
* Correct a bug in the if_em driver relating to the use of vlans withRobert Watson2004-11-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | promiscuous mode introduced in 1.45, which programs the em card not to strip or prepend tags when in promiscuous mode without also modifying behavior to manually prepend a vlan header in the event that the card isn't doing it on transmit. Due to a feature of card operation, if the global VLAN prepend/strip register isn't set, setting the VLAN tag flag on individual packet descriptors will cause the packet to be transmitted using ISL encapsulation rather than 802.1Q VLAN encapsulation. This fix causes em_encap() to prepend the header by tracking whether the card is configured to temporarily disable prepending/stripping due to promiscuous mode. As a result, entering promiscuous mode on the parent em interface no longer causes vlans to appear to "wedge" or transmit ISL-encapsulated frames, which typically will not be configured/spoken by the other endpoints on the VLAN trunk. This bug may also exist in other drivers, and the additional vlan encapsulation logic should be abstracted and centralized in if_vlan.c if so. RELENG_5_3 candidate. MFC after: 1 week Tested by: pjd, rwatson Reported by: astesin at ukrtelecom dot net Reported by: Mike Tancsa <mike at sentex dot net> Reported by: Iasen Kostov <tbyte at OTEL dot net> Notes: svn path=/head/; revision=137609
* Unbreak the build.Dag-Erling Smørgrav2004-11-111-0/+1
| | | | | | | Pointy hat to: bms Notes: svn path=/head/; revision=137583
* Remove now-unused sysctl members.Bruce M Simpson2004-11-111-4/+0
| | | | Notes: svn path=/head/; revision=137576
* Added support for Intel PRO/1000 GT Desktop Adapter(Device ID 8086 107C)Prafulla Deuskar2004-09-011-4/+15
| | | | | | | | | | | | | | Removed support for Intel 82541ER Added fix for 82547 which corrects an issue with Jumbo frames larger than 10k. Added fix for vlan tagged frames not being properly bridged. Corrected TBI workaround. Corrected incorrect LED operation issues Submitted by: tackerman (Tony Ackerman) MFC after: 2 weeks Notes: svn path=/head/; revision=134619
* Add missing <sys/module.h> includesPoul-Henning Kamp2004-05-301-0/+1
| | | | Notes: svn path=/head/; revision=129879
* - Code cleanupPrafulla Deuskar2003-11-141-0/+1
| | | | | | | | | | | - In the receive routine handle the case where last descriptor could have less than 4 bytes of data. - Handle race between detach/ioctl routine. MFC after: 3 days Notes: svn path=/head/; revision=122681
* locking fixups:Sam Leffler2003-10-101-2/+6
| | | | | | | | | | | o correct recursive locking when polling and in em_82547_move_tail o destroy mutex on detach o add EM_LOCK_ASSERT and similar macros for creating+deleteing the mtx Submitted by: Daniel Eischen <eischen@vigrid.com> Notes: svn path=/head/; revision=120989
* add lockingSam Leffler2003-09-231-2/+6
| | | | | | | | Reviewed by: Prafulla Deuskar <pdeuskar@FreeBSD.ORG> Sponsored by: FreeBSD Foundation Notes: svn path=/head/; revision=120364
* Add support for new devices.Prafulla Deuskar2003-08-271-12/+39
| | | | | | | | | | | | | Bug Fixes: - Allow users to use LAA - Remember promiscuous mode settings while bridging - Allow gratuitous arp's to be sent PR: 52966/54488 MFC after: 1 week Notes: svn path=/head/; revision=119509