Use NET_TASK_INIT() and NET_GROUPTASK_INIT() for drivers that processincoming packets in taskqueue context.Reviewed by: hselaskyDifferential Revision: https://reviews.freebsd.org/D23518
Remove sparc64 kernel supportRemove all sparc64 specific filesRemove all sparc64 ifdefsRemovee indireeect sparc64 ifdefs
Convert to if_foreach_llmaddr() KPI.
Reapply, with minor tweaks, r338025, from the original commit:Remove unused and easy to misuse PNP macro parameterInspired by r338025, just remove the element size parameter to theMODULE_PNP_INF
Reapply, with minor tweaks, r338025, from the original commit:Remove unused and easy to misuse PNP macro parameterInspired by r338025, just remove the element size parameter to theMODULE_PNP_INFO macro entirely. The 'table' parameter is now required tohave correct pointer (or array) type. Since all invocations of the macroalready had this property and the emitted PNP data continues to include theelement size, there is no functional change.Mostly done with the coccinelle 'spatch' tool: $ cat modpnpsize0.cocci @normaltables@ identifier b,c; expression a,d,e; declarer MODULE_PNP_INFO; @@ MODULE_PNP_INFO(a,b,c,d, -sizeof(d[0]), e); @singletons@ identifier b,c,d; expression a; declarer MODULE_PNP_INFO; @@ MODULE_PNP_INFO(a,b,c,&d, -sizeof(d), 1); $ rg -l MODULE_PNP_INFO -- sys | \ xargs spatch --in-place --sp-file modpnpsize0.cocci(Note that coccinelle invokes diff(1) via a PATH search and expects diff totolerate the -B flag, which BSD diff does not. So I had to link gdiff intoPATH as diff to use spatch.)Tinderbox'd (-DMAKE_JUST_KERNELS).Approved by: re (glen)
show more ...
Back out r338035 until Warner is finished churning GSoC PNP patchesI was not aware Warner was making or planning to make forward progress inthis area and have since been informed of that.It's ea
Back out r338035 until Warner is finished churning GSoC PNP patchesI was not aware Warner was making or planning to make forward progress inthis area and have since been informed of that.It's easy to apply/reapply when churn dies down.
Remove unused and easy to misuse PNP macro parameterInspired by r338025, just remove the element size parameter to theMODULE_PNP_INFO macro entirely. The 'table' parameter is now required tohave
Remove unused and easy to misuse PNP macro parameterInspired by r338025, just remove the element size parameter to theMODULE_PNP_INFO macro entirely. The 'table' parameter is now required tohave correct pointer (or array) type. Since all invocations of the macroalready had this property and the emitted PNP data continues to include theelement size, there is no functional change.Mostly done with the coccinelle 'spatch' tool: $ cat modpnpsize0.cocci @normaltables@ identifier b,c; expression a,d,e; declarer MODULE_PNP_INFO; @@ MODULE_PNP_INFO(a,b,c,d, -sizeof(d[0]), e); @singletons@ identifier b,c,d; expression a; declarer MODULE_PNP_INFO; @@ MODULE_PNP_INFO(a,b,c,&d, -sizeof(d), 1); $ rg -l MODULE_PNP_INFO -- sys | \ xargs spatch --in-place --sp-file modpnpsize0.cocci(Note that coccinelle invokes diff(1) via a PATH search and expects diff totolerate the -B flag, which BSD diff does not. So I had to link gdiff intoPATH as diff to use spatch.)Tinderbox'd (-DMAKE_JUST_KERNELS).
Add PNP info to PCI attachment of cas driverMove module delcaration to be after device table. The PNP_INFO mustfollow the module declaration.Reviewed by: imp, chuckSubmitted by: Lakhan Shiva Ka
Add PNP info to PCI attachment of cas driverMove module delcaration to be after device table. The PNP_INFO mustfollow the module declaration.Reviewed by: imp, chuckSubmitted by: Lakhan Shiva Kamireddy <[email protected]>Sponsored by: Google, Inc. (GSoC 2018)Pull Request: https://github.com/bsdimp/freebsd/pull/5
ifnet: Replace if_addr_lock rwlock with epoch + mutexRun on LLNW canaries and tested by pho@gallatin:Using a 14-core, 28-HTT single socket E5-2697 v3 with a 40GbE MLX5based ConnectX 4-LX NIC, I
ifnet: Replace if_addr_lock rwlock with epoch + mutexRun on LLNW canaries and tested by pho@gallatin:Using a 14-core, 28-HTT single socket E5-2697 v3 with a 40GbE MLX5based ConnectX 4-LX NIC, I see an almost 12% improvement in receivedpacket rate, and a larger improvement in bytes delivered all the wayto 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 GBfree4.98 0.00 4.42 0.00 4235592 33 83.80 4720653 2149771 1235 247.324.73 0.00 4.20 0.00 4025260 33 82.99 4724900 2139833 1204 247.324.72 0.00 4.20 0.00 4035252 33 82.14 4719162 2132023 1264 247.324.71 0.00 4.21 0.00 4073206 33 83.68 4744973 2123317 1347 247.324.72 0.00 4.21 0.00 4061118 33 80.82 4713615 2188091 1490 247.324.72 0.00 4.21 0.00 4051675 33 85.29 4727399 2109011 1205 247.324.73 0.00 4.21 0.00 4039056 33 84.65 4724735 2102603 1053 247.32After the patchInMpps OMpps InGbs OGbs err TCP Est %CPU syscalls csw irq GBfree5.43 0.00 4.20 0.00 3313143 33 84.96 5434214 1900162 2656 245.515.43 0.00 4.20 0.00 3308527 33 85.24 5439695 1809382 2521 245.515.42 0.00 4.19 0.00 3316778 33 87.54 5416028 1805835 2256 245.515.42 0.00 4.19 0.00 3317673 33 90.44 5426044 1763056 2332 245.515.42 0.00 4.19 0.00 3314839 33 88.11 5435732 1792218 2499 245.525.44 0.00 4.19 0.00 3293228 33 91.84 5426301 1668597 2121 245.52Similarly, netperf reports 230Mb/s before the patch, and 270Mb/s after the patchReviewed by: gallatinSponsored by: Limelight NetworksDifferential Revision: https://reviews.freebsd.org/D15366
sys/dev: further adoption of SPDX licensing ID tags.Mainly focus on files that use BSD 2-Clause license, however the tool Iwas using misidentified many licenses so this was mostly a manual - error
sys/dev: further adoption of SPDX licensing ID tags.Mainly focus on files that use BSD 2-Clause license, however the tool Iwas using misidentified many licenses so this was mostly a manual - errorprone - task.The Software Package Data Exchange (SPDX) group provides a specificationto make it easier for automated tools to detect and summarize well knownopensource licenses. We are gradually adopting the specification, notingthat the tags are considered only advisory and do not, in any way,superceed or replace the license texts.
Shorten list of arguments to mbuf external storage freeing function.All of these arguments are stored in m_ext, so there is no reasonto pass them in the argument list. Not all functions need the
Shorten list of arguments to mbuf external storage freeing function.All of these arguments are stored in m_ext, so there is no reasonto pass them in the argument list. Not all functions need the secondargument, some don't even need the first one. The second argumentlives in next cache line, so not dereferencing it is a performancegain. This was discovered in sendfile(2), which will be covered bynext commits.The second goal of this commit is to bring even more flexibilityto m_ext mbufs, allowing to create more fields in m_ext, opaque tothe generic mbuf code, and potentially set and dereferenced bysubsystems.Reviewed by: gallatin, kbowlingDifferential Revision: https://reviews.freebsd.org/D12615
Mechanically convert to if_inc_counter().
Use define from if_var.h to access a field inside struct if_data,that resides in struct ifnet.Sponsored by: Nginx, Inc.
All mbuf external free functions never fail, so let them be void.Sponsored by: Nginx, Inc.
The r48589 promised to remove implicit inclusion of if_var.h soon. Prepareto this event, adding if_var.h to files that do need it. Also, includeall includes that now are included due to implicit po
The r48589 promised to remove implicit inclusion of if_var.h soon. Prepareto this event, adding if_var.h to files that do need it. Also, includeall includes that now are included due to implicit pollution via if_var.hSponsored by: NetflixSponsored by: Nginx, Inc.
Give (*ext_free) an int return value allowing for very sophisticatedexternal mbuf buffer management capabilities in the future.For now only EXT_FREE_OK is defined with current legacy behavior.Sp
Give (*ext_free) an int return value allowing for very sophisticatedexternal mbuf buffer management capabilities in the future.For now only EXT_FREE_OK is defined with current legacy behavior.Sponsored by: The FreeBSD Foundation
Add an mbuf pointer parameter to (*ext_free) to give the externalfree function access to the mbuf the external memory was attachedto.Mechanically adjust all users to include the mbuf parameter.
Add an mbuf pointer parameter to (*ext_free) to give the externalfree function access to the mbuf the external memory was attachedto.Mechanically adjust all users to include the mbuf parameter.This fixes a long standing annoyance for external free functions.Before one had to sacrifice one of the argument pointers for this.Sponsored by: The FreeBSD Foundation
- Correct mispellings of the word necessarySubmitted by: Christoph Mallon <[email protected]> (via private mail)
- Move reporting of failures to disable RX/TX MAC under bootverbose as at least the Saturn chips of 501-6738 cards may fail to do so the first time, which isn't fatal though. Reported by: Paul
- Move reporting of failures to disable RX/TX MAC under bootverbose as at least the Saturn chips of 501-6738 cards may fail to do so the first time, which isn't fatal though. Reported by: Paul Keusemann- Explain why we don't enable infinite bursts on sparc64.- Given that these chips support memory write invalidate, make sure that it's enabled in the command register. Also make sure that PERR# and SERR# assertion is enabled.MFC after: 1 week
- Check the return value of taskqueue_start_threads().- At least the Saturn chips of 501-6738 cards need a delay after freezing the external GMII pins before the internal PHY is accessible again.
- Check the return value of taskqueue_start_threads().- At least the Saturn chips of 501-6738 cards need a delay after freezing the external GMII pins before the internal PHY is accessible again. So wait a bit after (un)freezing these. Also don't touch the other bits of that configuration register. [1]- Take advantage of nitems().Reported and tested by: Paul Keusemann [1]MFC after: 3 days
Mechanically substitute flags from historic mbuf allocator withmalloc(9) flags in sys/dev.
Remove duplicate const specifiers in many drivers (I hope I got all ofthem, please let me know if not). Most of these are of the form:static const struct bzzt_type { [...list of members...]} co
Remove duplicate const specifiers in many drivers (I hope I got all ofthem, please let me know if not). Most of these are of the form:static const struct bzzt_type { [...list of members...]} const bzzt_devs[] = { [...list of initializers...]};The second const is unnecessary, as arrays cannot be modified anyway,and if the elements are const, the whole thing is const automatically(e.g. it is placed in .rodata).I have verified this does not change the binary output of a full kernelbuild (except for build timestamps embedded in the object files).Reviewed by: yongari, mariusMFC after: 1 week
- There's no need to overwrite the default device method with the default one. Interestingly, these are actually the default for quite some time (bus_generic_driver_added(9) since r52045 and bus_
- There's no need to overwrite the default device method with the default 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.
- Expand the scope of the lock in the interrupt routine to close races with checking IFF_DRV_RUNNING and simplify the code. This also involves holding the driver lock in the rx_ch callout.- Just
- Expand the scope of the lock in the interrupt routine to close races with checking IFF_DRV_RUNNING and simplify the code. This also involves holding the driver lock in the rx_ch callout.- Just use ifp instead of sc->sc_ifp.Submitted by: jhb (mostly)
Partially merge r223648, r223648 and r223949 from gem(4):- Consistently use the newly introduced sc_mac_rxcfg throughout the driver instead of reading the old content of CAS_MAC_RX_CONF.- Increme
Partially merge r223648, r223648 and r223949 from gem(4):- Consistently use the newly introduced sc_mac_rxcfg throughout the driver instead of reading the old content of CAS_MAC_RX_CONF.- Increment if_iqdrops instead of if_ierrors in case of RX buffer allocation failure.- According to the Cassini datasheet the RX MAC should also be disabled in cas_setladrf() before changing its configuration.- Add error messages to gem_disable_{r,t}x() and take advantage of these throughout the driver instead of duplicating their functionality all over the place.
Correct spelling in a comment.Submitted by: brucec
12