aboutsummaryrefslogtreecommitdiffstats
path: root/package/kernel/mac80211/patches/387-mac80211-always-account-for-A-MSDU-header-changes.patch
diff options
context:
space:
mode:
authorKoen Vandeputte <koen.vandeputte@ncentric.com>2018-09-04 15:09:48 +0200
committerKoen Vandeputte <koen.vandeputte@ncentric.com>2018-09-07 17:21:24 +0200
commit77024a9d953d394b02226367357b0570c52b9119 (patch)
tree59b72a6b0776dec814d07f62d0d1c1c768646ee9 /package/kernel/mac80211/patches/387-mac80211-always-account-for-A-MSDU-header-changes.patch
parent079871983c90eee18f6926d10c8d2fdc16b1cafd (diff)
downloadupstream-77024a9d953d394b02226367357b0570c52b9119.tar.gz
upstream-77024a9d953d394b02226367357b0570c52b9119.tar.bz2
upstream-77024a9d953d394b02226367357b0570c52b9119.zip
mac80211: backport upstream fixes
Backport most significant upstream fixes (excl. hwsim fixes) Refreshed all patches. Contains important fixes for CSA (Channel Switch Announcement) and A-MSDU frames. Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
Diffstat (limited to 'package/kernel/mac80211/patches/387-mac80211-always-account-for-A-MSDU-header-changes.patch')
-rw-r--r--package/kernel/mac80211/patches/387-mac80211-always-account-for-A-MSDU-header-changes.patch51
1 files changed, 51 insertions, 0 deletions
diff --git a/package/kernel/mac80211/patches/387-mac80211-always-account-for-A-MSDU-header-changes.patch b/package/kernel/mac80211/patches/387-mac80211-always-account-for-A-MSDU-header-changes.patch
new file mode 100644
index 0000000000..47942116bc
--- /dev/null
+++ b/package/kernel/mac80211/patches/387-mac80211-always-account-for-A-MSDU-header-changes.patch
@@ -0,0 +1,51 @@
+From: Johannes Berg <johannes.berg@intel.com>
+Date: Thu, 30 Aug 2018 10:55:49 +0200
+Subject: [PATCH] mac80211: always account for A-MSDU header changes
+
+In the error path of changing the SKB headroom of the second
+A-MSDU subframe, we would not account for the already-changed
+length of the first frame that just got converted to be in
+A-MSDU format and thus is a bit longer now.
+
+Fix this by doing the necessary accounting.
+
+It would be possible to reorder the operations, but that would
+make the code more complex (to calculate the necessary pad),
+and the headroom expansion should not fail frequently enough
+to make that worthwhile.
+
+Fixes: 6e0456b54545 ("mac80211: add A-MSDU tx support")
+Signed-off-by: Johannes Berg <johannes.berg@intel.com>
+Acked-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
+Signed-off-by: Johannes Berg <johannes.berg@intel.com>
+---
+
+--- a/net/mac80211/tx.c
++++ b/net/mac80211/tx.c
+@@ -3232,7 +3232,7 @@ static bool ieee80211_amsdu_aggregate(st
+
+ if (!ieee80211_amsdu_realloc_pad(local, skb, sizeof(rfc1042_header) +
+ 2 + pad))
+- goto out;
++ goto out_recalc;
+
+ ret = true;
+ data = skb_push(skb, ETH_ALEN + 2);
+@@ -3249,11 +3249,13 @@ static bool ieee80211_amsdu_aggregate(st
+ head->data_len += skb->len;
+ *frag_tail = skb;
+
+- flow->backlog += head->len - orig_len;
+- tin->backlog_bytes += head->len - orig_len;
+-
+- fq_recalc_backlog(fq, tin, flow);
++out_recalc:
++ if (head->len != orig_len) {
++ flow->backlog += head->len - orig_len;
++ tin->backlog_bytes += head->len - orig_len;
+
++ fq_recalc_backlog(fq, tin, flow);
++ }
+ out:
+ fq->memory_usage += head->truesize - orig_truesize;
+