#
1375790a |
| 17-Nov-2024 |
Adrian Chadd <adrian@FreeBSD.org> |
net80211: add IEEE80211_IS_QOS_NULL()
This will be useful when fixing up the sequence number generation and checks, as the rules around how sequence numbers are generated have been clarified in 802.
net80211: add IEEE80211_IS_QOS_NULL()
This will be useful when fixing up the sequence number generation and checks, as the rules around how sequence numbers are generated have been clarified in 802.11-2016 and later. QoS-NULL frames are explicitly marked as "any sequence number".
But for now, just create a macro and use it in the one place it's currently being used as a check - ath(4).
* Add IEEE80211_IS_QOS_NULL(). * Change the "will this frame go into the TX block-ack window" check in the ath(4) transmit path. Note this changes the check to be more specific, but both paths already had previous checks to ensure they're QoS data frames.
Locally tested:
* ath(4), AR9380, STA mode w/ AMPDU TX/RX enabled and negotiated
Differential Revision: https://reviews.freebsd.org/D47645
show more ...
|
#
c249cc38 |
| 09-Nov-2024 |
Adrian Chadd <adrian@FreeBSD.org> |
net80211: migrate FC0_TYPE_MASK / FC0_SUBTYPE_MASK frame type checks to macros
* Add macros for the management and control frame type checks that I've come across in the drivers. * Delete some now
net80211: migrate FC0_TYPE_MASK / FC0_SUBTYPE_MASK frame type checks to macros
* Add macros for the management and control frame type checks that I've come across in the drivers. * Delete some now old code (eg ath's ieee80211_is_action()) as there's now a macro for it.
Local testing:
* not yet, I have a lot of wifi devices to find and test against
Differential Revision: https://reviews.freebsd.org/D47500
show more ...
|
Revision tags: release/13.4.0, release/14.1.0, release/13.3.0, release/14.0.0 |
|
#
f156cd89 |
| 02-Oct-2023 |
Bjoern A. Zeeb <bz@FreeBSD.org> |
net80211 / drivers: remove public use of ieee80211_node_incref()
ieee80211_node_incref() is the FreeBSD implementation of ieee80211_ref_node(). Not being interested in the node returned it was used
net80211 / drivers: remove public use of ieee80211_node_incref()
ieee80211_node_incref() is the FreeBSD implementation of ieee80211_ref_node(). Not being interested in the node returned it was used as a shortcut in 3 drivers (ath, uath, wpi). Replace the call with the public KPI of ieee80211_ref_node() and ignore the result. This leaves us with the single internal call going ieee80211_ref_node() -> ieee80211_node_incref() and that should help increasing portability but also limiting the places to trace for node reference operations.
Sponsored by: The FreeBSD Foundation MFC after: 4 weeks
show more ...
|
#
685dc743 |
| 16-Aug-2023 |
Warner Losh <imp@FreeBSD.org> |
sys: Remove $FreeBSD$: one-line .c pattern
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
|
#
4d846d26 |
| 10-May-2023 |
Warner Losh <imp@FreeBSD.org> |
spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of
spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause.
Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
show more ...
|
Revision tags: release/13.2.0, release/12.4.0 |
|
#
f9a9fe46 |
| 03-Sep-2022 |
Gordon Bergling <gbe@FreeBSD.org> |
ath(4): Fix two typos in source code comments
- s/overriden/overridden/
MFC after: 3 days
|
Revision tags: release/13.1.0, release/12.3.0, release/13.0.0, release/12.2.0 |
|
#
fe5ebb23 |
| 24-Sep-2020 |
Bjoern A. Zeeb <bz@FreeBSD.org> |
Provide MS() and SM() macros for 80211 and wireless drivers.
We have (two versions) of MS() and SM() macros which we use throughout the 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 throughout the 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 of just _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 weeks Sponsored by: Rubicon Communications, LLC (d/b/a "Netgate") Differential Revision: https://reviews.freebsd.org/D26539
show more ...
|
#
9966c0f9 |
| 01-Sep-2020 |
Mateusz Guzik <mjg@FreeBSD.org> |
ath: clean up empty lines in .c and .h files
|
Revision tags: release/11.4.0 |
|
#
9a2de0c3 |
| 21-May-2020 |
Adrian Chadd <adrian@FreeBSD.org> |
[ath] reset hardware if this particular mac bug is seen.
I have to dig into why I'm seeing it on chips as late as the AR9380 era stuff (as it's marked as an AR5416 bug, but who knows!) but i'm seein
[ath] reset hardware if this particular mac bug is seen.
I have to dig into why I'm seeing it on chips as late as the AR9380 era stuff (as it's marked as an AR5416 bug, but who knows!) but i'm seeing aggregate TX frames complete with no blockack bit set. So, everything should be treated as a failure and do a hardware reset for good measure.
Tested:
* AR9380, STA mode * AR9580 (5GHz), AP mode
show more ...
|
#
051ea90c |
| 16-May-2020 |
Adrian Chadd <adrian@FreeBSD.org> |
[ath_rate_sample] Limit the tx schedules for A-MPDU ; don't take short retries into account and remove the requirement that the MCS rate is "higher" if we're considering a new rate.
Ok, another fun
[ath_rate_sample] Limit the tx schedules for A-MPDU ; don't take short retries into account and remove the requirement that the MCS rate is "higher" if we're considering a new rate.
Ok, another fun one.
* In order for reliable non-software retried higher MCS rates, the TX schedules (inconsistently!) use hard-coded lower rates at the end of the schedule. Now, hard-coded is a problem because (a) it means that aggregate formation is limited by the SLOWEST rate, so I never formed large AMDU frames for 3 stream rates, and (b) if the AP disables lower rates as base rates, it complains about "unknown rix" every frame you transmit at that rate.
So, for now just disable the third and fourth schedule entry for AMPDUs. Now I'm forming 32k and 64k aggregates for the higher density MCS rates much more reliably.
It would be much nicer if the rate schedule stuff wasn't fixed but instead I'd just populate ath_rc_series[] when I fetch the rates. This is all a holdover of ye olde pre-11n stuff and I really just need to nuke it.
But for now, ye hack.
* The check for "is this MCS rate better" based on MCS itself is just garbage. It meant things like going MCS0->7 would be fine, and say 0->8->16 is fine, (as they're equivalent encoding but 1,2,3 spatial streams), BUT it meant going something like MCS7->11 would fail even though it's likely that MCS11 would just be better, both for EWMA/BER and throughput.
So for now just use the average tx time. The "right" way for this comparison would be to compare PHY bitrates rather than MCS / rate indexes, but I'm not yet there. The bit rates ARE available in the PHY index, but honestly I have a lot of other cleaning up to here before I think about that.
* Don't include the RTS/CTS retry count (and thus time) into the average tx time caluation. It just makes temporarily failures make the rate look bad by QUITE A LOT, as RTS/CTS exchanges are (a) long, and (b) mostly irrelevant to the actual rate being tried. If we keep hitting RTS/CTS failures then there's something ELSE wrong on the channel, not our selected rate.
show more ...
|
#
cce63444 |
| 15-May-2020 |
Adrian Chadd <adrian@FreeBSD.org> |
[ath] [ath_rate] Extend ath_rate_sample to better handle 11n rates and aggregates.
My initial rate control code was .. suboptimal. I wanted to at least get MCS rates sent, but it didn't do anywhere
[ath] [ath_rate] Extend ath_rate_sample to better handle 11n rates and aggregates.
My initial rate control code was .. suboptimal. I wanted to at least get MCS rates sent, but it didn't do anywhere near enough to handle low signal level links or remotely keep accurate statistics.
So, 8 years later, here's what I should've done back then.
* Firstly, I wasn't at all tracking packet sizes other than the two buckets (250 and 1600 bytes.) So, extend it to include 4096, 8192, 16384, 32768 and 65536. I may go add 2048 at some point if I find it's useful.
This is important for a few reasons. First, when forming A-MPDU or AMSDU aggregates the frame sizes are larger, and thus the TX time calculation is woefully, increasingly wrong. Secondly, the behaviour of 802.11 channels isn't some fixed thing, both due to channel conditions and radios themselves. Notably, there was some observations done a few years ago on 11n chipsets which noticed longer aggregates showed an increase in failed A-MPDU sub-frame reception as you got further along in the transmit time. It could be due to a variety of things - transmitter linearity, channel conditions changing, frequency/phase drift, etc - but the observation was to potentially form shorter aggregates to improve BER.
* .. and then modify the ath TX path to report the length of the aggregate sent, so as the statistics kept would line up with the correct bucket.
* Then on the rate control look-up side - i was also only using the first frame length for an A-MPDU rate control lookup which isn't good enough here. So, add a new method that walks the TID software queue for that node to find out what the likely length of data available is. It isn't ALL of the data in the queue because we'll only ever send enough data to fit inside the block-ack window, so limit how many bytes we return to roughly what ath_tx_form_aggr() would do.
* .. and cache that in the first ath_buf in the aggregate so it and the eventual AMPDU length can be returned to the rate control code.
* THEN, modify the rate control code to look at them both when deciding which bucket to attribute the sent frame on. I'm erring on the side of caution and using the size bucket that the lookup is based on.
Ok, so now the rate lookups and statistics are "more correct". However, MCS rates are not the same as 11abg rates in that they're not a monotonically incrementing set of faster rates and you can't assume that just because a given MCS rate fails, the next higher one wouldn't work better or be a lower average tx time.
So, I had to do a bunch of surgery to the best rate and sample rate math. This is the bit that's a WIP.
* First, simplify the statistics updates (update_stats()) to do a single pass on all rates. * Next, make sure that each rate average tx time is updated based on /its/ failure/success. Eg if you sent a frame with { MCS15, MCS12, MCS8 } and MCS8 succeeded, MCS15 and MCS 12 would have their average tx time updated for /their/ part of the transmission, not the whole transmission. * Next, EWMA wasn't being fully calculated based on the /failures/ in each of the rate attempts. So, if MCS15, MCS12 failed above but MCS8 didn't, then ensure that the statistics noted that /all/ subframes failed at those rates, rather than the eventual set of transmitted/sent frames. This ensures the EWMA /and/ average TX time are updated correctly. * When picking a sample rate and initial rate, probe rates aroud the current MCS but limit it to MCS0..7 /for all spatial streams/, rather than doing crazy things like hitting MCS7 and then probing MCS8 - MCS8 is basically MCS0 but two spatial streams. It's a /lot/ slower than MCS7. Also, the reverse is true - if we're at MCS8 then don't probe MCS7 as part of it, it's not likely to succeed. * Fix bugs in pick_best_rate() where I was /immediately/ choosing the highest MCS rate if there weren't any frames yet transmitted. I was defaulting to 25% EWMA and .. then each comparison would accept the higher rate. Just skip those; sampling will fill in the details.
So, this seems to work a lot better. It's not perfect; I'm still seeing a lot of instability around higher MCS rates because there are bursts of loss/retransmissions that aren't /too/ bad. But i'll keep iterating over this and tidying up my hacks.
Ok, so why this still something I'm poking at? rather than porting minstrel_ht?
ath_rate_sample tries to minimise airtime, not maximise throughput. I have extended it with an EWMA based on sub-frame success/failures - high MCS rates that have partially successful receptions still show super short average frame times, but a /lot/ of retransmits have to happen for that to work. So for MCS rates I also track this EWMA and ensure that the rates I'm choosing don't have super crappy packet failures. I don't mind not getting lower peak throughput versus minstrel_ht; instead I want to see if I can make "minimise airtime" work well.
Tested:
* AR9380, STA mode * AR9344, STA mode * AR9580, STA/AP mode
show more ...
|
#
84f950a5 |
| 13-May-2020 |
Adrian Chadd <adrian@FreeBSD.org> |
[ath] [ath_rate] Add some extra data into the rate control lookup.
Right now (well, since I did this in 2011/2012) the rate control code makes some super bad choices for 11n aggregates/rates, and it
[ath] [ath_rate] Add some extra data into the rate control lookup.
Right now (well, since I did this in 2011/2012) the rate control code makes some super bad choices for 11n aggregates/rates, and it tracks statistics even more questionably.
It's been long enough and I'm now trying to use it again daily, so let's start by:
* telling the rate control code if it's an aggregate or not; * being clearer about the TID - yes it can be extracted from the ath_buf but this way it can be overridden by the caller without changing the TID itself.
(This is for doing experiments with voice/video QoS at some point..)
* Return an optional field to limit how long the aggregate is in microseconds. Right now the rate control code supplies a rate table and the ath aggr form code will look at the rate table and limit the aggregate size to 4ms at the slowest rate. Yeah, this is pretty terrible.
* Add some more TODO comments around handling txpower, rate and handling filtered frames status so if I continue to have spoons for this I can go poke at it.
show more ...
|
Revision tags: release/12.1.0, release/11.3.0, release/12.0.0, release/11.2.0 |
|
#
4b49587c |
| 06-Jan-2018 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r327341 through r327623.
|
#
9fbe631a |
| 02-Jan-2018 |
Adrian Chadd <adrian@FreeBSD.org> |
[net80211] convert all of the WME use over to a temporary copy of WME info.
This removes the direct WME info access in the ieee80211com struct and instead provides a method of fetching the data. Ri
[net80211] convert all of the WME use over to a temporary copy of WME info.
This removes the direct WME info access in the ieee80211com struct and instead provides a method of fetching the data. Right now it's a no-op but eventually it'll turn into a per-VAP method for drivers that support it (eg iwn, iwm, upcoming ath10k work) as things like p2p support require this kind of behaviour.
Tested:
* ath(4), STA and AP mode
TODO:
* yes, this is slightly stack size-y, but it is an important first step to get drivers migrated over to a sensible WME API. A lot of per-phy things need to be converted to per-VAP before P2P, 11ac firmware, etc stuff shows up.
show more ...
|
#
718cf2cc |
| 27-Nov-2017 |
Pedro F. Giffuni <pfg@FreeBSD.org> |
sys/dev: further adoption of SPDX licensing ID tags.
Mainly focus on files that use BSD 2-Clause license, however the tool I was 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 I was using misidentified many licenses so this was mostly a manual - error prone - task.
The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts.
show more ...
|
Revision tags: release/10.4.0, release/11.1.0 |
|
#
15e58d4d |
| 19-Mar-2017 |
Adrian Chadd <adrian@FreeBSD.org> |
[ath] prepare for "correct" group (bcast/mcast) address frame handling and software/hardware queue TID mapping.
When I initially did this 11n TX work in days of yonder, my 802.11 standards clue was
[ath] prepare for "correct" group (bcast/mcast) address frame handling and software/hardware queue TID mapping.
When I initially did this 11n TX work in days of yonder, my 802.11 standards clue was ... not as finely tuned. One of the things in 802.11-2012 (which I guess technically was after I did this work, but I'm sure it was like this in the previous rev?) is that among other traffic classes, three things are important:
* group addressed frames should be default non-QoS, even if they're QoS frames, and * group addressed frames should have a seqno out of a different space than the per-TID QoS one; and because of this * group addressed frames, being non-QoS, should never be in the Block-ACK window for TX.
Now, net80211 and now this code cheats by using the non-QOS TID, but ideally we'd introduce a separate seqno space just for multicast/group traffic for TX and RX comparison.
Later extensions (eg reliable multicast / multimedia) express what one should do when doing multicast traffic in a TID. Now, technically we /could/ do group traffic as QoS traffic and throw it into a per-TID seqno space, but this definitely introduces ordering issues when you take into account things like CABQ behaviour. (Ie, if some traffic in the TID goes into the CABQ and some doesn't, because it's doing a split of multicast and non-multicast traffic, then you have seqno ordering issues.)
So, until someone implements 802.11vv reliable multicast / multimedia extensions, group traffic is non-QoS.
Next, software/hardware queue TID mapping. In the past I believed the WME tagging of frames because well, net80211 had a habit of tagging things like management traffic with it. But, then we also map QoS traffic categories to TIDs as well. So, we should obey the TID! But! then it put some management traffic into higher WME categories too, as those frames don't have QoS TIDs. But! It'd do things like put things like QoS action frames into higher WME categories, when they should be kept in-order with the rest of the traffic for that TID. So! Given all of this, the ath(4) driver does overrides to not trust the WME category.
I .. am undoing some of this. Now, the TID has a 1:1 mapping to the hardware queue. The TID is the primary source of truth now for all QoS traffic. The WME is only used for non-QoS traffic. This now means that any TID traffic queued should be consistently queued regardless of WME, so things like the "TX finished, do more TX" that is occuring right now for transmit handling should be "better".
The consistent {TID, WME} -> hardware queue mapping is important for transmit completion. It's used to schedule more traffic for that particular TID, because that {many TID}:{1 TXQ} mapping in ath_tx_tid_sched() is used for driving completion. Ie, when the hardware queue completes, it'll walk that list of scheduled TIDs attached to that TXQ.
The eventual aim is to get ready for some other features around putting some data into other hardware queues (eg for better PS-POLL support, uAPSD, support, correct-er TDMA support, etc) which requires that I tidy all of this up in preparation for then introducing further TID scheduling that isn't linked to a hardware TXQ (likely a per-WME, per-TID driver queue, and a per-node driver queue) to enable that.
Tested:
* AR9380, STA mode * AR9380, AR9580, AP mode
show more ...
|
#
9b3ece1c |
| 04-Feb-2017 |
Enji Cooper <ngie@FreeBSD.org> |
MFhead@r313243
|
#
71fe94fd |
| 01-Feb-2017 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r312968 through r313054.
|
#
39d54676 |
| 31-Jan-2017 |
Adrian Chadd <adrian@FreeBSD.org> |
[ath] log seqno, type and subtype when assigning sequence numbers for A-MPDU.
This is just to improve adrian-debugging.
|
#
2004ce3f |
| 24-Jan-2017 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r312624 through r312719.
|
#
57af292d |
| 23-Jan-2017 |
Adrian Chadd <adrian@FreeBSD.org> |
[ath] fix thresholds for deciding to queue to the software queue and populate hardware frames
This is two fixes, which establishes what I /think/ is pretty close to the theoretical PHY maximum speed
[ath] fix thresholds for deciding to queue to the software queue and populate hardware frames
This is two fixes, which establishes what I /think/ is pretty close to the theoretical PHY maximum speed on the AR9380 devices.
* When doing A-MPDU on a TID, don't queue to the hardware directly if the hardware queue is busy. This gives us time to get more packets queued up (and the hardware is busy, so there's no point in queuing more to the hardware right now) to potentially form an A-MPDU.
This fixes up the throughput issue I was seeing where a couple hundred single frames were being sent a second interspersed between A-MPDU frames. It just happened that the software queue had exactly one frame in it at that point. Queuing it until the hardware finishes transmitting isn't exactly costly.
* When determining whether to dequeue from a software node/TID queue into the hardware queue, fix up the checks to work right for EDMA chips (ar9380 and later.) Before it was not dispatching anything until the FIFO was empty. Now we allow it to dispatch another aggregate up to the hardware aggregate limit, like I intended with the earlier work.
This allows a 5GHz HT40, short-GI, "htprotmode off" test at MCS23 to achieve 357 Mbit/sec in a one-way UDP test. The stars have to be aligned /just right/ so there are no retries but it can happen. Just don't expect it to work in an OTA test if your 2yo is running around the room - MCS23 is very very sensitive to channel conditions.
Tested:
* AR9380 STA (test) -> AR9580 hostap
TODO:
* More thorough testing on pre-AR9380 chips (AR5416, AR9160, AR9280) * (Finally) teach ath_rate_sample about throughput/latency rather than air time, so I can get good transmit rates with a 2yo running around.
show more ...
|
Revision tags: release/11.0.1 |
|
#
8c4282b3 |
| 24-Sep-2016 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r305892 through r306302.
|
Revision tags: release/11.0.0 |
|
#
887a6324 |
| 20-Sep-2016 |
Andriy Voskoboinyk <avos@FreeBSD.org> |
net80211: remove IEEE80211_RADIOTAP_TSFT field from transmit definitions.
This field may be used for received frames only.
Differential Revision: https://reviews.freebsd.org/D3826 Differential Revi
net80211: remove IEEE80211_RADIOTAP_TSFT field from transmit definitions.
This field may be used for received frames only.
Differential Revision: https://reviews.freebsd.org/D3826 Differential Revision: https://reviews.freebsd.org/D3827
show more ...
|
#
93badfa1 |
| 16-Sep-2016 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r305687 through r305890.
|
#
5abc0b25 |
| 12-Sep-2016 |
Adrian Chadd <adrian@FreeBSD.org> |
[ath] set the relevant TOA/TOD locationing bits when trying to do locationing.
* Don't do RTS/CTS - experiments show that we get ACK frames for each of them and this ends up causing the timestamps
[ath] set the relevant TOA/TOD locationing bits when trying to do locationing.
* Don't do RTS/CTS - experiments show that we get ACK frames for each of them and this ends up causing the timestamps to look all funny. * Set the HAL_TXDESC_POS bit, so the AR9300 HAL sets up the hardware to return location and CSI information.
show more ...
|