summaryrefslogtreecommitdiffstats
path: root/sys/dev/nfe
Commit message (Collapse)AuthorAgeFilesLines
* Do a sweep of the tree replacing calls to pci_find_extcap() with calls tojhb2011-03-231-3/+3
| | | | pci_find_cap() instead.
* Reinitialize driver when MTU is changed and driver is running.yongari2011-01-241-1/+3
| | | | Reported by: Huang, Yusheng ( yusheng.huang <> bluecoat com )
* sysctl(9) cleanup checkpoint: amd64 GENERIC builds cleanly.mdf2011-01-121-1/+1
| | | | Commit the rest of the devices.
* Add a 'locked' variant of the foo_start() routine and call it directlyjhb2011-01-032-19/+12
| | | | | | | | from interrupt handlers and watchdog routines instead of queueing a task to call foo_start(). Reviewed by: yongari MFC after: 1 month
* MCP55 is the only NVIDIA controller that supports VLAN tagyongari2010-11-171-26/+31
| | | | | | | | | | | | | | insertion/stripping and it also supports TSO over VLAN. Implement TSO over VLAN support for MCP55 controller. While I'm here clean up SIOCSIFCAP ioctl handler. Since nfe(4) sets ifp capabilities based on various hardware flags in device attach, there is no need to check hardware flags again in SIOCSIFCAP ioctl handler. Also fix a bug which toggled both TX and RX checksum offloading even if user requested either TX or RX checksum configuration change. Tested by: Rob Farmer ( rfarmer <> predatorlabs dot net )
* Plug memory leakage introduced in r215327.yongari2010-11-151-4/+11
| | | | Submitted by: jkim
* P5N32-SLI PREMIUM from ASUSTeK is known to have MSI/MSI-X issueyongari2010-11-141-0/+43
| | | | | | | | | | | | | | | | | | | | | | such that nfe(4) does not work with MSI-X. When MSI-X support was introduced, I remember MCP55 controller worked without problems so the issue could be either PCI bridge or BIOS issue. But I also noticed snd_hda(4) disabled MSI on all MCP55 chipset so I'm still not sure this is generic issue of MCP55 chipset. If this was PCI bridge issue we would have added it to a system wide black-list table but it's not clear to me at this moment whether it was caused by either broken BIOS or silicon bug of MCP55 chipset. To workaround the issue, maintain a MSI/MSI-X black-list table in driver and lookup base board manufacturer and product name from the table before attempting to use MSI-X. If driver find an matching entry, nfe(4) will not use MSI/MSI-X and fall back on traditional INTx mode. This approach should be the last resort since it relies on smbios and if another instance of MSI/MSI-X breakage is reported with different maker/product, we may have to get the PCI bridge black-listed instead of adding an new entry. PR: kern/152150
* o Flesh out the generic IEEE 802.3 annex 31B full duplex flow controlmarius2010-11-141-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | support in mii(4): - Merge generic flow control advertisement (which can be enabled by passing by MIIF_DOPAUSE to mii_attach(9)) and parsing support from NetBSD into mii_physubr.c and ukphy_subr.c. Unlike as in NetBSD, IFM_FLOW isn't implemented as a global option via the "don't care mask" but instead as a media specific option this. This has the following advantages: o allows flow control advertisement with autonegotiation to be turned on and off via ifconfig(8) with the default typically being off (though MIIF_FORCEPAUSE has been added causing flow control to be always advertised, allowing to easily MFC this changes for drivers that previously used home-grown support for flow control that behaved that way without breaking POLA) o allows to deal with PHY drivers where flow control advertisement with manual selection doesn't work or at least isn't implemented, like it's the case with brgphy(4), e1000phy(4) and ip1000phy(4), by setting MIIF_NOMANPAUSE o the available combinations of media options are readily available from the `ifconfig -m` output - Add IFM_FLOW to IFM_SHARED_OPTION_DESCRIPTIONS and IFM_ETH_RXPAUSE and IFM_ETH_TXPAUSE to IFM_SUBTYPE_ETHERNET_OPTION_DESCRIPTIONS so these are understood by ifconfig(8). o Make the master/slave support in mii(4) actually usable: - Change IFM_ETH_MASTER from being implemented as a global option via the "don't care mask" to a media specific one as it actually is only applicable to IFM_1000_T to date. - Let mii_phy_setmedia() set GTCR_MAN_MS in IFM_1000_T slave mode to actually configure manually selected slave mode (like we also do in the PHY specific implementations). - Add IFM_ETH_MASTER to IFM_SUBTYPE_ETHERNET_OPTION_DESCRIPTIONS so it is understood by ifconfig(8). o Switch bge(4), bce(4), msk(4), nfe(4) and stge(4) along with brgphy(4), e1000phy(4) and ip1000phy(4) to use the generic flow control support instead of home-grown solutions via IFM_FLAGs. This includes changing these PHY drivers and smcphy(4) to no longer unconditionally advertise support for flow control but only if the selected media has IFM_FLOW set (or MIIF_FORCEPAUSE is set) and implemented for these media variants, i.e. typically only for copper. o Switch brgphy(4), ciphy(4), e1000phy(4) and ip1000phy(4) to report and set IFM_1000_T master mode via IFM_ETH_MASTER instead of via IFF_LINK0 and some IFM_FLAGn. o Switch brgphy(4) to add at least the the supported copper media based on the contents of the BMSR via mii_phy_add_media() instead of hardcoding them. The latter approach seems to have developed historically, besides causing unnecessary code duplication it was also undesirable because brgphy_mii_phy_auto() already based the capability advertisement on the contents of the BMSR though. o Let brgphy(4) set IFM_1000_T master mode on all supported PHY and not just BCM5701. Apparently this was a misinterpretation of a workaround in the Linux tg3 driver; BCM5701 seem to require RGPHY_1000CTL_MSE and BRGPHY_1000CTL_MSC to be set when configuring autonegotiation but this doesn't mean we can't set these as well on other PHYs for manual media selection. o Let ukphy_status() report IFM_1000_T master mode via IFM_ETH_MASTER so IFM_1000_T master mode support now is generally available with all PHY drivers. o Don't let e1000phy(4) set master/slave bits for IFM_1000_SX as it's not applicable there. Reviewed by: yongari (plus additional testing) Obtained from: NetBSD (partially), OpenBSD (partially) MFC after: 2 weeks
* Fix regression introduced in r215132. Caller always holds a driveryongari2010-11-121-4/+0
| | | | | | lock before accessing mii, so locking is not needed here. Reported by: Rob Farmer (rfarmer <> predatorlabs dot net)
* Add basic WOL support for MCP ethernet controllers. It seems theyongari2010-11-113-56/+175
| | | | | | | | | | | | controller does not perform automatic switching from 1000Mbps link to 10/100Mbps link when WOL is activated. Implement establishing 10/100Mps link with auto-negotiation in driver. Link status change handler was modified to remove taskqueue based approach since driver now needs synchronous handling for link establishment. Submitted by: Yamagi Burmeister (lists <> yamagi.org ) (initial version) Tested by: Yamagi Burmeister (lists <> yamagi.org ) MFC after: 1 week
* Converted the remainder of the NIC drivers to use the mii_attach()marius2010-10-151-4/+4
| | | | | | | introduced in r213878 instead of mii_phy_probe(). Unlike r213893 these are only straight forward conversions though. Reviewed by: yongari
* With r206844, CSUM_TCP is also set for CSUM_TSO case. Modifyyongari2010-04-191-7/+6
| | | | | drivers to take into account for the change. Basically CSUM_TSO should be checked before checking CSUM_TCP.
* Take a step towards removing if_watchdog/if_timer. Don't explicitly setjhb2009-11-061-1/+0
| | | | | if_watchdog/if_timer to NULL/0 when initializing an ifnet. if_alloc() sets those members to NULL/0 already.
* Use if_maddr_rlock()/if_maddr_runlock() rather than IF_ADDR_LOCK()/rwatson2009-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
* When user_frac in the polling subsystem is low it is going to busy theattilio2009-05-301-13/+23
| | | | | | | | | | | | | | | | | | | | | CPU for too long period than necessary. Additively, interfaces are kept polled (in the tick) even if no more packets are available. In order to avoid such situations a new generic mechanism can be implemented in proactive way, keeping track of the time spent on any packet and fragmenting the time for any tick, stopping the processing as soon as possible. In order to implement such mechanism, the polling handler needs to change, returning the number of packets processed. While the intended logic is not part of this patch, the polling KPI is broken by this commit, adding an int return value and the new flag IFCAP_POLLING_NOCOUNT (which will signal that the return value is meaningless for the installed handler and checking should be skipped). Bump __FreeBSD_version in order to signal such situation. Reviewed by: emaste Sponsored by: Sandvine Incorporated
* NVIDIA MCP controllers have no Rx buffer alignment restrictions.yongari2009-05-251-1/+1
| | | | | | | | | | Remove PAGE_SIZE alignment used in Rx buffer DMA tag creation. The alignment restriction was used in old local jumbo allocator and nfe(4) switched to UMA backed page allocator for jumbo frame. This change should fix jumbo buffer allocation failure. Reported by: Pascal Braun ( pascal.braun <> continum dot net )
* Fix a typo.yongari2008-12-201-1/+1
| | | | Submitted by: clemens fischer via Shigeaki Tagashira
* Add hardware MAC statistics support. Register information wasyongari2008-10-033-25/+287
| | | | | | | | obtained from Linux forcedeth driver. While I'm here move creating a sysctl node for process_limit to function nfe_sysctl_node(). Tested by: "Arno J. Klaassen" < arno <at> heho dot snv dot jussieu dot fr >
* Add device ids for MCP77/79 and set appropriate support flags.yongari2008-10-012-0/+40
| | | | | Obtained from: OpenBSD PR: kern/127529
* Add support for MCP73 chips.yongari2008-04-102-0/+16
| | | | | Tested by: "Daan Vreeken [PA4DAN]" ( Danovitsch AT vitsch DOT net ) MFC after: 1 week
* Nuke local jumbo allocator and switch to use of UMA backed pageyongari2008-03-063-185/+6
| | | | | | | | allocator for jumbo frame. Also remove unneeded jlist lock which is no longer required to protect jumbo buffers. With these changes jumbo frame performance of nfe(4) was slightly increased and users should not encounter jumbo buffer allocation failure anymore.
* Give MEXTADD() another argument to make both void pointers to thephk2008-02-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | free function controlable, instead of passing the KVA of the buffer storage as the first argument. Fix all conventional users of the API to pass the KVA of the buffer as the first argument, to make this a no-op commit. Likely break the only non-convetional user of the API, after informing the relevant committer. Update the mbuf(9) manual page, which was already out of sync on this point. Bump __FreeBSD_version to 800016 as there is no way to tell how many arguments a CPP macro needs any other way. This paves the way for giving sendfile(9) a way to wait for the passed storage to have been accessed before returning. This does not affect the memory layout or size of mbufs. Parental oversight by: sam and rwatson. No MFC is anticipated.
* - Retire npe_defrag(), gem_defrag(), msk_defrag(), nfe_defrag(), andjhb2008-01-171-89/+1
| | | | | | re_defrag() and use m_collapse() instead. - Replace a reference to ath_defrag() in a comment in if_wpi.c with m_collapse().
* Fix function prototype for device_shutdown method.yongari2007-11-221-2/+4
|
* use the private task q thread instead of the shared system threadsam2007-11-161-6/+5
| | | | | Reviewed by: yongari MFC after: 1 week
* Apparently some NVIDIA NICs store ethernet address in reverse orderyongari2007-11-061-2/+2
| | | | | | | | | | while other variants have inorder ethernet address for the same chipset. Override ethernet address ordering if we already know how it was stored. This fixes the use of inversed ethernet address on MCP67. Submitted by: ariff MFC after: 3 days
* During boot(before setting IP address) PHY can generate link stateyongari2007-09-141-6/+6
| | | | | | | | | | | | change interrupt if the link is established with link parter. However interrupt handler didn't acknowledge the interrupt if nfe(4) was not running at the time of interrupt delivery. This caused endless interrupt generation. Fix the bug by acknowledging the interrupt regardless of running state of the driver. PR: kern/116295 Submitted by: Mark Derbyshire (mark At taom dot com) Approved by: re (kensmith)
* Fix typo.yongari2007-09-141-2/+2
| | | | | Pointed out: marius Approved by: re (bmah)
* Don't fail on device attach if jumbo frame support was unsuccessful.yongari2007-07-242-9/+26
| | | | | | | | | | | | | Because nfe(4) hardware doesn't support SG on Rx path, supporting jumbo frame requires very large contiguous kernel memory(i.e. several mega bytes). In case of lack of contiguous kernel memory that allocation request may always fail. However nfe(4) can operate on normal sized MTU frames, so go ahead and just disable jumbo frame support. While I'm here add a new tunable "hw.nfe.jumbo_disable" to disable jumbo frame support. In nfe_poll, make sure to invoke correct Rx handler. Approved by: re (kensmith)
* The maximum size of the sum of all segment lengths in a given DMA mappingyongari2007-06-121-1/+1
| | | | | | should be 65535 + link layer headers. Pointed out by: gallatin
* Increase a maximum segment size of DMA to 4096. Previously it usedyongari2007-06-122-2/+4
| | | | | | | | MCLBYTES for the segment size but it used too many Tx descriptors in TSO case. While I'm here adjust maximum size of the sum of all segment lengths in a given DMA mapping to 65535, the maximum size, in bytes, of a IP packet.
* Bring overhauled nfe(4) into tree.yongari2007-06-123-909/+2103
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | o s/printf/device_printf/g o Nuke OpenBSDism. o Nuke NetBSD/OpenBSD specific DMA sync operations.(we don't have a way to sync a single descriptor within a DMA map.) o Remove recursive mutex. o bus_dma(9) clean up. o 40bit DMA address support. o Add protection for Rx map load failure. o Fix a long standing bug for watchdog timeout. [1] o Add additional protections, missing Tx completion interrupt, losing start Tx command, for watchdog timeout. o Switch to taskqueue(9) API to handle interrupts. o Use our own timer for watchdog instead of if_watchdog/if_timer interface. o Advertise VLAN header length/capability correctly to upper layer. o Remove excessive kernel stack consumption in nfe_encap(). o Handle highly fragmented mbuf chains correctly. o Enable etherenet address reprogramming with ifconfig(8). o Add ALTQ/TSO, MSI/MSIX support. o Increased Rx ring to 256 descriptors from 128. o Align Tx/Rx descriptor ring on sizeof(struct nfe_desc64) boundary. o Remove alignment restrictions on Tx/Rx buffers. o Rewritten jumbo frame support code. o Add support for hardware assistend VLAN tag insertion/stripping. o Add support for Tx/Rx flow control based on patches from Peer Chen. [2] o Add a routine that detects whether ethernet address swap routines is required. [3] o Add a workaround that take MAC/PHY out of power down mode. o Add suspend/resume support. o style(9) and code clean up. Special thanks to Shigeaki Tagashira, the original porter of nfe(4), who submitted lots of patches, performed uncountable number of regression tests and maintained nfe(4) for a long time. Without his enthusiastic help and support I could never have completed this overhauling task. The only weak point of nfe(4) compared to nve(4) is instability of manual half-duplex media selection on certain hardwares(auto sensing media type should work for all cases, though). This was a long standing bug of nfe(4) and I still have no idea why it doesn't work on some hardwares. Obtained from: OpenBSD [1] Submitted by: Peer Chen < pchen at nvidia dot com > [2], [3] Reviewed by: Shigeaki Tagashira < shigeaki AT se DOT hiroshima-u DOT ac DOT jp > Tested by: Shigeaki Tagashira, current Discussed with: current Silence from: obrien
* Catch up the rest of the drivers with the ether_vlan_mtap modifications.csjp2007-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
* o break newbus api: add a new argument of type driver_filter_t topiso2007-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@
* Fix TX/RX checksum offload.obrien2006-11-272-16/+21
| | | | Submitted by: Peer Chen at nVIDIA
* Reformat to KNF after revision 1.12.obrien2006-11-271-85/+81
|
* Fix the jumbo frame support.obrien2006-11-273-209/+63
| | | | Submitted by: Peer Chen at nVIDIA (reworked by me)
* Grrr. new .vimrc file is really giving me trouble.. get the whitespace right.obrien2006-11-271-2/+2
|
* Fix editor fatfingering in rev 1.9.obrien2006-11-271-2/+2
|
* nfe_stop() requires lock to be held when calling.obrien2006-11-261-0/+2
|
* Missed two nits in rev 1.7.obrien2006-11-171-2/+2
|
* style(9)obrien2006-10-191-153/+153
|
* style(9) cleanup.obrien2006-10-191-243/+332
|
* Correct the WOL magic value.obrien2006-10-161-1/+1
| | | | Submitted by: Peer Chen at nVIDIA
* Try to be more precise in identifying the various nForce networking adapters.obrien2006-10-161-14/+14
|
* Move ethernet VLAN tags from mtags to its own mbuf packet header fieldandre2006-09-171-16/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Add support for MCP61 and MCP65 adaptors.obrien2006-09-112-0/+36
| | | | Submitted by: Peer Chen at nVIDIA
* Fix alignment of RX bufs DMA map to be realistic. Maybe it works onru2006-08-141-2/+2
| | | | | | | | | i386 (I don't know) but on amd64 at hand here, it paniced early at boot. (I'm pretty sure that PAGE_SIZE here was miscopied from another place during porting, where in OpenBSD bus_dmamem_alloc() is used, but there PAGE_SIZE means completely different thing.)
* Add a pure open source nForce Ethernet driver, under BSDL.obrien2006-06-263-999/+1484
| | | | | | | | | This driver was ported from OpenBSD by Shigeaki Tagashira <shigeaki@se.hiroshima-u.ac.jp> and posted at http://www.se.hiroshima-u.ac.jp/~shigeaki/software/freebsd-nfe.html It was additionally cleaned up by me. It is still a work-in-progress and thus is purposefully not in GENERIC. And it conflicts with nve(4), so only one should be loaded.
* Import the nfe (nForce Ethernet) driver from OpenBSD.obrien2006-06-263-0/+2009
This is a pure open source NIC driver with a BSD license. These bits were taken from the OpenBSD public CVS repository on 1-May-06.
OpenPOWER on IntegriCloud