Provide MS() and SM() macros for 80211 and wireless drivers.We have (two versions) of MS() and SM() macros which we use throughoutthe wireless code. Change all but three places (ath_hal, rtwn, an
Provide MS() and SM() macros for 80211 and wireless drivers.We have (two versions) of MS() and SM() macros which we use throughoutthe wireless code. Change all but three places (ath_hal, rtwn, and rsu)to the newly provided _IEEE80211_MASKSHIFT() and _IEEE80211_SHIFTMASK()macros. Also change one internal case using both _S and _M instead ofjust _S away from _M (one of the reasons rtwn and rsu were not changed).This was done semi-mechanically. No functional changes intended.Requested by: gnn (D26091)Reviewed by: adrian (pre line wrap)MFC after: 2 weeksSponsored by: Rubicon Communications, LLC (d/b/a "Netgate")Differential Revision: https://reviews.freebsd.org/D26539
show more ...
Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many)r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that arestill not MPSAFE (or already are but aren’t properly mark
Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many)r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that arestill 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 andSYSCTL_PROC nodes using one of the soon-to-be-required flags.Mark all obvious cases as MPSAFE. All entries that haven't been markedas MPSAFE before are by default marked as NEEDGIANTApproved by: kib (mentor, blanket)Commented by: kib, gallatin, melifaroDifferential Revision: https://reviews.freebsd.org/D23718
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
Widen EPOCH(9) usage in PCI WLAN drivers.Make sure all occurrences of ieee80211_input_xxx() in sys/dev arecovered by a network epoch section. Do not depend on the interrupthandler nor any taskque
Widen EPOCH(9) usage in PCI WLAN drivers.Make sure all occurrences of ieee80211_input_xxx() in sys/dev arecovered by a network epoch section. Do not depend on the interrupthandler nor any taskqueues being in a network epoch section.This patch should unbreak the PCI WLAN drivers after r357004.Pointy hat: glebius@Sponsored by: Mellanox Technologies
Convert to if_foreach_llmaddr() KPI.
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
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.Tested with Netgear WG111 v3 (urtw(4)), STA mode.MFC after: 2 weeks
net80211(4): hide casts for 'i_seq' field offset calculation insideieee80211_getqos() and reuse it in various places.Checked with RTL8188EE, HOSTAP mode + RTL8188CUS, STA mode.MFC after: 2 weeks
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().
123