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
show more ...
spdx: initial adoption of licensing ID tags.The Software Package Data Exchange (SPDX) group provides a specificationto make it easier for automated tools to detect and summarize well knownopensou
spdx: initial adoption of licensing ID tags.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.Special thanks to Wind River for providing access to "The Duke ofHighlander" tool: an older (2014) run over FreeBSD tree was useful as astarting point.Initially, only tag files that use BSD 4-Clause "Original" license.RelNotes: yesDifferential Revision: https://reviews.freebsd.org/D13133
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
Remove register keyword from sys/ and ANSIfy prototypesA long long time ago the register keyword told the compiler to storethe corresponding variable in a CPU register, but it is not relevantfor
Remove register keyword from sys/ and ANSIfy prototypesA long long time ago the register keyword told the compiler to storethe corresponding variable in a CPU register, but it is not relevantfor any compiler used in the FreeBSD world today.ANSIfy related prototypes while here.Reviewed by: cem, jhbSponsored by: The FreeBSD FoundationDifferential Revision: https://reviews.freebsd.org/D10193
sys/dev: minor spelling fixes.Most affect comments, very few have user-visible effects.
Mechanically convert to if_inc_counter().
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
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
ether_ifattach() sets if_mtu to ETHERMTU, don't bother set it againReviewed by: yongari
- 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.
Close a race where SIOCGIFMEDIA ioctl get inconsistent link status.Because driver is accessing a common MII structure inmii_pollstat(), updating user supplied structure should be donebefore droppi
Close a race where SIOCGIFMEDIA ioctl get inconsistent link status.Because driver is accessing a common MII structure inmii_pollstat(), updating user supplied structure should be donebefore dropping a driver lock.Reported by: Karim (fodillemlinkarimi <> gmail dot com)
- Remove unused remnants of MII bitbang'ing.- Sprinkle const.
- Remove attempts to implement setting of BMCR_LOOP/MIIF_NOLOOP (reporting IFM_LOOP based on BMCR_LOOP is left in place though as it might provide useful for debugging). For most mii(4) drivers i
- Remove attempts to implement setting of BMCR_LOOP/MIIF_NOLOOP (reporting IFM_LOOP based on BMCR_LOOP is left in place though as it might provide useful for debugging). For most mii(4) drivers it was unclear whether the PHYs driven by them actually support loopback or not. Moreover, typically loopback mode also needs to be activated on the MAC, which none of the Ethernet drivers using mii(4) implements. Given that loopback media has no real use (and obviously hardly had a chance to actually work) besides for driver development (which just loopback mode should be sufficient for though, i.e one doesn't necessary need support for loopback media) support for it is just dropped as both NetBSD and OpenBSD already did quite some time ago.- Let mii_phy_add_media() also announce the support of IFM_NONE.- Restructure the PHY entry points to use a structure of entry points instead of discrete function pointers, and extend this to include a "reset" entry point. Make sure any PHY-specific reset routine is always used, and provide one for lxtphy(4) which disables MII interrupts (as is done for a few other PHYs we have drivers for). This includes changing NIC drivers which previously just called the generic mii_phy_reset() to now actually call the PHY-specific reset routine, which might be crucial in some cases. While at it, the redundant checks in these NIC drivers for mii->mii_instance not being zero before calling the reset routines were removed because as soon as one PHY driver attaches mii->mii_instance is incremented and we hardly can end up in their media change callbacks etc if no PHY driver has attached as mii_attach() would have failed in that case and not attach a miibus(4) instance. Consequently, NIC drivers now no longer should call mii_phy_reset() directly, so it was removed from EXPORT_SYMS.- Add a mii_phy_dev_attach() as a companion helper to mii_phy_dev_probe(). The purpose of that function is to perform the common steps to attach a PHY driver instance and to hook it up to the miibus(4) instance and to optionally also handle the probing, addition and initialization of the supported media. So all a PHY driver without any special requirements has to do in its bus attach method is to call mii_phy_dev_attach() along with PHY-specific MIIF_* flags, a pointer to its PHY functions and the add_media set to one. All PHY drivers were updated to take advantage of mii_phy_dev_attach() as appropriate. Along with these changes the capability mask was added to the mii_softc structure so PHY drivers taking advantage of mii_phy_dev_attach() but still handling media on their own do not need to fiddle with the MII attach arguments anyway.- Keep track of the PHY offset in the mii_softc structure. This is done for compatibility with NetBSD/OpenBSD.- Keep track of the PHY's OUI, model and revision in the mii_softc structure. Several PHY drivers require this information also after attaching and previously had to wrap their own softc around mii_softc. NetBSD/OpenBSD also keep track of the model and revision on their mii_softc structure. All PHY drivers were updated to take advantage as appropriate.- Convert the mebers of the MII data structure to unsigned where appropriate. This is partly inspired by NetBSD/OpenBSD.- According to IEEE 802.3-2002 the bits actually have to be reversed when mapping an OUI to the MII ID registers. All PHY drivers and miidevs where changed as necessary. Actually this now again allows to largely share miidevs with NetBSD, which fixed this problem already 9 years ago. Consequently miidevs was synced as far as possible.- Add MIIF_NOMANPAUSE and mii_phy_flowstatus() calls to drivers that weren't explicitly converted to support flow control before. It's unclear whether flow control actually works with these but typically it should and their net behavior should be more correct with these changes in place than without if the MAC driver sets MIIF_DOPAUSE.Obtained from: NetBSD (partially)Reviewed by: yongari (earlier version), silence on arch@ and net@
Converted the remainder of the NIC drivers to use the mii_attach()introduced in r213878 instead of mii_phy_probe(). Unlike r213893 theseare only straight forward conversions though.Reviewed by: y
Converted the remainder of the NIC drivers to use the mii_attach()introduced in r213878 instead of mii_phy_probe(). Unlike r213893 theseare only straight forward conversions though.Reviewed by: yongari
- Hook into the existing stat timer to drive the transmit watchdog instead of using if_watchdog and if_timer.- Reorder detach to call ether_ifdetach() before anything else in tl(4) and wb(4).
Use if_maddr_rlock()/if_maddr_runlock() rather than IF_ADDR_LOCK()/IF_ADDR_UNLOCK() across network device drivers when accessing theper-interface multicast address list, if_multiaddrs. This willa
Use if_maddr_rlock()/if_maddr_runlock() rather than IF_ADDR_LOCK()/IF_ADDR_UNLOCK() across network device drivers when accessing theper-interface multicast address list, if_multiaddrs. This willallow us to change the locking strategy without affecting our driverprogramming interface or binary interface.For two wireless drivers, remove unnecessary locking, since theydon't actually access the multicast address list.Approved by: re (kib)MFC after: 6 weeks
Remove unused variable.Found with: Coverity Prevent(tm)CID: 549
Plug memory leak in jumbo buffer allocation failure path.Patch in the PR was modified to check active jumbo buffers in useand other possible jumbo buffer leak.Jumbo buffer usage in lge(4) still w
Plug memory leak in jumbo buffer allocation failure path.Patch in the PR was modified to check active jumbo buffers in useand other possible jumbo buffer leak.Jumbo buffer usage in lge(4) still wouldn't be reliable due to lackof driver lock in local jumbo buffer allocator. Either introducea new lock to protect jumbo buffer or switch to UMA backed pageallocator for jumbo frame is required.PR: kern/78072
Give MEXTADD() another argument to make both void pointers to thefree function controlable, instead of passing the KVA of the bufferstorage as the first argument.Fix all conventional users of the
Give MEXTADD() another argument to make both void pointers to thefree function controlable, instead of passing the KVA of the bufferstorage as the first argument.Fix all conventional users of the API to pass the KVA of the bufferas the first argument, to make this a no-op commit.Likely break the only non-convetional user of the API, after informingthe relevant committer.Update the mbuf(9) manual page, which was already out of sync onthis point.Bump __FreeBSD_version to 800016 as there is no way to tell howmany arguments a CPP macro needs any other way.This paves the way for giving sendfile(9) a way to wait for thepassed 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.
Fix function prototype for device_shutdown method.
o break newbus api: add a new argument of type driver_filter_t to bus_setup_intr()o add an int return code to all fast handlerso retire INTR_FAST/IH_FASTFor more info: http://docs.freebsd.org
o break newbus api: add a new argument of type driver_filter_t to bus_setup_intr()o add an int return code to all fast handlerso retire INTR_FAST/IH_FASTFor more info: http://docs.freebsd.org/cgi/getmsg.cgi?fetch=465712+0+current/freebsd-currentReviewed by: manyApproved by: re@
123