path: root/sys/net80211/ieee80211_ht.h
diff options
authorAdrian Chadd <adrian@FreeBSD.org>2020-06-13 23:35:22 +0000
committerAdrian Chadd <adrian@FreeBSD.org>2020-06-13 23:35:22 +0000
commite81d909274198da222c9efb11ccbbc651ebee09e (patch)
tree8e0a37744bf1b2c247a450ab9b73f24dd936e007 /sys/net80211/ieee80211_ht.h
parentea3d5fd9df90708b5b996a96dc694c7939e0305d (diff)
[net80211] Handle offloaded AMSDU in AMPDU reordering.
In the 11n world, most NICs did A-MPDU receive/transmit offloading but not A-MSDU offloading. So, the net80211 A-MPDU receive path would just receive MPDUs, do the reordering bit, pass it up to the rest of net80211 for crypto decap and then do A-MSDU decap before throwing ethernet frames up to the rest of the system. However 11ac and 11ax NICs are increasingly doing A-MSDU offload (and newer 11ax stuff does socket offload, but hey I don't want to scare people JUST yet) - so although A-MPDU reordering may be done in the OS, A-MSDUs look like a normal MPDU. This means that all the MSDUs are actually faked into a set of MPDUs with matching 802.11 header - the sequence number, QoS header and any encryption verification bits (like IV) are just copied. This shows up as MASSIVE packet loss in net80211, cause after the first MPDU we just toss the rest. (And don't get me started about ethernet decap with A-MPDU host reordering; we'll have to cross that bridge for later 11ac and 11ax bits too.) Anyway, this work changes each A-MPDU reorder slot into an mbufq. The mbufq is treated as a whole set of frames to pass up to the stack and reordered/de-duped as a group. The last frame in the reorder list is checked to see if it's an A-MSDU final frame so any duplicates are correctly tossed rather than double-received. Other than that, the rest of the logic is unchanged. The previous commit did a small subset of this - if there wasn't any reordering going on then it'd accept the A-MSDUs. This is the rest of the needed work. This is a no-op for 11n NICs doing A-MPDU reordering but needing software A-MSDU decap - they aren't tagged as A-MSDU and so any subsequent frames added to the reorder slot are tossed. Tested: * QCA9880 (ath10k/athp) - STA/AP mode; * RT3593 (if_rsu) - 11n STA+DWDS mode (I'm committing through it rn); * QCA9380 (if_ath) - STA/AP mode.
Notes: svn path=/head/; revision=362157
Diffstat (limited to 'sys/net80211/ieee80211_ht.h')
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/net80211/ieee80211_ht.h b/sys/net80211/ieee80211_ht.h
index 05fb433ad4a1..c867d3a50513 100644
--- a/sys/net80211/ieee80211_ht.h
+++ b/sys/net80211/ieee80211_ht.h
@@ -33,6 +33,8 @@
* 802.11n protocol implementation definitions.
+#include <sys/mbuf.h>
#define IEEE80211_AGGR_BAWMAX 64 /* max block ack window size */
/* threshold for aging overlapping non-HT bss */
#define IEEE80211_NONHT_PRESENT_AGE msecs_to_ticks(60*1000)
@@ -169,7 +171,7 @@ struct ieee80211_rx_ampdu {
uint16_t rxa_wnd; /* BA window size */
int rxa_age; /* age of oldest frame in window */
int rxa_nframes; /* frames since ADDBA */
- struct mbuf *rxa_m[IEEE80211_AGGR_BAWMAX];
+ struct mbufq rxa_mq[IEEE80211_AGGR_BAWMAX];
void *rxa_private;
uint64_t rxa_pad[3];