summaryrefslogtreecommitdiffstats
path: root/sys/dev/msk
Commit message (Collapse)AuthorAgeFilesLines
* Add hardware MAC statistics support. Also added some reservedyongari2009-01-162-9/+354
| | | | | | statistics register definition. Users can get current MAC statistics from dev.msk.%d.stats sysctl node(%d is unit number of a device).
* Remove local jumbo locator and switch to UMA backed page allocatoryongari2009-01-142-302/+159
| | | | | | | | | | | | | | | | | | | | | for jumbo frame. o Nuke unneeded jlist lock which was used to protect jumbo buffer management in local allocator. o Added a new tunable hw.mskc.jumbo_disable to disable jumbo frame support for the driver. The tunable could be set for systems that do not need to use jumbo frames and it would save (9K * number of Rx descriptors) bytes kernel memory. o Jumbo buffer allocation failure is no longer critical error for the operation of msk(4). If msk(4) encounter the allocation failure it just disables jumbo frame support and continues to work without your intervention. Using local allocator had several drawbacks such as requirement of large amount of continuous kernel memory and fixed (small) number of available buffers. The need for large continuous memory resulted in failure of loading driver with kldload on running systems. Also small number of buffer used in local allocator showed poor performance for some applications.
* Correct frame length argument of in_cksum_skip. While I'm hereyongari2009-01-141-5/+2
| | | | | | | remove intermediate variable csum. Reported by: Kim Culhan < w8hdkim <> gmail DOT com > Tested by: Kim Culhan < w8hdkim <> gmail DOT com >
* Save the value read from TX queue CSR, so we don't test against ayongari2008-11-241-1/+1
| | | | | | stale one. Submitted by: sephe
* If mbuf is not writable get a writable copy before invokingyongari2008-09-301-1/+10
| | | | | | m_pullup(9). Tested by: Garrett Cooper < yanefbsd <at> gmail dot com >
* Always pullup mbuf prior to accessing TCP header.yongari2008-09-301-0/+5
| | | | | | | This should fix occasional Tx checksum corruption issue. Reported by: Garrett Cooper < yanefbsd <at> gmail dot com > Tested by: Garrett Cooper < yanefbsd <at> gmail dot com >
* Add another hardware bug workaround for Yukon II controllers thatyongari2008-09-252-7/+62
| | | | | | | | | | | | | | | have hardware ram buffer. The silicon bug seem to be triggered by pause frames if receive buffer is not aligned on FIFO word(8 bytes). To workaround the issue, make sure to align Rx buffers on 8 bytes. Unfortunately this workaround requires yet another Rx fixup for strict alignment architecture machines to align IP header. For newer hardwares that lacks ram buffer may not have this bug so check number of available ram buffer size to see the existence of ram buffer. Reported by: Ian Freislich (ianf <at> clue dot co dot za), das Tested by: Ian Freislich (ianf <at> clue dot co dot za)
* Move comments block 1 line up to remark on the settingyongari2008-03-111-2/+2
| | | | | | if_capabilities. This would make comments clear. Suggested by: yar
* To overcome hardware checksum offload bug msk(4) used to computeyongari2008-03-071-2/+6
| | | | | | | | | | | | TCP/UDP checksum in driver for short frames. For frames that requires hardware VLAN tag insertion, the checksum offload trick does not work due to changes of checksum offset in mbuf after the VLAN tag. Disable hardware checksum offload for VLAN interface to fix the bug. Reported by: Christopher Cowart < ccowart AT rescomp DOT berkeley DOT edu > Tested by: Christopher Cowart < ccowart AT rescomp DOT berkeley DOT edu > MFC after: 5 days
* Workaround GMAC hardware hang of Yukon II on the receipt of pauseyongari2008-02-292-2/+6
| | | | | | | | | | | frames. This bug seems to happen on certain hardware model/revision (e.g. 88E8053) but it's not identified which hardwares are affected. Revision 1.4 of if_mskreg.h was not enough to workaround the bug. To workaround it, inrease GMAC FIFO threshold by one FIFO word to flush received pause frames. Reported by: das, Kirill Nuzhdin < kirill.nuzhdin AT rad dot chem dot msu dot ru > Tested by: das, Kirill Nuzhdin
* Give MEXTADD() another argument to make both void pointers to thephk2008-02-011-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | 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-88/+1
| | | | | | re_defrag() and use m_collapse() instead. - Replace a reference to ath_defrag() in a comment in if_wpi.c with m_collapse().
* Bring in support for: Marvell Yukon 8039remko2007-12-052-0/+3
| | | | | | | PR: 118401 Submitted by: Skip Ford <skip at menantico dot com> Approved by: imp (mentor), yongari MFC After: 3 days
* Fix function prototype for device_shutdown method.yongari2007-11-221-2/+3
|
* Add MSI support for 88E8058(Yukon EC Ultra). Unlike other Yukon IIyongari2007-11-211-8/+27
| | | | | | | family 88E8058 supports only one MSI message. Teach msk(4) to handle that case. Tested by: Ed Schouten < ed AT fxq DOT nl >
* Add device id for 88E8058(Yukon EC Ultra) which is found on 3rdyongari2007-11-202-0/+3
| | | | | | | | generation MacBooks. Unfortunately 88E8058 supports one MSI message so msk(4) needs more generic way to handle the MSI capability. PR: 118110
* Make phy respond only at address 0. This makes phy driver attachedyongari2007-11-202-22/+16
| | | | | | | | | | | | | | | | only at address 0 which is supposed to be the only valid phy address on Marvell PHY. The more correct solution would be masking PHY address ranges allowable in PHY probe routine. Unfortunately, FreeBSD has no way to retrict the PHY address ranges or to pass special flags to PHY driver. This change assumes that PHY hardwares attached to msk(4) would be Marvell made 88E11xx PHY. With this changes the phantom phys attached on 88E8036(Yukon FE) should disappear. Reported by: Oleg Lomaka < oleg AT lomaka DOT org DOT ua > Tested by: Oleg Lomaka < oleg AT lomaka DOT org DOT ua >
* o Don't hardcode that Yukon FE has 16KB SRAM. In fact, Yukon FE hasyongari2007-11-201-38/+12
| | | | | | | | | | | only 4KB SRAM. o Rework setting Tx/Rx RAM buffer size. Give receiver 2/3 of memory and round it down to the multiple of 1024. The RAM buffer size of Yukon II should be multiple of 1024. This fixes bogus RAM buffer configuration used in Yukon FE. Reported by: Oleg Lomaka < oleg AT lomaka DOT org DOT ua > Tested by: Oleg Lomaka < oleg AT lomaka DOT org DOT ua >
* Drop maintaing hardware feature(bug) lists for Yukon II. We don't haveyongari2007-11-202-88/+8
| | | | | | | | | | publicly available datasheet for Yukon II and don't know what bug/workaround exist for the specific hardware revision. Also I don't think the vendor will release hardware errata in near future. The hardware feature lists were not used at all except setting water mark registers. Since msk(4) should know exact chip model/revision number to decide which hardware capability could be used the extra feature lists were redundant.
* Various fixes for EC Ultra.yongari2007-11-202-19/+37
| | | | | | | | | | | | | o Enable jumbo frame support for EC Ultra and disable jumbo frame for FE. o Enable store and forward mode for standard MTU sized frame. o Enable TSO for EC Ultra. However TSO/checksum offload is disabled for jumbo frame case. Because EC Ultra can't use store and forward mode for jumbo frame TSO/checksum offload is not available. o Adjust Tx GMAC almost empty threshold value and add a jumbo frame water mark. The maic value was obtained from Marvell's sk98lin driver. o Fix EC Ultra chip revision number.
* Add legacy interrupt handler which would be more appropriate foryongari2007-07-201-9/+90
| | | | | | | | | | | | | interrupt that is shared with other devices(e.g. USB) in system and provide a new tunable "hw.msk.legacy_intr" to activate the legacy interrupt handler. Setting the tunable automatically disables MSI for msk(4). Previously msk(4) used adoptive polling with taskqueue(9) as all msk(4) hardwares I know supports MSI. However, there are cases that MSI couldn't be used on some hardwares due to bugs in MSI implementatins. Tested by: Li-Lun Wang < llwang AT infor DOT org > 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-112-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.
* Disable automatic IP ID increment. Due to a hardware bug the automaticyongari2007-06-111-15/+0
| | | | | IP ID increment in TSO case generated corrupted IP packets. This change brings back TSO capability.
* Work around GMAC hardware hang bug.yongari2007-04-251-1/+0
| | | | | | | | It seems that valid pause frames(Tx flow control) cause GMAC to hang such that it resulted in watchdog timeout. As a work around don't flush Rx MAC FIFO if we've received pause frames. Tested by: Harald Schmalzbauer (h DOT schmalzbauer AT omnisec DOT de)
* Disable TSO support.yongari2007-04-251-0/+8
| | | | | | | | | | | | Under certain circumtances, if TSO is active, Yukon II generates corrupted IP packets. All corrupted IP packets I noticed were the the last segmented packet in a TSO request. The corrupted packet resulted in retransmission of the damaged packet which in turn decreased network performance dramatically. Unfortunately it seems that there is no way to workaround this bug as TSO is completely handled in hardware. Disable TSO until we find a working workaround or a new silicon revision that doesn't have this hardware bug.
* Fix TCP header size calculation logic which is used for settingyongari2007-04-251-1/+1
| | | | TSO MTU.
* Add work around for hardware Tx checksum offload bug in Yukon II.yongari2007-04-111-5/+25
| | | | | | | | | | | | | | | Yukon II generated corrupted TCP checksum for short TCP packets that's less than 60 bytes in size(e.g. window probe packet, pure ACK packet etc). Padding the frame with zeros to make the frame minimum ethernet frame size didn't work at all. Instead of dropping Tx checksum offload support we calculate TCP checksum with S/W method when we encounter short TCP frames. Fortunately it seems that short UDP datagrams appear to be handled correctly by Yukon II. While I'm here simplify ethernet/VLAN header size calculation logic. PR: 111384
* If we've encountered unrecognized chipset don't access hardwareyongari2007-04-061-2/+2
| | | | | | | | | anymore. Previously it tried to access interrupt register to disable interrupts which could result in hang if the hardware was not properly initialized by system BIOS/ACPI. Tested by: Benjamin Hansmann (benjamin.hansmann AT rub dot de) MFC after: 3 days
* 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-4/+5
| | | | | | | | | | | | | 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@
* Unbreak non-H/W VLAN extraction case.yongari2007-02-151-2/+4
| | | | | | | | | | | | Unlike other GigEs Yukon II always set VLAN bit when it detects VLAN tagged packet regardless of H/W VLAN processing configuration state. So it need to check IFCAP_VLAN_HWTAGGING bit to know whether driver is configured to take advantage of H/W VLAN processing. If H/W VLAN processing was disabled don't adjust received packet length such that subsequent validation logic works for software VLAN processing. Reported by: bms Tested by: bms
* Remove duplicated legacy SYS_RES_IRQ resources assignment.yongari2007-01-091-3/+1
| | | | Noticed by: jhb
* Fix a typo which blindly enabled TSO capability without respect toyongari2007-01-081-1/+1
| | | | chip type.
* Don't rely on GM_GP_CTRL register contents when mii(4) layer reportsyongari2007-01-081-19/+14
| | | | | | | | | | | link state changes. Instead, build new speed/duplex/flow-control settings from the values reported from PHY. This should fix speed/duplex/flow-control mismatches between GMAC and PHY which resulted in very poor Rx performance due to lots of out-of-order packet delivery. Reported by: Arno J. Klaassen <arno AT heho DOT snv DOT jussieu DOT fr> Tested by: Arno J. Klaassen <arno AT heho DOT snv DOT jussieu DOT fr>
* Initialize legacy SYS_RES_IRQ resources before attempting to use MSI.yongari2007-01-081-0/+1
| | | | | | | | This fixes legacy SYS_RES_IRQ resource allocation failure when MSI is disabled. Reported by: rrs Tested by: rrs
* Piggyback watchdog timer handling with msk_tick which is called everyyongari2006-12-292-13/+9
| | | | | hz. This will result in slightly faster Tx processing as it does not need lock operations for callouts in msk_start/msk_txeof.
* Fix interrupt handling on a dual port card. Previously it ignoredyongari2006-12-291-10/+6
| | | | | | | the second port interrupt if the first port was in down state. Since I don't have a dual port card it's just guess work. Noticed by: jhb
* Fix MSI support. Now it correctly allocates SYS_RES_IRQ resourcesyongari2006-12-292-27/+55
| | | | | | | on Yukon II which reports it can handle two messages. Submitted by: jhb Tested by: bms
* Add msk(4), a driver for Marvell/SysKonnect Yukon II Gigabit Ethernetyongari2006-12-132-0/+6444
controller. Due to lack of documentation, this driver is based on the code from sk(4) and Marvell's myk(4) driver for FreeBSD. I've also adopted the OpenBSD interface name, msk(4) in order to reduce naming differences between BSDs. The msk(4) driver supports the following Gigabit Ethernet adapters. o SysKonnect SK-9Sxx Gigabit Ethernet o SysKonnect SK-9Exx Gigabit Ethernet o Marvell Yukon 88E8021CU Gigabit Ethernet o Marvell Yukon 88E8021 SX/LX Gigabit Ethernet o Marvell Yukon 88E8022CU Gigabit Ethernet o Marvell Yukon 88E8022 SX/LX Gigabit Ethernet o Marvell Yukon 88E8061CU Gigabit Ethernet o Marvell Yukon 88E8061 SX/LX Gigabit Ethernet o Marvell Yukon 88E8062CU Gigabit Ethernet o Marvell Yukon 88E8062 SX/LX Gigabit Ethernet o Marvell Yukon 88E8035 Gigabit Ethernet o Marvell Yukon 88E8036 Gigabit Ethernet o Marvell Yukon 88E8038 Gigabit Ethernet o Marvell Yukon 88E8050 Gigabit Ethernet o Marvell Yukon 88E8052 Gigabit Ethernet o Marvell Yukon 88E8053 Gigabit Ethernet o Marvell Yukon 88E8055 Gigabit Ethernet o Marvell Yukon 88E8056 Gigabit Ethernet o D-Link 550SX Gigabit Ethernet o D-Link 560T Gigabit Ethernet Unlike OpenBSD/NetBSD msk(4), the msk(4) driver supports all hardware features including TCP/UDP checksum offload for transmit, MSI, TCP segmentation offload(TSO), hardware VLAN tag stripping/insertion, and jumbo frames(up to 9022 bytes). The only unsupported hardware feature except RLMT is Rx checksum offload which I don't know how to make it work reliably. Known Issues: It seems msk(4) does not work on the second port of dual port NIC. (The first port works without problems.) Thanks to Marvell for releasing the BSD licensed myk(4) driver and thanks to all users helped fixing bugs. Tested by: bz, philip, bms, YAMAMOTO Shigeru < shigeru AT iij DOT ad DOT jp >, Dmitry Pryanishnikov < dmitry AT atlantis DOT dp DOT ua >, Jia-Shiun Li < jiashiun AT gmail DOT com >, David Duchscher < daved AT tamu DOT edu >, Arno J. Klaassen < arno AT heho DOT snv DOT jussieu DOT fr>, Nicolae Namolovan < adrenalinup AT gmail DOT com>, Andre Guibert de Bruet < andy AT siliconlandmark DOT com > current ML Tested on: i386, amd64
OpenPOWER on IntegriCloud