summaryrefslogtreecommitdiffstats
path: root/sys/dev/em
Commit message (Collapse)AuthorAgeFilesLines
* Only advertize IFCAP_TSO4 capabilities. IPv6 is not yet supported.andre2006-09-291-4/+4
| | | | Reviewed by: jfv
* Handle all error cases from bus_dmamap_load_mbuf_sg(). Those are:andre2006-09-291-5/+21
| | | | | | | | | | | | | | | | - EFBIG means the mbuf chain was too long and bus_dma ran out of segments. Defragment the mbuf chain and try again. (Already existed, not changed.) - ENOMEM means bus_dma could not obtain enough bounce buffers at this point in time. Defer sending and try again later. - All other errors, in particular EINVAL, are fatal and prevent the mbuf chain from ever going through. Drop it and report error. - Checking (nsegs == 0) is unnecessary as bus_dmamap_load_mbuf_sg() always reports an error if it is < 1. This prevents broken packets from clogging the interface queue indefinately. Discussed with: scottl Reviewed by: jfv
* Move the initialization of the hardware capabilities in em_init_locked()andre2006-09-211-8/+12
| | | | | | | before em_setup_transmit_structures() as it needs this information to properly set up TSO parameters. Reviewed by: jfv
* Don't forget to add curly braces when doing more than one line of actionsandre2006-09-181-1/+2
| | | | | | after a 'if' statement. Pointy hat to: andre
* Move ethernet VLAN tags from mtags to its own mbuf packet header fieldandre2006-09-171-12/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Fix issues found by Coverity (223392, 223393) due to TSO additionspdeuskar2006-09-111-2/+4
| | | | Submitted by: Matthew Jacob
* Fix style(9) issues in the TSO specific changes.pdeuskar2006-09-101-154/+152
| | | | Pointed out by: jmallett
* Second attempt at fixing module buildpdeuskar2006-09-091-1/+1
| | | | Pointyhat: pdeuskar
* Fix build breakage while compiling em as a module.pdeuskar2006-09-091-0/+1
|
* Add support for TSO. Thanks to Andre for adding support in the stackpdeuskar2006-09-092-29/+203
| | | | | | and Jack Vogel for driver changes. Submitted by: Jack Vogel
* add a newbus method for obtaining the bus's bus_dma_tag_t... This isjmg2006-09-031-3/+3
| | | | | | | | | | | | | required by arches like sparc64 (not yet implemented) and sun4v where there are seperate IOMMU's for each PCI bus... For all other arches, it will end up returning NULL, which makes it a no-op... Convert a few drivers (the ones we've been working w/ on sun4v) to the new convection... Eventually all drivers will need to replace the parent tag of NULL, w/ bus_get_dma_tag(dev), though dev is usually different for each driver, and will require hand inspection... Reviewed by: scottl (earlier version)
* Comment tweaks.jhb2006-09-011-2/+2
|
* - Use pci_enable_busmaster() and pci_enable_io() to update the commandjhb2006-09-011-11/+5
| | | | | | | | | | register. This really shouldn't be using pci_enable_io() directly as bus_alloc_resource() does it already, but the cached copy of the command word needs to be correct so the enable/disable mwi functions work properly. - Use pci bus accessors to read revision ID and subvendor IDs. Reviewed by: jvogel
* Add locking to the ifmedia callouts.jhb2006-09-011-2/+8
| | | | Reviewed by: jvogel, yongari
* Fix my error in rev. 1.109.glebius2006-09-011-2/+2
| | | | | Submitted by: jhb Pointy hat to: glebius
* Just foward declare 'struct adapter' instead of declaring an actualjhb2006-08-311-2/+3
| | | | 'adapter' structure.
* Compare the correct field against NULL when determining whether or not tojhb2006-08-311-1/+1
| | | | do bus_teardown_intr().
* It seems that em(4) misses Tx completion interrupts under certainyongari2006-08-221-0/+12
| | | | | | | | | | | | | | | conditions. The cause of missing Tx completion interrupts comes from Tx interrupt moderation mechanism(delayed interrupts) or chipset bug. If Tx interrupt moderation mechanism is the cause of false watchdog timeout error we should have to fix all device drivers that have Tx interrupt moderation capability. We may need more investigation for this issue. Anyway, the fix is the same for both cases. This should fix occasional watchdog timeout errors seen on a few systems. Reported by: -net, Patrick M. Hausen < hausen AT punkt DOT de > Tested by: Patrick M. Hausen < hausen AT punkt DOT de >
* Don't update Rx descriptor status in two different functions.yongari2006-08-161-9/+8
| | | | | Suggested by: pdeuskar Reviewed by: pdeuskar
* Change hardcoded and incorrect number with correct define. This change is aglebius2006-08-141-1/+1
| | | | | | | nop, since E1000_FDX_COLLISION_DISTANCE == E1000_HDX_COLLISION_DISTANCE. PR: kern/101000 Submitted by: Doug Havir
* Make em(4) handle too many fragmented frame with m_defrag(9).yongari2006-08-141-12/+33
| | | | | | | | | | | | Previously em(4) requeued the failed mbuf chains from bus_dmamap_load_mbuf_sg(9) failure to resend it later. However, bus_dmamap_load_mbuf_sg(9) may never complete its request as the fragmented frames can have more than EM_MAX_SCATTER segments. To handle the above EFBIG case, defragment the frame with m_defrag(9) and free the mbuf chain if it can't deframent the chain due to resource shortage. Reviewed by glebius (with improvements)
* Overhaul Rx path to recover from mbuf cluster allocation failure.yongari2006-08-142-48/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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)
* Apply alignment fixup only when programmed frame size is greater thanyongari2006-08-141-3/+3
| | | | | | MCLBYTES - ETHER_ALIGN. Previously it applied the alignment fixup code for oversized frames which would result in reduced performance on strict alignment archs.
* Merge in new driver from Intel, version 6.1.4. It adds support forglebius2006-08-113-49/+64
| | | | | | | | | | 82571EB quad port copper NIC and has few minor fixes. Details: - if_em.c. Merged manually, viewing diff between new vendor driver and previous one. - if_em_hw.c. Dropped in from vendor, and then restored revision 1.15.
* 10/100 PHY shouldn't support gigabit media types.pdeuskar2006-08-091-3/+6
| | | | | | Submitted by: brad (brad@comstyle.com) Obtained from: OpenBSD MFC after: 1 week
* Commit the results of the typo hunt by Darren Pilgrim.yar2006-08-041-1/+1
| | | | | | | | | | This change affects documentation and comments only, no real code involved. PR: misc/101245 Submitted by: Darren Pilgrim <darren pilgrim bitfreak org> Tested by: md5(1) MFC after: 1 week
* Revert back changes to made in rev 1.109 of if_em.c which were unnecessary.pdeuskar2006-08-032-978/+978
| | | | This makes it easier for us to get the changes into -current and to -stable quickly.
* Merge in new driver from Intel, version 6.0.5. It adds support forglebius2006-08-036-803/+2792
| | | | | | | | | | | | | | | | | | 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.
* Prepending an mbuf after loading a DMA map results in unexpectedyongari2006-07-271-31/+28
| | | | result. So, modify mbuf chains before loading a DMA map.
* Nuke invalid use of BUS_DMA_ALLOCNOW.yongari2006-07-271-1/+1
|
* Make sure to use the same DMA map in DMA map load/unload operationsyongari2006-07-271-5/+8
| | | | | | | | | | by remembering a map used in bus_dmamap_load_mbuf_sg(9). I have no idea how it could ever worked before. This fixes a warning generated by a diagnostic check in sun4v iommu driver. Reported by: jb Tested by: jb(sun4v)
* Since resetting hardware takes a very long time and results in linkyongari2006-07-202-9/+30
| | | | | | | | | | | | | | | | | | | | | 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
* Protect EEPROM access with the driver lock.yongari2006-07-201-1/+2
|
* Honor IFF_DRV_OACTIVE in em_start_locked().yongari2006-07-201-0/+3
|
* The procedure of raceless switching between polling mode andglebius2006-06-061-105/+102
| | | | | | | | | | | | | | taskqueued interrupt mode is going to be quite complex. Since the polling mode is considered legacy feature for em(4) driver, the decision is made to make polling and new interrupt handler mutually exclusive, selected at compile time. If kernel is compiled with DEVICE_POLLING, the fast taskqueued interrupt handler code is disabled and the em_poll() and legacy em_intr() functions are enabled. Otherwise, legacy functions are disabled and only em_intr_fast() code is compiled. Discussed with: scottl
* Fix static array overrun.glebius2006-05-171-1/+1
| | | | | | | (This will be also fixed in next vendor release.) Coverity ID: 916 Reviewed by: Jack Vogel
* Bring back arm-specific workaround from rev 1.15:cognet2006-04-131-0/+2
| | | | | Do not use the IO-mapping to issue the reset on the 82546 on arm. For some reason, it results in corrupted descriptors.
* Restore accidentially removed rev. 1.3glebius2006-04-071-0/+2
|
* Merge in new driver from Intel, version 5.1.5. Adds support for someglebius2006-04-065-331/+1478
| | | | | | | | | | | | new chips and improves support for already supported ones. Some details, important for future merges: - if_em.c merged manually, viewing diff between new vendor driver and previous one. - 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 two liner change made, that restores support for two rare chips.
* Back out 1.112,1.113. I don't have enough resources to fix breakagesglebius2006-02-221-1/+7
| | | | introduced by this change.
* Fix fallout from last commit - we need to program the MAC address in em_init().glebius2006-02-151-0/+1
|
* em_hardware_init() in em_init() is not needed, and leads to annoyingglebius2006-02-151-7/+0
| | | | | | link flap. Submitted by: ru, Mike Tancsa
* Set ifp->if_baudrate according to current speed.glebius2006-02-151-2/+2
|
* - Rename em_print_link_status() to em_update_link_status().glebius2006-02-151-42/+9
| | | | | | | | | | - In em_attach() remove em_check_for_link(). Not needed here, since already done in em_hardware_init(). - In em_attach() replace the printing block with call to em_update_link_status(). - Remove modification of sc->link_state from em_hardware_init() and from em_media_status(). This makes em_update_link_status() a single point of change. Call em_update_link_status() where needed.
* - Second style(9) megacleanup.glebius2006-02-153-1773/+1628
| | | | | | - Rename "adapter" to "sc"/"softc", to be like other drivers. (-13 Kb less source code)
* Move includes from if_em.h to if_em.c and sort them.glebius2006-02-142-40/+37
|
* Fix two important typos in watchdog handling:glebius2006-02-091-2/+2
| | | | | | | | | | - Restart watchdog if we *did* processed any descriptors. [1] - Log the watchdog event if the link is *up*. [2] PR: kern/92948 [1] Submitted by: Mihail Balikov <mihail.balikov interbgc.com> [1] PR: kern/92895 [2] Submitted by: Vladimir Ivanov <wawa yandex-team.ru> [2]
* Since em(4) taskqueue is a new network context, we need to conditionallyglebius2006-02-071-1/+2
| | | | | | lock Giant here. Submitted by: Andrey V. Elsukov <bu7cher yandex.ru>
* Now that the em driver no longer needs to directly touch the scheduler, ↵scottl2006-02-041-3/+0
| | | | | | remove some unneeded headers.
* This driver can do hardware VLAN tagging + checksum offloading.glebius2006-01-301-2/+3
| | | | In collaboration with: Mihail Balikov <mihail.balikov interbgc.com>
OpenPOWER on IntegriCloud