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 ...
Clean up OF_getprop_alloc APIOF_getprop_alloc takes element size argument and returns number ofelements in the property. There are valid use cases for such behaviorbut mostly API consumers pass 1
Clean up OF_getprop_alloc APIOF_getprop_alloc takes element size argument and returns number ofelements in the property. There are valid use cases for such behaviorbut mostly API consumers pass 1 as element size to get stringproperties. What API users would expect from OF_getprop_alloc is to bea combination of malloc + OF_getprop with the same semantic of returnvalue. This patch modifies API signature to match these expectations.For the valid use cases with element size != 1 and to reducemodification scope new OF_getprop_alloc_multi function has beenintroduced that behaves the same way OF_getprop_alloc behaved prior tothis patch.Reviewed by: ian, manuDifferential Revision: https://reviews.freebsd.org/D14850
Create a new ISA_PNP_INFO macro. Use this macro every where we haveISA PNP card support (replace by hand version in if_ed). Move moduledeclarations to the end of some files. Fix PCCARD_PNP_INFO to
Create a new ISA_PNP_INFO macro. Use this macro every where we haveISA PNP card support (replace by hand version in if_ed). Move moduledeclarations to the end of some files. Fix PCCARD_PNP_INFO to usenitems(). Remove some stale comments about pc98, turns out the commentwas simply wrong.
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.
sys/dev: Replace zero with NULL for pointers.Makes things easier to read, plus architectures may set NULL to somethingdifferent than zero.Found with: devel/coccinelleMFC after: 3 weeks
Remove pc98 support completely.I thank all developers and contributors for pc98.Relnotes: yes
Use OF_prop_free instead of direct call to free(9)Reviewed by: marius
sys: use our nitems() macro when param.h is available.This should cover all the remaining cases in the kernel.Discussed in: freebsd-current
Fix the resource_list_print_type() calls to use uintmax_t.Missed a bunch from r297000.
Migrate many bus_alloc_resource() calls to bus_alloc_resource_anywhere().Most calls to bus_alloc_resource() use "anywhere" as the range, with a givencount. Migrate these to use the new bus_alloc_
Migrate many bus_alloc_resource() calls to bus_alloc_resource_anywhere().Most calls to bus_alloc_resource() use "anywhere" as the range, with a givencount. Migrate these to use the new bus_alloc_resource_anywhere() API.Reviewed by: jhbDifferential Revision: https://reviews.freebsd.org/D5370
These files were getting sys/malloc.h and vm/uma.h with header pollutionvia sys/mbuf.h
In order to reduce use of M_EXT outside of the mbuf allocator andsocket-buffer implementations, introduce a return value for MCLGET()(and m_cljget() that underlies it) to allow the caller to avoid
In order to reduce use of M_EXT outside of the mbuf allocator andsocket-buffer implementations, introduce a return value for MCLGET()(and m_cljget() that underlies it) to allow the caller to avoid testingM_EXT itself. Update all callers to use the return value.With this change, very few network device drivers remain aware ofM_EXT; the primary exceptions lie in mbuf-chain pretty printers fordebugging, and in a few cases, custom mbuf and cluster allocationimplementations.NB: This is a difficult-to-test change as it touches many drivers forwhich I don't have physical devices. Instead we've gone for intensivereview, but further post-commit review would definitely be appreciatedto spot errors where changes could not easily be made mechanically,but were largely mechanical in nature.Differential Revision: https://reviews.freebsd.org/D1440Reviewed by: adrian, bz, gnnSponsored by: EMC / Isilon Storage Division
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.
Update NetBSD Foundation copyrights to 2-clause BSDThe NetBSD Foundation states "Third parties are encouraged to change thelicense on any files which have a 4-clause license contributed to theNet
Update NetBSD Foundation copyrights to 2-clause BSDThe NetBSD Foundation states "Third parties are encouraged to change thelicense on any files which have a 4-clause license contributed to theNetBSD Foundation to a 2-clause license."This change removes clauses 3 and 4 from copyright / license blocks thatlist The NetBSD Foundation as the only copyright holder.Sponsored by: The FreeBSD Foundation
Provide necessary includes.
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.
Mechanically substitute flags from historic mbuf allocator withmalloc(9) flags in sys/dev.
Make sparc64 compatible with NEW_PCIB and enable it:- Implement bus_adjust_resource() methods as far as necessary and in non-PCI bridge drivers as far as feasible without rototilling them.- As NE
Make sparc64 compatible with NEW_PCIB and enable it:- Implement bus_adjust_resource() methods as far as necessary and in non-PCI bridge drivers as far as feasible without rototilling them.- As NEW_PCIB does a layering violation by activating resources at layers above pci(4) without previously bubbling up their allocation there, move the assignment of bus tags and handles from the bus_alloc_resource() to the bus_activate_resource() methods like at least the other NEW_PCIB enabled architectures do. This is somewhat unfortunate as previously sparc64 (ab)used resource activation to indicate whether SYS_RES_MEMORY resources should be mapped into KVA, which is only necessary if their going to be accessed via the pointer returned from rman_get_virtual() but not for bus_space(9) as the later always uses physical access on sparc64. Besides wasting KVA if we always map in SYS_RES_MEMORY resources, a driver also may deliberately not map them in if the firmware already has done so, possibly in a special way. So in order to still allow a driver to decide whether a SYS_RES_MEMORY resource should be mapped into KVA we let it indicate that by calling bus_space_map(9) with BUS_SPACE_MAP_LINEAR as actually documented in the bus_space(9) page. This is implemented by allocating a separate bus tag per SYS_RES_MEMORY resource and passing the resource via the previously unused bus tag cookie so we later on can call rman_set_virtual() in sparc64_bus_mem_map(). As a side effect this now also allows to actually indicate that a SYS_RES_MEMORY resource should be mapped in as cacheable and/or read-only via BUS_SPACE_MAP_CACHEABLE and BUS_SPACE_MAP_READONLY respectively.- Do some minor cleanup like taking advantage of rman_init_from_resource(), factor out the common part of bus tag allocation into a newly added sparc64_alloc_bus_tag(), hook up some missing newbus methods and replace some homegrown versions with the generic counterparts etc.- While at it, let apb_attach() (which can't use the generic NEW_PCIB code as APB bridges just don't have the base and limit registers implemented) regarding the config space registers cached in pcib_softc and the SYSCTL reporting nodes set up.
Use convenience functions where possible instead of accessing the PCIconfiguration registers directly.Remove pci_enable_io calls where they are redundant. The PCI bus driverwill set the right bit
Use convenience functions where possible instead of accessing the PCIconfiguration registers directly.Remove pci_enable_io calls where they are redundant. The PCI bus driverwill set the right bits when the corresponding bus resource is activated.Remove redundant pci_* function calls from suspend/resume methods. Thebus driver already saves and restores the PCI configuration.Reviewed by: jhbApproved by: kib (mentor)
Use SYS_RES_IOPORT instead of PCIM_CMD_PORTEN when calling pci_enable_io.Approved by: kib (mentor)
Add new tunable 'net.link.ifqmaxlen' to set default send interfacequeue length. The default value for this parameter is 50, which isquite low for many of today's uses and the only way to modify thi
Add new tunable 'net.link.ifqmaxlen' to set default send interfacequeue length. The default value for this parameter is 50, which isquite low for many of today's uses and the only way to modify thisparameter right now is to edit if_var.h file. Also add read-onlysysctl with the same name, so that it's possible to retrieve thecurrent value.MFC after: 1 month
The NetBSD Foundation has granted permission to remove clause 3 and 4 fromthe software.Obtained from: NetBSD
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
- Use bus_{read,write}_*(9) instead of bus_space_{read,write}_*(9) etc and take advantage of rman_get_rid(9) in order to save some softc members.- Provide and consume module dependency informati
- Use bus_{read,write}_*(9) instead of bus_space_{read,write}_*(9) etc and take advantage of rman_get_rid(9) in order to save some softc members.- Provide and consume module dependency information for lebuffer(4).
12