summaryrefslogtreecommitdiff
path: root/sys/dev/sk
Commit message (Collapse)AuthorAgeFilesLines
* hme(4): Remove as previous announcedBrooks Davis2020-12-111-3/+1
| | | | | | | | | | | | The hme (Happy Meal Ethernet) driver was the onboard NIC in most supported sparc64 platforms. A few PCI NICs do exist, but we have seen no evidence of use on non-sparc systems. Reviewed by: imp, emaste, bcr Sponsored by: DARPA Notes: svn path=/head/; revision=368559
* sk: clean up empty lines in .c and .h filesMateusz Guzik2020-09-012-4/+1
| | | | Notes: svn path=/head/; revision=365155
* Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many)Pawel Biernacki2020-02-261-1/+2
| | | | | | | | | | | | | | | | | | | r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that are still not MPSAFE (or already are but aren’t properly marked). Use it in preparation for a general review of all nodes. This is non-functional change that adds annotations to SYSCTL_NODE and SYSCTL_PROC nodes using one of the soon-to-be-required flags. Mark all obvious cases as MPSAFE. All entries that haven't been marked as MPSAFE before are by default marked as NEEDGIANT Approved by: kib (mentor, blanket) Commented by: kib, gallatin, melifaro Differential Revision: https://reviews.freebsd.org/D23718 Notes: svn path=/head/; revision=358333
* Convert to if_foreach_llmaddr() KPI.Gleb Smirnoff2019-10-211-59/+62
| | | | Notes: svn path=/head/; revision=353827
* Use https over http for FreeBSD pagesEitan Adler2018-07-271-1/+1
| | | | Notes: svn path=/head/; revision=336757
* ifnet: Replace if_addr_lock rwlock with epoch + mutexMatt Macy2018-05-181-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Run on LLNW canaries and tested by pho@ gallatin: Using a 14-core, 28-HTT single socket E5-2697 v3 with a 40GbE MLX5 based ConnectX 4-LX NIC, I see an almost 12% improvement in received packet rate, and a larger improvement in bytes delivered all the way to userspace. When the host receiving 64 streams of netperf -H $DUT -t UDP_STREAM -- -m 1, I see, using nstat -I mce0 1 before the patch: InMpps OMpps InGbs OGbs err TCP Est %CPU syscalls csw irq GBfree 4.98 0.00 4.42 0.00 4235592 33 83.80 4720653 2149771 1235 247.32 4.73 0.00 4.20 0.00 4025260 33 82.99 4724900 2139833 1204 247.32 4.72 0.00 4.20 0.00 4035252 33 82.14 4719162 2132023 1264 247.32 4.71 0.00 4.21 0.00 4073206 33 83.68 4744973 2123317 1347 247.32 4.72 0.00 4.21 0.00 4061118 33 80.82 4713615 2188091 1490 247.32 4.72 0.00 4.21 0.00 4051675 33 85.29 4727399 2109011 1205 247.32 4.73 0.00 4.21 0.00 4039056 33 84.65 4724735 2102603 1053 247.32 After the patch InMpps OMpps InGbs OGbs err TCP Est %CPU syscalls csw irq GBfree 5.43 0.00 4.20 0.00 3313143 33 84.96 5434214 1900162 2656 245.51 5.43 0.00 4.20 0.00 3308527 33 85.24 5439695 1809382 2521 245.51 5.42 0.00 4.19 0.00 3316778 33 87.54 5416028 1805835 2256 245.51 5.42 0.00 4.19 0.00 3317673 33 90.44 5426044 1763056 2332 245.51 5.42 0.00 4.19 0.00 3314839 33 88.11 5435732 1792218 2499 245.52 5.44 0.00 4.19 0.00 3293228 33 91.84 5426301 1668597 2121 245.52 Similarly, netperf reports 230Mb/s before the patch, and 270Mb/s after the patch Reviewed by: gallatin Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D15366 Notes: svn path=/head/; revision=333813
* spdx: initial adoption of licensing ID tags.Pedro F. Giffuni2017-11-183-0/+6
| | | | | | | | | | | | | | | | | | | | The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point. Initially, only tag files that use BSD 4-Clause "Original" license. RelNotes: yes Differential Revision: https://reviews.freebsd.org/D13133 Notes: svn path=/head/; revision=325966
* Update several more URLsEitan Adler2017-10-291-1/+1
| | | | | | | | - Primarily http -> https - Primarily FreeBSD project URLs Notes: svn path=/head/; revision=325096
* sys/dev: minor spelling fixes.Pedro F. Giffuni2016-05-032-2/+2
| | | | | | | Most affect comments, very few have user-visible effects. Notes: svn path=/head/; revision=298955
* ifnet lock was changed to use sx(9) long time ago.Pyun YongHyeon2016-02-221-2/+2
| | | | | | | Don't hold a driver lock for if_free(9). Notes: svn path=/head/; revision=295873
* Eliminate unnecessary checking for M_EXT on mbufs returned by m_getjcl().Robert Watson2014-10-131-4/+0
| | | | | | | | | | Reviewed by: bz, glebius, yongari MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D938 Notes: svn path=/head/; revision=273028
* Mechanically convert to if_inc_counter().Gleb Smirnoff2014-09-191-8/+8
| | | | Notes: svn path=/head/; revision=271849
* Use define from if_var.h to access a field inside struct if_data,Gleb Smirnoff2014-08-301-1/+1
| | | | | | | | | that resides in struct ifnet. Sponsored by: Nginx, Inc. Notes: svn path=/head/; revision=270856
* Fix various NIC drivers to properly cleanup static DMA resources.John Baldwin2014-06-111-12/+9
| | | | | | | | | | | | | | | | | | In particular, don't check the value of the bus_dma map against NULL to determine if either bus_dmamem_alloc() or bus_dmamap_load() succeeded. Instead, assume that bus_dmamap_load() succeeeded (and thus that bus_dmamap_unload() should be called) if the bus address for a resource is non-zero, and assume that bus_dmamem_alloc() succeeded (and thus that bus_dmamem_free() should be called) if the virtual address for a resource is not NULL. In many cases these bugs could result in leaks when a driver was detached. Reviewed by: yongari MFC after: 2 weeks Notes: svn path=/head/; revision=267363
* Remove some unused variables.Christian Brueffer2014-05-161-2/+0
| | | | | | | | Found with: Clang Static Analyzer MFC after: 2 weeks Notes: svn path=/head/; revision=266270
* Remove superfluous old-style rcsid[] from if_sk.c. There is already anDimitry Andric2013-12-281-5/+0
| | | | | | | | | __FBSDID() at the top of the file. MFC after: 3 days Notes: svn path=/head/; revision=260016
* The r48589 promised to remove implicit inclusion of if_var.h soon. PrepareGleb Smirnoff2013-10-261-0/+1
| | | | | | | | | | | to this event, adding if_var.h to files that do need it. Also, include all includes that now are included due to implicit pollution via if_var.h Sponsored by: Netflix Sponsored by: Nginx, Inc. Notes: svn path=/head/; revision=257176
* - Merge from r249476: Ensure that PCI bus BUS_GET_DMA_TAG() method seesMarius Strobl2013-05-302-7/+17
| | | | | | | | | | | | | the actual PCI device which makes the request for DMA tag, instead of some descendant of the PCI device, by creating a pass-through trampoline. - Sprinkle const on tables. - Use NULL instead of 0 for pointers. - Take advantage of nitems(). MFC after: 1 week Notes: svn path=/head/; revision=251133
* Mechanically substitute flags from historic mbuf allocator withGleb Smirnoff2012-12-041-3/+3
| | | | | | | malloc(9) flags in sys/dev. Notes: svn path=/head/; revision=243857
* ether_ifattach() sets if_mtu to ETHERMTU, don't bother set it againKevin Lo2012-01-071-1/+0
| | | | | | | Reviewed by: yongari Notes: svn path=/head/; revision=229767
* - There's no need to overwrite the default device method with the defaultMarius Strobl2011-11-221-10/+2
| | | | | | | | | | | | | one. Interestingly, these are actually the default for quite some time (bus_generic_driver_added(9) since r52045 and bus_generic_print_child(9) since r52045) but even recently added device drivers do this unnecessarily. Discussed with: jhb, marcel - While at it, use DEVMETHOD_END. Discussed with: jhb - Also while at it, use __FBSDID. Notes: svn path=/head/; revision=227843
* Allocate the DMA memory shared between the host and the controller asMarius Strobl2011-03-111-6/+7
| | | | | | | | | coherent. MFC after: 2 weeks Notes: svn path=/head/; revision=219544
* Fix a long standing bug in programming station address for YukonPyun YongHyeon2010-11-061-12/+13
| | | | | | | | | | | | | | | | controllers. sk(4) never reprogrammed station address for Yukon controllers so overriding station address with ifconfig(8) was not possible. Fix the bug by reprogramming all registers that control station address, flow-control and virtual station address. Virtual station address has no use at this moment since driver does not make use of fail over feature. Tested by: "Mikhail T." <mi+thun <> aldan.algebra.com> MFC after: 1 week Notes: svn path=/head/; revision=214899
* If we got an invalid station address, generate random address. ThisPyun YongHyeon2010-11-061-0/+19
| | | | | | | | | | might be caused by broken BIOS. Reported by: "Mikhail T." <mi+thun <> aldan.algebra.com> MFC after: 1 week Notes: svn path=/head/; revision=214898
* Convert the PHY drivers to honor the mii_flags passed down and convertMarius Strobl2010-10-151-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | the NIC drivers as well as the PHY drivers to take advantage of the mii_attach() introduced in r213878 to get rid of certain hacks. For the most part these were: - Artificially limiting miibus_{read,write}reg methods to certain PHY addresses; we now let mii_attach() only probe the PHY at the desired address(es) instead. - PHY drivers setting MIIF_* flags based on the NIC driver they hang off from, partly even based on grabbing and using the softc of the parent; we now pass these flags down from the NIC to the PHY drivers via mii_attach(). This got us rid of all such hacks except those of brgphy() in combination with bce(4) and bge(4), which is way beyond what can be expressed with simple flags. While at it, I took the opportunity to change the NIC drivers to pass up the error returned by mii_attach() (previously by mii_phy_probe()) and unify the error message used in this case where and as appropriate as mii_attach() actually can fail for a number of reasons, not just because of no PHY(s) being present at the expected address(es). Reviewed by: jhb, yongari Notes: svn path=/head/; revision=213893
* Some revision of Yukon controller generates corrupted frame when TXPyun YongHyeon2010-07-091-8/+21
| | | | | | | | | | | | | checksum offloading is enabled. The frame has a valid checksum value so payload might be modified during TX checksum calculation. Disable TX checksum offloading but give users chance to enable it when they know their controller works without problems with TX checksum offloading. Reported by: Andrzej Tobola <ato <> iem dot pw dot edu dot pl> Notes: svn path=/head/; revision=209865
* Take a step towards removing if_watchdog/if_timer. Don't explicitly setJohn Baldwin2009-11-061-2/+0
| | | | | | | | if_watchdog/if_timer to NULL/0 when initializing an ifnet. if_alloc() sets those members to NULL/0 already. Notes: svn path=/head/; revision=198988
* Use if_maddr_rlock()/if_maddr_runlock() rather than IF_ADDR_LOCK()/Robert Watson2009-06-261-4/+4
| | | | | | | | | | | | | | | | 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
* Separate multicast filtering of SysKonnect GENESIS and MarvellPyun YongHyeon2009-05-011-116/+81
| | | | | | | | | | | | | | | | | | | | | | | | Yukon from common multicast handling code. Yukon uses hash-based multicast filtering(big endian form) but GENESIS uses perfect multicast filtering as well as hash-based one(little endian form). Due to the differences of multicast filtering there is no much sense to have a common code. o Remove sk_setmulti() and introduce sk_rxfilter_yukon(), sk_rxfilter_yukon() that handles multicast filtering setup. o Have sk_rxfilter_{yukon, genesis} handle promiscuous mode and nuke sk_setpromisc(). This simplifies ioctl handler as well as giving a chance to check validity of Rx control register of Yukon. o Don't reinitialize controller when IFF_ALLMULTI flags is changed. o Nuke sk_gmchash(), it's not needed anymore. o Always reconfigure Rx control register whenever a new multicast filtering condition is changed. This fixes multicast filtering setup on Yukon. PR: kern/134051 Notes: svn path=/head/; revision=191716
* Prefer NULL over integer 0 for pointer type.Pyun YongHyeon2008-02-141-11/+11
| | | | Notes: svn path=/head/; revision=176265
* Nuke local jumbo allocator and switch to use of UMA backed pagePyun YongHyeon2008-02-142-295/+142
| | | | | | | | | | | | | | | | | | | | | | | | | | | | allocator for jumbo frame. o Removed unneeded jlist lock which was used to manage jumbo buffers. o Don't reinitialize hardware if MTU was not changed. o Added additional check for minimal MTU size. o Added a new tunable hw.skc.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 sk(4). If sk(4) encounter the allocation failure it just disables jumbo frame support and continues to work without user intervention. With these changes jumbo frame performance of sk(4) was slightly increased and users should not encounter jumbo buffer allocation failure. Previously sk(4) tried to allocate physically contiguous memory, 3388KB for 256 Rx descriptors. Sometimes that amount of contiguous memory region could not be available for running systems which in turn resulted in failure of loading the driver. Tested by: Cy Schubert < Cy.Schubert () komquats dot com > Notes: svn path=/head/; revision=176264
* Give MEXTADD() another argument to make both void pointers to thePoul-Henning Kamp2008-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. Notes: svn path=/head/; revision=175872
* Fix function prototype for device_shutdown method.Pyun YongHyeon2007-11-221-3/+3
| | | | Notes: svn path=/head/; revision=173839
* Universally adopt most conventional spelling of acquire.Robert Watson2007-05-271-1/+1
| | | | Notes: svn path=/head/; revision=170035
* Make a missing or empty VPD non-fatal, as it was prior to rev 1.131.Stephen McKay2007-05-101-8/+6
| | | | | | | With this change, my D-Link DGE-530T rev A1 is operational again. Notes: svn path=/head/; revision=169443
* Use our own timer for watchdog instead of if_watchdog/if_timerPyun YongHyeon2007-04-022-8/+24
| | | | | | | interface. Notes: svn path=/head/; revision=168251
* 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
* Change the remainder of the drivers for DMA'ing devices enabled in theMarius Strobl2007-01-211-1/+2
| | | | | | | | | | | sparc64 GENERIC and the sound device drivers known working on sparc64 to use bus_get_dma_tag() to obtain the parent DMA tag so we can get rid of the sparc64_root_dma_tag kludge eventually. Except for ath(4), sk(4), stge(4) and ti(4) these changes are runtime tested (unless I booted up the wrong kernels again...). Notes: svn path=/head/; revision=166165
* Remove incomplete Yukon II support code which was added in if_sk.c, rev 1.123.Pyun YongHyeon2006-12-142-101/+3
| | | | | | | Yukon II users should use msk(4). Notes: svn path=/head/; revision=165197
* provide routines to access VPD data at the PCI layer...John-Mark Gurney2006-10-092-179/+7
| | | | | | | | | remove sk's own implementation, and use the new calls to get the data... Reviewed by: -arch Notes: svn path=/head/; revision=163163
* Fix invalid reference of mbuf chains.Pyun YongHyeon2006-08-121-13/+13
| | | | | | | | | | Use proper pointer dereference to inform modified mbuf chains to caller. In collaboration with: glebius Notes: svn path=/head/; revision=161235
* Fix incorrect busy check for PHY write operation.Pyun YongHyeon2006-08-021-4/+2
| | | | | | | While I'm here remove unnecessary return statement. Notes: svn path=/head/; revision=160898
* Add device ID for second generation D-Link DGE-530T.Pyun YongHyeon2006-07-272-3/+10
| | | | | | | PR: kern/99903 Notes: svn path=/head/; revision=160738
* Convert sk(4) to use the new bus_alloc_resources() API andPyun YongHyeon2006-07-192-46/+43
| | | | | | | | | | bus_{read,write}_* macros. Submitted by: Antoine Brodin <antoine.brodin AT laposte DOT net> Reviewed by: imp (initial version) Notes: svn path=/head/; revision=160492
* Fix typo in comment.Pyun YongHyeon2006-07-051-2/+2
| | | | | | | Submitted by: brad AT OpenBSD DOT org Notes: svn path=/head/; revision=160104
* Fix watchdog timeout errors seen on a few systems.Pyun YongHyeon2006-06-071-6/+13
| | | | | | | | | | | | | | | | | | | | | SK-NET GENESIS document says reading SK_ISSR should stop generating further interrupts(Since we drop a driver lock before invoking ifp->if_input handler we should disable interrupts in ISR in order to protect integrity of softc from subsequent interrupts). But it seems that there is possibility of loosing interrupts between reading SK_ISSR and determining which interrupts are reported. To cope with the situation we continuously read SK_ISSR register until there are no interrupts. However, it seems that the above work around doesn't fix all cases. To protect watchdog handler from triggering false alarm add a work around code which try to reclaim pending Tx descriptors before resetting hardware. This should fix occasional watchdog timeout errors seen on this driver. Reported by: Frank Behrens <frank AT pinky dot sax dot de > Tested by: Frank Behrens <frank AT pinky dot sax dot de > Notes: svn path=/head/; revision=159366
* Re-wrok PHY setup, media handling and dual-port detection.Pyun YongHyeon2006-05-152-37/+13
| | | | | | | | | | | | With this change SysKonnect SK-9521 v2.0 and SK-9821 v2.0 adapter now works. Obtained from: OpenBSD Reported by: Ganbold ganbold ! micom ( mng $ net Tested by: Ganbold ganbold ! micom ( mng $ net Notes: svn path=/head/; revision=158586
* Type.Pyun YongHyeon2006-05-021-1/+1
| | | | | | | Submitted by: brad@OpenBSD Notes: svn path=/head/; revision=158240
* Don't attach to Marvell 88E805X (Yukon-II) by default, the driver is notMaxim Sobolev2006-05-011-0/+2
| | | | | | | | | functional yet. Requested by: bz Notes: svn path=/head/; revision=158205
* Add some incomplete support for Marvell Yukon EC controllers based onMaxim Sobolev2006-04-282-20/+134
| | | | | | | | | | | | | OpenBSD changes. With these changes, PHY part of the driver becomes functional (it senses media changes and negotiates speed just fine), previously it just hang with no PHY message, but no data goes through interface (error message is "can not stop transfer of Tx/Rx descriptor). Hopefully somebody with more clue/free time will be able to pick up after me. Notes: svn path=/head/; revision=158096