aboutsummaryrefslogtreecommitdiffstats
path: root/package/kernel/mac80211/patches/subsys/300-mac80211-optimize-skb-resizing.patch
diff options
context:
space:
mode:
authorChristian Lamparter <chunkeey@gmail.com>2019-08-24 17:16:05 +0200
committerChristian Lamparter <chunkeey@gmail.com>2019-08-24 23:23:31 +0200
commite1dcfe02b2af0eea1654e491f62049e479978951 (patch)
treebb51c1bfec6a254476ec212b06633d932a9a74e8 /package/kernel/mac80211/patches/subsys/300-mac80211-optimize-skb-resizing.patch
parent5ef3fe614c1e8c350ca0083f61577a89c002bc53 (diff)
downloadupstream-e1dcfe02b2af0eea1654e491f62049e479978951.tar.gz
upstream-e1dcfe02b2af0eea1654e491f62049e479978951.tar.bz2
upstream-e1dcfe02b2af0eea1654e491f62049e479978951.zip
mac80211: refresh patches
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
Diffstat (limited to 'package/kernel/mac80211/patches/subsys/300-mac80211-optimize-skb-resizing.patch')
-rw-r--r--package/kernel/mac80211/patches/subsys/300-mac80211-optimize-skb-resizing.patch30
1 files changed, 16 insertions, 14 deletions
diff --git a/package/kernel/mac80211/patches/subsys/300-mac80211-optimize-skb-resizing.patch b/package/kernel/mac80211/patches/subsys/300-mac80211-optimize-skb-resizing.patch
index e2fbdc6787..b0c527a68c 100644
--- a/package/kernel/mac80211/patches/subsys/300-mac80211-optimize-skb-resizing.patch
+++ b/package/kernel/mac80211/patches/subsys/300-mac80211-optimize-skb-resizing.patch
@@ -67,14 +67,20 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
struct ieee80211_hdr *hdr;
- bool enc_tailroom;
- int tail_need = 0;
-+ int head_need, head_max;
-+ int tail_need, tail_max;
-+ bool enc_tailroom = false;
-
+-
- hdr = (struct ieee80211_hdr *) skb->data;
- enc_tailroom = may_encrypt &&
- (sdata->crypto_tx_tailroom_needed_cnt ||
- ieee80211_is_mgmt(hdr->frame_control));
+-
+- if (enc_tailroom) {
+- tail_need = IEEE80211_ENCRYPT_TAILROOM;
+- tail_need -= skb_tailroom(skb);
+- tail_need = max_t(int, tail_need, 0);
++ int head_need, head_max;
++ int tail_need, tail_max;
++ bool enc_tailroom = false;
++
+ if (sdata && !hdr_len &&
+ !(info->flags & IEEE80211_TX_INTFL_DONT_ENCRYPT)) {
+ hdr = (struct ieee80211_hdr *) skb->data;
@@ -82,11 +88,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
+ ieee80211_is_mgmt(hdr->frame_control));
+ hdr_len += sdata->encrypt_headroom;
+ }
-
-- if (enc_tailroom) {
-- tail_need = IEEE80211_ENCRYPT_TAILROOM;
-- tail_need -= skb_tailroom(skb);
-- tail_need = max_t(int, tail_need, 0);
++
+ head_need = head_max = hdr_len;
+ tail_need = tail_max = 0;
+ if (!sdata) {
@@ -129,13 +131,13 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
- bool may_encrypt;
-
- may_encrypt = !(info->flags & IEEE80211_TX_INTFL_DONT_ENCRYPT);
--
+
- headroom = local->tx_headroom;
- if (may_encrypt)
- headroom += sdata->encrypt_headroom;
- headroom -= skb_headroom(skb);
- headroom = max_t(int, 0, headroom);
-
+-
- if (ieee80211_skb_resize(sdata, skb, headroom, may_encrypt)) {
+ if (ieee80211_skb_resize(local, sdata, skb, 0, 0)) {
ieee80211_free_txskb(&local->hw, skb);
@@ -146,7 +148,8 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
skb_pull(skb, skip_header_bytes);
- head_need = hdrlen + encaps_len + meshhdrlen - skb_headroom(skb);
--
++ head_need = hdrlen + encaps_len + meshhdrlen;
+
- /*
- * So we need to modify the skb header and hence need a copy of
- * that. The head_need variable above doesn't, so far, include
@@ -158,8 +161,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
- * the ever needed space. Also, if we need to reallocate it anyway,
- * make it big enough for everything we may ever need.
- */
-+ head_need = hdrlen + encaps_len + meshhdrlen;
-
+-
- if (head_need > 0 || skb_cloned(skb)) {
- head_need += sdata->encrypt_headroom;
- head_need += local->tx_headroom;