MFC r344990:Fix ieee80211_radiotap(9) usage in wireless drivers:- Alignment issues: * Add missing __packed attributes + padding across all drivers; inmost places there was an assumption that pad
MFC r344990:Fix ieee80211_radiotap(9) usage in wireless drivers:- Alignment issues: * Add missing __packed attributes + padding across all drivers; inmost places there was an assumption that padding will be alwaysminimally suitable; in few places - e.g., in urtw(4) / rtwn(4) -padding was just missing. * Add __aligned(8) attribute for all Rx radiotap headers since they cancontain 64-bit TSF timestamp; it cannot appear in Tx radiotap headers, sojust drop the attribute here. Refresh ieee80211_radiotap(9) man pageaccordingly.- Since net80211 automatically updates channel frequency / flags inieee80211_radiotap_chan_change() drop duplicate setup for these fieldsin drivers.
show more ...
MFC r343990:net80211: hide casts for 'i_seq' field offset calculation insideieee80211_getqos() and reuse it in various places.
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.
net80211 + drivers: hide size of 'bands' array behind a macro.Auto-replace 'howmany(IEEE80211_MODE_MAX, 8)' with 'IEEE80211_MODE_BYTES'.No functional changes.
net80211: enable promiscuous mode state change for non-monitor/ahdemo modes- Allow to enable/disable promiscuous mode when: * interface is not a member of bridge, or; * request was issued by us
net80211: enable promiscuous mode state change for non-monitor/ahdemo modes- Allow to enable/disable promiscuous mode when: * interface is not a member of bridge, or; * request was issued by user (ifconfig wlan0 promisc), or; * interface is in MONITOR or AHDEMO mode.- Drop local workarounds in mwl(4) and malo(4).Tested with:- Intel 3945BG, STA mode;- RTL8188CUS, MONITOR mode;Reviewed by: adrianDifferential Revision: https://reviews.freebsd.org/D5472
Remove taskqueue_enqueue_fast().taskqueue_enqueue() was changed to support both fast and non-fasttaskqueues 10 years ago in r154167. It has been a compat shim eversince. It's time for the compa
Remove taskqueue_enqueue_fast().taskqueue_enqueue() was changed to support both fast and non-fasttaskqueues 10 years ago in r154167. It has been a compat shim eversince. It's time for the compat shim to go.Submitted by: Howard Su <[email protected]>Reviewed by: sepheDifferential Revision: https://reviews.freebsd.org/D5131
These files were getting sys/malloc.h and vm/uma.h with header pollutionvia sys/mbuf.h
net80211 drivers: fix ieee80211_init_channels() usageFix out-of-bounds read (all) / write (11n capable) for driversthat are using ieee80211_init_channels() to initialize channel list.Tested with
net80211 drivers: fix ieee80211_init_channels() usageFix out-of-bounds read (all) / write (11n capable) for driversthat are using ieee80211_init_channels() to initialize channel list.Tested with: * RTL8188EU, STA mode. * RTL8188CUS, STA mode. * WUSB54GC, HOSTAP mode.Approved by: adrian (mentor)MFC after: 2 weeksDifferential Revision: https://reviews.freebsd.org/D4818
net80211: move ieee80211_free_node() call on error from ic_raw_xmit() to ieee80211_raw_output().This doesn't free the mbuf upon error; the driver ic_raw_xmit method is stilldoing that.Submitted
net80211: move ieee80211_free_node() call on error from ic_raw_xmit() to ieee80211_raw_output().This doesn't free the mbuf upon error; the driver ic_raw_xmit method is stilldoing that.Submitted by: <[email protected]>Differential Revision: https://reviews.freebsd.org/D3774
net80211 & wireless drivers: remove duplicate defines (noop)* IEEE80211_DIR_DSTODS(wh) -> IEEE80211_IS_DSTODS(wh).* N(a) -> nitems(a).* Remove LE_READ_2(p)/LE_READ_4(p) definitions (and include i
net80211 & wireless drivers: remove duplicate defines (noop)* IEEE80211_DIR_DSTODS(wh) -> IEEE80211_IS_DSTODS(wh).* N(a) -> nitems(a).* Remove LE_READ_2(p)/LE_READ_4(p) definitions (and include ieee80211_input.h instead).* <drvname>_TXOP_TO_US(txop) -> IEEE80211_TXOP_TO_US(txop).* Put IEEE80211_RV(v) into ieee80211_proto.h and remove local RV(v) definitions.Submitted by: Andriy Voskoboinyk <[email protected]>Differential Revision: https://reviews.freebsd.org/D3705
Replay r286410. Change KPI of how device drivers that provide wirelessconnectivity interact with the net80211 stack.Historical background: originally wireless devices created an interface,just li
Replay r286410. Change KPI of how device drivers that provide wirelessconnectivity interact with the net80211 stack.Historical background: originally wireless devices created an interface,just like Ethernet devices do. Name of an interface matched the name ofthe driver that created. Later, wlan(4) layer was introduced, and thewlanX interfaces become the actual interface, leaving original ones as"a parent interface" of wlanX. Kernelwise, the KPI between net80211 layerand a driver became a mix of methods that pass a pointer to struct ifnetas identifier and methods that pass pointer to struct ieee80211com. Fromuser point of view, the parent interface just hangs on in the ifconfiglist, and user can't do anything useful with it.Now, the struct ifnet goes away. The struct ieee80211com is the onlyKPI between a device driver and net80211. Details:- The struct ieee80211com is embedded into drivers softc.- Packets are sent via new ic_transmit method, which is very much like the previous if_transmit.- Bringing parent up/down is done via new ic_parent method, which notifies driver about any changes: number of wlan(4) interfaces, number of them in promisc or allmulti state.- Device specific ioctls (if any) are received on new ic_ioctl method.- Packets/errors accounting are done by the stack. In certain cases, when driver experiences errors and can not attribute them to any specific interface, driver updates ic_oerrors or ic_ierrors counters.Details on interface configuration with new world order:- A sequence of commands needed to bring up wireless DOESN"T change.- /etc/rc.conf parameters DON'T change.- List of devices that can be used to create wlan(4) interfaces is now provided by net.wlan.devices sysctl.Most drivers in this change were converted by me, except of wpi(4),that was done by Andriy Voskoboinyk. Big thanks to Kevin Lo for testingchanges to at least 8 drivers. Thanks to pluknet@, Oliver Hartmann,Olivier Cochard, gjb@, mmoll@, op@ and lev@, who also participated intesting.Reviewed by: adrianSponsored by: NetflixSponsored by: Nginx, Inc.
Revert the wifi ifnet changes until things are more baked and tested.* 286410* 286413* 286416The initial commit broke a variety of debug and features that aren'tin the GENERIC kernels but are
Revert the wifi ifnet changes until things are more baked and tested.* 286410* 286413* 286416The initial commit broke a variety of debug and features that aren'tin the GENERIC kernels but are enabled in other platforms.
Change KPI of how device drivers that provide wireless connectivity interactwith the net80211 stack.Historical background: originally wireless devices created an interface,just like Ethernet devi
Change KPI of how device drivers that provide wireless connectivity interactwith the net80211 stack.Historical background: originally wireless devices created an interface,just like Ethernet devices do. Name of an interface matched the name ofthe driver that created. Later, wlan(4) layer was introduced, and thewlanX interfaces become the actual interface, leaving original ones as"a parent interface" of wlanX. Kernelwise, the KPI between net80211 layerand a driver became a mix of methods that pass a pointer to struct ifnetas identifier and methods that pass pointer to struct ieee80211com. Fromuser point of view, the parent interface just hangs on in the ifconfiglist, and user can't do anything useful with it.Now, the struct ifnet goes away. The struct ieee80211com is the onlyKPI between a device driver and net80211. Details:- The struct ieee80211com is embedded into drivers softc.- Packets are sent via new ic_transmit method, which is very much like the previous if_transmit.- Bringing parent up/down is done via new ic_parent method, which notifies driver about any changes: number of wlan(4) interfaces, number of them in promisc or allmulti state.- Device specific ioctls (if any) are received on new ic_ioctl method.- Packets/errors accounting are done by the stack. In certain cases, when driver experiences errors and can not attribute them to any specific interface, driver updates ic_oerrors or ic_ierrors counters.Details on interface configuration with new world order:- A sequence of commands needed to bring up wireless DOESN"T change.- /etc/rc.conf parameters DON'T change.- List of devices that can be used to create wlan(4) interfaces is now provided by net.wlan.devices sysctl.Most drivers in this change were converted by me, except of wpi(4),that was done by Andriy Voskoboinyk. Big thanks to Kevin Lo for testingchanges to at least 8 drivers. Thanks to Olivier Cochard, gjb@, mmoll@,op@ and lev@, who also participated in testing. Details here:https://wiki.freebsd.org/projects/ifnet/net80211Still, drivers: ndis, wtap, mwl, ipw, bwn, wi, upgt, uath were nottested. Changes to mwl, ipw, bwn, wi, upgt are trivial and chancesof problems are low. The wtap wasn't compilable even before this change.But the ndis driver is complex, and it is likely to be broken with thiscommit. Help with testing and debugging it is appreciated.Differential Revision: D2655, D2740Sponsored by: Nginx, Inc.Sponsored by: Netflix
Change three methods in struct ieee80211com, namely ic_updateslot,ic_update_mcast and ic_update_promisc, to pass pointer to the ieee80211com,not to the ifnet.Sponsored by: NetflixSponsored by: N
Change three methods in struct ieee80211com, namely ic_updateslot,ic_update_mcast and ic_update_promisc, to pass pointer to the ieee80211com,not to the ifnet.Sponsored by: NetflixSponsored by: Nginx, Inc.
Set ic_softc in all 802.11 drivers. Not required right now, but will beused quite soon.Sponsored by: NetflixSponsored by: Nginx, Inc.
Make net80211 drivers supply their device name to the net80211 layer, sothat the latter doesn't need to go through struct ifnet to get their name.Sponsored by: NetflixSponsored by: Nginx, Inc.
Fix compilation with GCC in the PAE case.MFC after: 3 days
Update the use of bus space macros to be more correct.This was a problem on i386 PAE builds.
Mechanically convert to if_inc_counter().
Pull in r267961 and r267973 again. Fix for issues reported will follow.
Revert r267961, r267973:These changes prevent sysctl(8) from returning proper output,such as: 1) no output from sysctl(8) 2) erroneously returning ENOMEM with tools like truss(1) or uname(1
Revert r267961, r267973:These changes prevent sysctl(8) from returning proper output,such as: 1) no output from sysctl(8) 2) erroneously returning ENOMEM with tools like truss(1) or uname(1) truss: can not get etype: Cannot allocate memory
Extend the meaning of the CTLFLAG_TUN flag to automatically check ifthere is an environment variable which shall initialize the SYSCTLduring early boot. This works for all SYSCTL types both statica
Extend the meaning of the CTLFLAG_TUN flag to automatically check ifthere is an environment variable which shall initialize the SYSCTLduring early boot. This works for all SYSCTL types both statically anddynamically created ones, except for the SYSCTL NODE type and SYSCTLswhich belong to VNETs. A new flag, CTLFLAG_NOFETCH, has been added tobe used in the case a tunable sysctl has a custom initialisationfunction allowing the sysctl to still be marked as a tunable. Thekernel SYSCTL API is mostly the same, with a few exceptions for somespecial operations like iterating childrens of a static/extern SYSCTLnode. This operation should probably be made into a factored outcommon macro, hence some device drivers use this. The reason forchanging the SYSCTL API was the need for a SYSCTL parent OID pointerand not only the SYSCTL parent OID list pointer in order to quicklygenerate the sysctl path. The motivation behind this patch is to avoidparameter loading cludges inside the OFED driver subsystem. Instead ofadding special code to the OFED driver subsystem to post-load tunablesinto dynamically created sysctls, we generalize this in the kernel.Other changes:- Corrected a possibly incorrect sysctl name from "hw.cbb.intr_mask"to "hw.pcic.intr_mask".- Removed redundant TUNABLE statements throughout the kernel.- Some minor code rewrites in connection to removing not neededTUNABLE statements.- Added a missing SYSCTL_DECL().- Wrapped two very long lines.- Avoid malloc()/free() inside sysctl string handling, in case it iscalled to initialize a sysctl from a tunable, hence malloc()/free() isnot ready when sysctls from the sysctl dataset are registered.- Bumped FreeBSD version to indicate SYSCTL API change.MFC after: 2 weeksSponsored by: Mellanox Technologies
Don't destroy bus_dma maps created by bus_dmamem_alloc(). In some cases,don't create a map before calling bus_dmamem_alloc() (such maps wereleaked). It is believed that the extra destroy of the m
Don't destroy bus_dma maps created by bus_dmamem_alloc(). In some cases,don't create a map before calling bus_dmamem_alloc() (such maps wereleaked). It is believed that the extra destroy of the map was generallyharmless since bus_dmamem_alloc() often uses special maps for whichbus_dmamap_destroy() is a no-op (e.g. on x86).Reviewed by: scottl
Rename definition of IEEE80211_FC1_WEP to IEEE80211_FC1_PROTECTED.The origin of WEP comes from IEEE Std 802.11-1997 where it defineswhether the frame body of MAC frame has been encrypted using WEP
Rename definition of IEEE80211_FC1_WEP to IEEE80211_FC1_PROTECTED.The origin of WEP comes from IEEE Std 802.11-1997 where it defineswhether the frame body of MAC frame has been encrypted using WEPalgorithm or not.IEEE Std. 802.11-2007 changes WEP to Protected Frame, indicateswhether the frame is protected by a cryptographic encapsulationalgorithm.Reviewed by: adrian, rpaulo
123