#
c5940c30 |
| 09-Mar-2012 |
Adrian Chadd <adrian@FreeBSD.org> |
Document that we may end up with some suboptimal handling of data frames with stations in power saving mode.
I'm not (yet) sure how to handle TX'ing aggregates frames to stations that are in power s
Document that we may end up with some suboptimal handling of data frames with stations in power saving mode.
I'm not (yet) sure how to handle TX'ing aggregates frames to stations that are in power saving mode, or whether that's even a feasible thing to do. So in order to (mostly) not forget, leave a couple of comments in the code.
The code presently assumes that the aggregation TID state for an ath_node is locked not by the ath_node lock or a node+TID lock, but behind the hardware queue said TID maps to. This assumption is going to be incorrect for stations in power saving mode as we'll be TX'ing frames on the multicast queue.
In any case, I'm afraid its a "later problem". :/
show more ...
|
#
b1f3262c |
| 09-Mar-2012 |
Adrian Chadd <adrian@FreeBSD.org> |
Correctly initialise the TXQ link pointer to the last descriptor in the last buffer in the list.
The current behaviour (due to me, so pointy hat is firmly on my head here) was incorrect - it was set
Correctly initialise the TXQ link pointer to the last descriptor in the last buffer in the list.
The current behaviour (due to me, so pointy hat is firmly on my head here) was incorrect - it was setting the link pointer to the last descriptor of the _first_ buffer in the TXQ. Instead, it should have set it to the last descriptor in the _last_ buffer in the TXQ.
This showed up as occasional TX stalls with frames in the TXQ but no TX progress being made. Further inspection showed the TXQ looked like it contained multiple "lists" of frames - there'd be a list of correct frames, then a NULL link pointer, but there'd be a next buffer in the list.
Since this code is only called upon an interface reset, it's likely this only began showing up when I started doing stress testing in environments which annoy the radios enough to cause lockups.
I've not yet any TX stalls with this patch applied.
PR: kern/165866
show more ...
|
#
8fa0b743 |
| 23-Jan-2012 |
Xin LI <delphij@FreeBSD.org> |
IFC @230489 (pending review).
|
#
d4365d16 |
| 11-Jan-2012 |
Adrian Chadd <adrian@FreeBSD.org> |
style(9) changes. This shouldn't change functionality.
|
#
80dbff4e |
| 04-Jan-2012 |
Sean Bruno <sbruno@FreeBSD.org> |
IFC to head to catch up the bhyve branch
Approved by: grehan@
|
Revision tags: release/9.0.0 |
|
#
c0711b97 |
| 01-Jan-2012 |
Adrian Chadd <adrian@FreeBSD.org> |
If frames are dumped out of the queue, let's at least see what they are.
This shows that the majority of the weird traffic I see here are probe frames that haven't been sent out, but I can also trig
If frames are dumped out of the queue, let's at least see what they are.
This shows that the majority of the weird traffic I see here are probe frames that haven't been sent out, but I can also trigger this condition by doing ICMP w/ -i 0.3 - enough to trigger the TX during actual scanning, but not fast enough to stop scanning from occuring.
PR: kern/163689
show more ...
|
#
2d3d4776 |
| 23-Nov-2011 |
Adrian Chadd <adrian@FreeBSD.org> |
Flesh out the TX aggregation completion statistics.
* Failall is now named just that. * Add TX ok and TX fail, for aggregate frame sub-frames.
This will break athstats; a followup commit wil resolv
Flesh out the TX aggregation completion statistics.
* Failall is now named just that. * Add TX ok and TX fail, for aggregate frame sub-frames.
This will break athstats; a followup commit wil resolve this.
Sponsored by: Hobnob, Inc.
show more ...
|
#
3ee1a36e |
| 22-Nov-2011 |
Peter Grehan <grehan@FreeBSD.org> |
IFC @ r227804
Pull in the virtio drivers from head.
|
#
ef27340c |
| 18-Nov-2011 |
Adrian Chadd <adrian@FreeBSD.org> |
Flesh out some slightly dirty reset/channel change serialisation code for the ath(4) driver.
Currently, there's nothing stopping reset, channel change and general TX/RX from overlapping with each ot
Flesh out some slightly dirty reset/channel change serialisation code for the ath(4) driver.
Currently, there's nothing stopping reset, channel change and general TX/RX from overlapping with each other. This wasn't a big deal with pre-11n traffic as it just results in some dropped frames. It's possible this may have also caused some inconsistencies and badly-setup hardware.
Since locks can't be held across all of this (the Linux solution) due to LORs with the network stack locks, some state counter variables are used to track what parts of the code the driver is currently in.
When the hardware is being reset, it disables the taskqueue and waits for pending interrupts, tx, rx and tx completion before it begins the reset or channel change.
TX and RX both abort if called during an active reset or channel change.
Finally, the reset path now doesn't flush frames if ATH_RESET_NOLOSS is set. Instead, completed TX and RX frames are passed back up to net80211 before the reset occurs.
This is not without problems:
* Raw frame xmit are just dropped, rather than placed on a queue. The net80211 stack should be the one which queues these frames rather than the driver.
* It's all very messy. It'd be better if these hardware operations were serialised on some kind of work queue, rather than hoping they can be run in parallel.
* The taskqueue block/unblock may occur in parallel with the newstate() function - which shuts down the taskqueue and restarts it once the new state is known. It's likely these operations should be refcounted so the taskqueue is restored once no other areas in the code wish to suspend operations.
* .. interrupt disable/enable should likely be refcounted as well.
With this work, the driver does not drop frames during stuck beacon or fatal errors and thus 11n traffic continues to run correctly. Default and full resets however do still drop frames and it's possible this may occur, causing traffic loss and session stalls.
Sponsored by: Hobnob, Inc.
show more ...
|
#
38962489 |
| 09-Nov-2011 |
Adrian Chadd <adrian@FreeBSD.org> |
If software retransmit occurs with an ath_buf marked ATH_BUF_BUSY, it's cloned and that clone is retransmitted. This means that the ath_buf pointer squirreled away on the baw window array is suddenly
If software retransmit occurs with an ath_buf marked ATH_BUF_BUSY, it's cloned and that clone is retransmitted. This means that the ath_buf pointer squirreled away on the baw window array is suddenly wrong and was causing all kinds of console output.
This updates the pointer in that particular BAW slot to the new ath_buf after ensuring that:
* the new and old buffers have the same seqno; * the current slot pointer matches the old buffer pointer.
This quietens the debugging output (again), restoring said debugging to only signify when a broken condition has occured.
Sponsored by: Hobnob, Inc.
show more ...
|
#
eb6f0de0 |
| 08-Nov-2011 |
Adrian Chadd <adrian@FreeBSD.org> |
Introduce TX aggregation and software TX queue management for Atheros AR5416 and later wireless devices.
This is a very large commit - the complete history can be found in the user/adrian/if_ath_tx
Introduce TX aggregation and software TX queue management for Atheros AR5416 and later wireless devices.
This is a very large commit - the complete history can be found in the user/adrian/if_ath_tx branch.
Legacy (ie, pre-AR5416) devices also use the per-software TXQ support and (in theory) can support non-aggregation ADDBA sessions. However, the net80211 stack doesn't currently support this.
In summary:
TX path:
* queued frames normally go onto a per-TID, per-node queue * some special frames (eg ADDBA control frames) are thrown directly onto the relevant hardware queue so they can go out before any software queued frames are queued. * Add methods to create, suspend, resume and tear down an aggregation session. * Add in software retransmission of both normal and aggregate frames. * Add in completion handling of aggregate frames, including parsing the block ack bitmap provided by the hardware. * Write an aggregation function which can assemble frames into an aggregate based on the selected rate control and channel configuration. * The per-TID queues are locked based on their target hardware TX queue. This matches what ath9k/atheros does, and thus simplified porting over some of the aggregation logic. * When doing TX aggregation, stick the sequence number allocation in the TX path rather than net80211 TX path, and protect it by the TXQ lock.
Rate control:
* Delay rate control selection until the frame is about to be queued to the hardware, so retried frames can have their rate control choices changed. Frames with a static rate control selection have that applied before each TX, just to simplify the TX path (ie, not have "static" and "dynamic" rate control special cased.) * Teach ath_rate_sample about aggregates - both completion and errors. * Add an EWMA for tracking what the current "good" MCS rate is based on failure rates.
Misc:
* Introduce a bunch of dirty hacks and workarounds so TID mapping and net80211 frame inspection can be kept out of the net80211 layer. Because of the way this code works (and it's from Atheros and Linux ath9k), there is a consistent, 1:1 mapping between TID and AC. So we need to ensure that frames going to a specific TID will _always_ end up on the right AC, and vice versa, or the completion/locking will simply get very confused. I plan on addressing this mess in the future.
Known issues:
* There is no BAR frame transmission just yet. A whole lot of tidying up needs to occur before BAR frame TX can occur in the "correct" place - ie, once the TID TX queue has been drained.
* Interface reset/purge/etc results in frames in the TX and RX queues being removed. This creates holes in the sequence numbers being assigned and the TX/RX AMPDU code (on either side) just hangs.
* There's no filtered frame support at the present moment, so stations going into power saving mode will simply have a number of frames dropped - likely resulting in a traffic "hang".
* Raw frame TX is going to just not function with 11n aggregation. Likely this needs to be modified to always override the sequence number if the frame is going into an aggregation session. However, general raw frame injection currently doesn't work in general in net80211, so let's just ignore this for now until this is sorted out.
* HT protection is just not implemented and won't be until the above is sorted out. In addition, the AR5416 has issues RTS protecting large aggregates (anything >8k), so the work around needs to be ported and tested. Thus, this will be put on hold until the above work is complete.
* The rate control module 'sample' is the only currently supported module; onoe/amrr haven't been tested and have likely bit rotted a little. I'll follow up with some commits to make them work again for non-11n rates, but they won't be updated to handle 11n and aggregation. If someone wishes to do so then they're welcome to send along patches.
* .. and "sample" doesn't really do a good job of 11n TX. Specifically, the metrics used (packet TX time and failure/success rates) isn't as useful for 11n. It's likely that it should be extended to take into account the aggregate throughput possible and then choose a rate which maximises that. Ie, it may be acceptable for a higher MCS rate with a higher failure to be used if it gives a more acceptable throughput/latency then a lower MCS rate @ a lower error rate. Again, patches will be gratefully accepted.
Because of this, ATH_ENABLE_11N is still not enabled by default.
Sponsored by: Hobnob, Inc. Obtained from: Linux, Atheros
show more ...
|
#
6edf1dc7 |
| 08-Nov-2011 |
Adrian Chadd <adrian@FreeBSD.org> |
Change the descriptor logic to use bf_lastds to point to the last descriptor, rather than using the maths involving bf_desc[bf_nseg - 1].
When doing TX aggregation, the status will be updated in the
Change the descriptor logic to use bf_lastds to point to the last descriptor, rather than using the maths involving bf_desc[bf_nseg - 1].
When doing TX aggregation, the status will be updated in the -final- descriptor of the -final- subframe in an aggregate. Thus bf_lastds may point to the last descriptor in a completely different ath_buf.
Sponsored by: Hobnob, Inc.
show more ...
|
#
6b349e5a |
| 08-Nov-2011 |
Adrian Chadd <adrian@FreeBSD.org> |
Migrate the STAILQ lists to TAILQs.
A bunch of the 11n TX aggregation logic wants to traverse lists of buffers in various ways. In order to provide O(1) behaviour in this instance, use TAILQs.
This
Migrate the STAILQ lists to TAILQs.
A bunch of the 11n TX aggregation logic wants to traverse lists of buffers in various ways. In order to provide O(1) behaviour in this instance, use TAILQs.
This does blow out the memory footprint and CPU cycles slightly for some of these operations. I may convert some of these back to STAILQs once the rest of the software transmit queue handling has been stabilised.
Sponsored by: Hobnob, Inc.
show more ...
|
#
4f545a2c |
| 28-Mar-2011 |
Adrian Chadd <adrian@FreeBSD.org> |
Add in HT protection but disable it by default.
I'll clear how it's supposed to work with Bernhard and then look at enabling this in the correct situations.
But this -does- enable HT RTS protection
Add in HT protection but disable it by default.
I'll clear how it's supposed to work with Bernhard and then look at enabling this in the correct situations.
But this -does- enable HT RTS protection (using the appropriate legacy rates) if this bit of code is enabled.
show more ...
|
#
db06a6f4 |
| 12-Mar-2011 |
Marcel Moolenaar <marcel@FreeBSD.org> |
Merge svn+ssh://svn.freebsd.org/base/head@219553
|
#
e42b5dba |
| 22-Feb-2011 |
Adrian Chadd <adrian@FreeBSD.org> |
Shuffle around the RTS/CTS rate/duration logic.
* Turn ath_tx_calc_ctsduration() into a function that returns the ctsduration, or -1 for HT rates; * add a printf() to ath_tx_calc_ctsduration() whi
Shuffle around the RTS/CTS rate/duration logic.
* Turn ath_tx_calc_ctsduration() into a function that returns the ctsduration, or -1 for HT rates; * add a printf() to ath_tx_calc_ctsduration() which will be very loud if somehow that function is called with an MCS rate; * Add ath_tx_get_rtscts_rate() which returns the RTS/CTS rate to use for the given data rate, incl. the short preamble flag; * Only call ath_tx_calc_ctsduration() for non-11n chipsets; 11n chipsets don't require the rtscts duration to be calculated.
show more ...
|
#
9b4fcf85 |
| 18-Feb-2011 |
Marcel Moolenaar <marcel@FreeBSD.org> |
Merge svn+ssh://svn.freebsd.org/base/head@218816
|
Revision tags: release/7.4.0_cvs, release/8.2.0_cvs, release/7.4.0, release/8.2.0 |
|
#
bf26df36 |
| 12-Feb-2011 |
Adrian Chadd <adrian@FreeBSD.org> |
The current code used the fields in ath_set11nratescenario() . Use them correctly:
* pass in whether to allow the hardware to override the duration field in the main data frame (durupdate_en) - P
The current code used the fields in ath_set11nratescenario() . Use them correctly:
* pass in whether to allow the hardware to override the duration field in the main data frame (durupdate_en) - PS_POLL frames in particular don't have the duration bit overriden; * there's no rts/cts duration here; that's done elsehwere
show more ...
|
#
c1782ce0 |
| 03-Feb-2011 |
Adrian Chadd <adrian@FreeBSD.org> |
Modify the TX path to set and use the 11n rate scenario bits.
This isn't strictly required to TX (at least non-agg and non-HT40, non-short-GI) frames; but as it needs to be done anyway, just get it
Modify the TX path to set and use the 11n rate scenario bits.
This isn't strictly required to TX (at least non-agg and non-HT40, non-short-GI) frames; but as it needs to be done anyway, just get it done.
Linux ath9k uses the rate scenario style path for -all- packets, legacy or otherwise. This code does much the same.
Beacon TX still uses the legacy, non-rate-scenario TX descriptor setup. Ath9k also does this.
This 11n rate scenario path is only called for chips in the AR5416 HAL; legacy chips use the previous interface for TX'ing.
show more ...
|
#
79f02dbf |
| 01-Feb-2011 |
Adrian Chadd <adrian@FreeBSD.org> |
Refator the common code which calculates the 802.11g protection duration.
|
#
81a82688 |
| 01-Feb-2011 |
Adrian Chadd <adrian@FreeBSD.org> |
* Add a rather hacky "does this speak the 11n TX descriptor format" function; which will be later used by the TX path to determine whether to use the extended features or not.
* Break out the de
* Add a rather hacky "does this speak the 11n TX descriptor format" function; which will be later used by the TX path to determine whether to use the extended features or not.
* Break out the descriptor chaining logic into a separate function; again so it can be switched out later on for the 11n version when needed.
* Refactor out the encryption-swizzling code that's common in the raw and normal TX path.
show more ...
|
#
b8e788a5 |
| 29-Jan-2011 |
Adrian Chadd <adrian@FreeBSD.org> |
Migrate the TX path code out of if_ath and into a separate source file.
There's two reasons for this:
* the raw and non-raw TX path shares a lot of duplicate code which should be refactored; * th
Migrate the TX path code out of if_ath and into a separate source file.
There's two reasons for this:
* the raw and non-raw TX path shares a lot of duplicate code which should be refactored; * the 11n-ready chip TX path needs a little reworking.
show more ...
|