Skip to content

Commit 0cfcefe

Browse files
Michal Kaziorjmberg-intel
authored andcommitted
mac80211: support reporting A-MSDU subframes individually
Some devices may not be able to report A-MSDUs in single buffers. Drivers for such devices were forced to re-assemble A-MSDUs which would then be eventually disassembled by mac80211. This could lead to CPU cache thrashing and poor performance. Since A-MSDU has a single sequence number all subframes share it. This was in conflict with retransmission/duplication recovery (IEEE802.11-2012: 9.3.2.10). Patch introduces a new flag that is meant to be set for all individually reported A-MSDU subframes except the last one. This ensures the last_seq_ctrl is updated after the last subframe is processed. If an A-MSDU is actually a duplicate transmission all reported subframes will be properly discarded. Signed-off-by: Michal Kazior <michal.kazior@tieto.com> [johannes: add braces that were missing even before] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
1 parent 15e230a commit 0cfcefe

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

‎include/net/mac80211.h‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -829,6 +829,15 @@ ieee80211_tx_info_clear_status(struct ieee80211_tx_info *info)
829829
* @RX_FLAG_STBC_MASK: STBC 2 bit bitmask. 1 - Nss=1, 2 - Nss=2, 3 - Nss=3
830830
* @RX_FLAG_10MHZ: 10 MHz (half channel) was used
831831
* @RX_FLAG_5MHZ: 5 MHz (quarter channel) was used
832+
* @RX_FLAG_AMSDU_MORE: Some drivers may prefer to report separate A-MSDU
833+
* subframes instead of a one huge frame for performance reasons.
834+
* All, but the last MSDU from an A-MSDU should have this flag set. E.g.
835+
* if an A-MSDU has 3 frames, the first 2 must have the flag set, while
836+
* the 3rd (last) one must not have this flag set. The flag is used to
837+
* deal with retransmission/duplication recovery properly since A-MSDU
838+
* subframes share the same sequence number. Reported subframes can be
839+
* either regular MSDU or singly A-MSDUs. Subframes must not be
840+
* interleaved with other frames.
832841
*/
833842
enum mac80211_rx_flags {
834843
RX_FLAG_MMIC_ERROR = BIT(0),
@@ -859,6 +868,7 @@ enum mac80211_rx_flags {
859868
RX_FLAG_STBC_MASK = BIT(26) | BIT(27),
860869
RX_FLAG_10MHZ = BIT(28),
861870
RX_FLAG_5MHZ = BIT(29),
871+
RX_FLAG_AMSDU_MORE = BIT(30),
862872
};
863873

864874
#define RX_FLAG_STBC_SHIFT 26

‎net/mac80211/rx.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -995,8 +995,9 @@ ieee80211_rx_h_check(struct ieee80211_rx_data *rx)
995995
rx->sta->num_duplicates++;
996996
}
997997
return RX_DROP_UNUSABLE;
998-
} else
998+
} else if (!(status->flag & RX_FLAG_AMSDU_MORE)) {
999999
rx->sta->last_seq_ctrl[rx->seqno_idx] = hdr->seq_ctrl;
1000+
}
10001001
}
10011002

10021003
if (unlikely(rx->skb->len < 16)) {

0 commit comments

Comments
 (0)