summaryrefslogtreecommitdiff
path: root/sys/dev/sk
AgeCommit message (Collapse)Author
2025-01-02Remove now-redundant calls to device_delete_childJohn Baldwin
Deleting a child explicitly before calling bus_generic_detach is now redundant, so remove those calls and rely on bus_generic_detach to delete children instead. Differential Revision: https://reviews.freebsd.org/D47961
2024-12-06Replace calls to bus_generic_attach with bus_attach_childrenJohn Baldwin
Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D47675
2024-11-01msk/sk: Use a bus_child_deleted method to free ivars for childrenJohn Baldwin
Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D47365
2024-07-24newbus: globally replace device_add_child(..., -1) with DEVICE_UNIT_ANYWarner Losh
Sponsored by: Netflix
2024-06-28net: Remove unneeded NULL check for the allocated ifnetZhenlei Huang
Change 4787572d0580 made if_alloc_domain() never fail, then also do the wrappers if_alloc(), if_alloc_dev(), and if_gethandle(). No functional change intended. Reviewed by: kp, imp, glebius, stevek MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D45740
2024-02-22sk(4): Fix a typo in a source code commentGordon Bergling
- /integeated/integrated/ - s/extented/extended/ Obtained from: NetBSD MFC after: 3 days
2023-08-16sys: Remove $FreeBSD$: one-line .c patternWarner Losh
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
2023-08-16sys: Remove $FreeBSD$: two-line .h patternWarner Losh
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
2023-08-01sk(4): Fix a typo in a source code commentGordon Bergling
- s/nomral/normal/ MFC after: 3 days
2023-02-08sk: ansifyMateusz Guzik
Reported by: clang 15 Sponsored by: Rubicon Communications, LLC ("Netgate")
2023-02-06Mechanically convert sk(4) to IfAPIJustin Hibbits
Sponsored by: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D37818
2022-05-06sk: Remove unused devclass arguments to DRIVER_MODULE.John Baldwin
2022-05-06Remove unused miibus_devclass and miibus_fdt_devclass.John Baldwin
2021-12-14sk: plug set-but-not-used varsMateusz Guzik
Sponsored by: Rubicon Communications, LLC ("Netgate")
2021-08-28Fix a common typo in man pages and src commentsGordon Bergling
- s/desciptor/descriptor/ MFC after: 5 days
2020-12-11hme(4): Remove as previous announcedBrooks Davis
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
2020-09-01sk: clean up empty lines in .c and .h filesMateusz Guzik
Notes: svn path=/head/; revision=365155
2020-02-26Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many)Pawel Biernacki
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
2019-10-21Convert to if_foreach_llmaddr() KPI.Gleb Smirnoff
Notes: svn path=/head/; revision=353827
2018-07-27Use https over http for FreeBSD pagesEitan Adler
Notes: svn path=/head/; revision=336757
2018-05-18ifnet: Replace if_addr_lock rwlock with epoch + mutexMatt Macy
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
2017-11-18spdx: initial adoption of licensing ID tags.Pedro F. Giffuni
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
2017-10-29Update several more URLsEitan Adler
- Primarily http -> https - Primarily FreeBSD project URLs Notes: svn path=/head/; revision=325096
2016-05-03sys/dev: minor spelling fixes.Pedro F. Giffuni
Most affect comments, very few have user-visible effects. Notes: svn path=/head/; revision=298955
2016-02-22ifnet lock was changed to use sx(9) long time ago.Pyun YongHyeon
Don't hold a driver lock for if_free(9). Notes: svn path=/head/; revision=295873
2014-10-13Eliminate unnecessary checking for M_EXT on mbufs returned by m_getjcl().Robert Watson
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
2014-09-19Mechanically convert to if_inc_counter().Gleb Smirnoff
Notes: svn path=/head/; revision=271849
2014-08-30Use define from if_var.h to access a field inside struct if_data,Gleb Smirnoff
that resides in struct ifnet. Sponsored by: Nginx, Inc. Notes: svn path=/head/; revision=270856
2014-06-11Fix various NIC drivers to properly cleanup static DMA resources.John Baldwin
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
2014-05-16Remove some unused variables.Christian Brueffer
Found with: Clang Static Analyzer MFC after: 2 weeks Notes: svn path=/head/; revision=266270
2013-12-28Remove superfluous old-style rcsid[] from if_sk.c. There is already anDimitry Andric
__FBSDID() at the top of the file. MFC after: 3 days Notes: svn path=/head/; revision=260016
2013-10-26The r48589 promised to remove implicit inclusion of if_var.h soon. PrepareGleb Smirnoff
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
2013-05-30- Merge from r249476: Ensure that PCI bus BUS_GET_DMA_TAG() method seesMarius Strobl
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
2012-12-04Mechanically substitute flags from historic mbuf allocator withGleb Smirnoff
malloc(9) flags in sys/dev. Notes: svn path=/head/; revision=243857
2012-01-07ether_ifattach() sets if_mtu to ETHERMTU, don't bother set it againKevin Lo
Reviewed by: yongari Notes: svn path=/head/; revision=229767
2011-11-22- There's no need to overwrite the default device method with the defaultMarius Strobl
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
2011-03-11Allocate the DMA memory shared between the host and the controller asMarius Strobl
coherent. MFC after: 2 weeks Notes: svn path=/head/; revision=219544
2010-11-06Fix a long standing bug in programming station address for YukonPyun YongHyeon
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
2010-11-06If we got an invalid station address, generate random address. ThisPyun YongHyeon
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
2010-10-15Convert the PHY drivers to honor the mii_flags passed down and convertMarius Strobl
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
2010-07-09Some revision of Yukon controller generates corrupted frame when TXPyun YongHyeon
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
2009-11-06Take a step towards removing if_watchdog/if_timer. Don't explicitly setJohn Baldwin
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
2009-06-26Use if_maddr_rlock()/if_maddr_runlock() rather than IF_ADDR_LOCK()/Robert Watson
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
2009-05-01Separate multicast filtering of SysKonnect GENESIS and MarvellPyun YongHyeon
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
2008-02-14Prefer NULL over integer 0 for pointer type.Pyun YongHyeon
Notes: svn path=/head/; revision=176265
2008-02-14Nuke local jumbo allocator and switch to use of UMA backed pagePyun YongHyeon
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
2008-02-01Give MEXTADD() another argument to make both void pointers to thePoul-Henning Kamp
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
2007-11-22Fix function prototype for device_shutdown method.Pyun YongHyeon
Notes: svn path=/head/; revision=173839
2007-05-27Universally adopt most conventional spelling of acquire.Robert Watson
Notes: svn path=/head/; revision=170035
2007-05-10Make a missing or empty VPD non-fatal, as it was prior to rev 1.131.Stephen McKay
With this change, my D-Link DGE-530T rev A1 is operational again. Notes: svn path=/head/; revision=169443