From: Greg Kroah-Hartman Date: Thu, 11 Mar 2021 17:51:01 +0000 (+0100) Subject: 4.4-stable patches X-Git-Tag: v4.4.262~140 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=235297b43a4c4790c33321a27014d11877271a6e;p=thirdparty%2Fkernel%2Fstable-queue.git 4.4-stable patches added patches: ath9k-fix-transmitting-to-stations-in-dynamic-smps-mode.patch net-fix-gro-aggregation-for-udp-encaps-with-zero-csum.patch uapi-nfnetlink_cthelper.h-fix-userspace-compilation-error.patch --- diff --git a/queue-4.4/ath9k-fix-transmitting-to-stations-in-dynamic-smps-mode.patch b/queue-4.4/ath9k-fix-transmitting-to-stations-in-dynamic-smps-mode.patch new file mode 100644 index 00000000000..1a520318a1c --- /dev/null +++ b/queue-4.4/ath9k-fix-transmitting-to-stations-in-dynamic-smps-mode.patch @@ -0,0 +1,60 @@ +From 3b9ea7206d7e1fdd7419cbd10badd3b2c80d04b4 Mon Sep 17 00:00:00 2001 +From: Felix Fietkau +Date: Sun, 14 Feb 2021 19:49:11 +0100 +Subject: ath9k: fix transmitting to stations in dynamic SMPS mode + +From: Felix Fietkau + +commit 3b9ea7206d7e1fdd7419cbd10badd3b2c80d04b4 upstream. + +When transmitting to a receiver in dynamic SMPS mode, all transmissions that +use multiple spatial streams need to be sent using CTS-to-self or RTS/CTS to +give the receiver's extra chains some time to wake up. +This fixes the tx rate getting stuck at <= MCS7 for some clients, especially +Intel ones, which make aggressive use of SMPS. + +Cc: stable@vger.kernel.org +Reported-by: Martin Kennedy +Signed-off-by: Felix Fietkau +Signed-off-by: Kalle Valo +Link: https://lore.kernel.org/r/20210214184911.96702-1-nbd@nbd.name +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/wireless/ath/ath9k/ath9k.h | 3 ++- + drivers/net/wireless/ath/ath9k/xmit.c | 6 ++++++ + 2 files changed, 8 insertions(+), 1 deletion(-) + +--- a/drivers/net/wireless/ath/ath9k/ath9k.h ++++ b/drivers/net/wireless/ath/ath9k/ath9k.h +@@ -178,7 +178,8 @@ struct ath_frame_info { + s8 txq; + u8 keyix; + u8 rtscts_rate; +- u8 retries : 7; ++ u8 retries : 6; ++ u8 dyn_smps : 1; + u8 baw_tracked : 1; + u8 tx_power; + enum ath9k_key_type keytype:2; +--- a/drivers/net/wireless/ath/ath9k/xmit.c ++++ b/drivers/net/wireless/ath/ath9k/xmit.c +@@ -1228,6 +1228,11 @@ static void ath_buf_set_rate(struct ath_ + is_40, is_sgi, is_sp); + if (rix < 8 && (tx_info->flags & IEEE80211_TX_CTL_STBC)) + info->rates[i].RateFlags |= ATH9K_RATESERIES_STBC; ++ if (rix >= 8 && fi->dyn_smps) { ++ info->rates[i].RateFlags |= ++ ATH9K_RATESERIES_RTS_CTS; ++ info->flags |= ATH9K_TXDESC_CTSENA; ++ } + + info->txpower[i] = ath_get_rate_txpower(sc, bf, rix, + is_40, false); +@@ -2114,6 +2119,7 @@ static void setup_frame_info(struct ieee + fi->keyix = an->ps_key; + else + fi->keyix = ATH9K_TXKEYIX_INVALID; ++ fi->dyn_smps = sta && sta->smps_mode == IEEE80211_SMPS_DYNAMIC; + fi->keytype = keytype; + fi->framelen = framelen; + fi->tx_power = txpower; diff --git a/queue-4.4/net-fix-gro-aggregation-for-udp-encaps-with-zero-csum.patch b/queue-4.4/net-fix-gro-aggregation-for-udp-encaps-with-zero-csum.patch new file mode 100644 index 00000000000..f1a827487ce --- /dev/null +++ b/queue-4.4/net-fix-gro-aggregation-for-udp-encaps-with-zero-csum.patch @@ -0,0 +1,110 @@ +From 89e5c58fc1e2857ccdaae506fb8bc5fed57ee063 Mon Sep 17 00:00:00 2001 +From: Daniel Borkmann +Date: Fri, 26 Feb 2021 22:22:48 +0100 +Subject: net: Fix gro aggregation for udp encaps with zero csum + +From: Daniel Borkmann + +commit 89e5c58fc1e2857ccdaae506fb8bc5fed57ee063 upstream. + +We noticed a GRO issue for UDP-based encaps such as vxlan/geneve when the +csum for the UDP header itself is 0. In that case, GRO aggregation does +not take place on the phys dev, but instead is deferred to the vxlan/geneve +driver (see trace below). + +The reason is essentially that GRO aggregation bails out in udp_gro_receive() +for such case when drivers marked the skb with CHECKSUM_UNNECESSARY (ice, i40e, +others) where for non-zero csums 2abb7cdc0dc8 ("udp: Add support for doing +checksum unnecessary conversion") promotes those skbs to CHECKSUM_COMPLETE +and napi context has csum_valid set. This is however not the case for zero +UDP csum (here: csum_cnt is still 0 and csum_valid continues to be false). + +At the same time 57c67ff4bd92 ("udp: additional GRO support") added matches +on !uh->check ^ !uh2->check as part to determine candidates for aggregation, +so it certainly is expected to handle zero csums in udp_gro_receive(). The +purpose of the check added via 662880f44203 ("net: Allow GRO to use and set +levels of checksum unnecessary") seems to catch bad csum and stop aggregation +right away. + +One way to fix aggregation in the zero case is to only perform the !csum_valid +check in udp_gro_receive() if uh->check is infact non-zero. + +Before: + + [...] + swapper 0 [008] 731.946506: net:netif_receive_skb: dev=enp10s0f0 skbaddr=0xffff966497100400 len=1500 (1) + swapper 0 [008] 731.946507: net:netif_receive_skb: dev=enp10s0f0 skbaddr=0xffff966497100200 len=1500 + swapper 0 [008] 731.946507: net:netif_receive_skb: dev=enp10s0f0 skbaddr=0xffff966497101100 len=1500 + swapper 0 [008] 731.946508: net:netif_receive_skb: dev=enp10s0f0 skbaddr=0xffff966497101700 len=1500 + swapper 0 [008] 731.946508: net:netif_receive_skb: dev=enp10s0f0 skbaddr=0xffff966497101b00 len=1500 + swapper 0 [008] 731.946508: net:netif_receive_skb: dev=enp10s0f0 skbaddr=0xffff966497100600 len=1500 + swapper 0 [008] 731.946508: net:netif_receive_skb: dev=enp10s0f0 skbaddr=0xffff966497100f00 len=1500 + swapper 0 [008] 731.946509: net:netif_receive_skb: dev=enp10s0f0 skbaddr=0xffff966497100a00 len=1500 + swapper 0 [008] 731.946516: net:netif_receive_skb: dev=enp10s0f0 skbaddr=0xffff966497100500 len=1500 + swapper 0 [008] 731.946516: net:netif_receive_skb: dev=enp10s0f0 skbaddr=0xffff966497100700 len=1500 + swapper 0 [008] 731.946516: net:netif_receive_skb: dev=enp10s0f0 skbaddr=0xffff966497101d00 len=1500 (2) + swapper 0 [008] 731.946517: net:netif_receive_skb: dev=enp10s0f0 skbaddr=0xffff966497101000 len=1500 + swapper 0 [008] 731.946517: net:netif_receive_skb: dev=enp10s0f0 skbaddr=0xffff966497101c00 len=1500 + swapper 0 [008] 731.946517: net:netif_receive_skb: dev=enp10s0f0 skbaddr=0xffff966497101400 len=1500 + swapper 0 [008] 731.946518: net:netif_receive_skb: dev=enp10s0f0 skbaddr=0xffff966497100e00 len=1500 + swapper 0 [008] 731.946518: net:netif_receive_skb: dev=enp10s0f0 skbaddr=0xffff966497101600 len=1500 + swapper 0 [008] 731.946521: net:netif_receive_skb: dev=enp10s0f0 skbaddr=0xffff966497100800 len=774 + swapper 0 [008] 731.946530: net:netif_receive_skb: dev=test_vxlan skbaddr=0xffff966497100400 len=14032 (1) + swapper 0 [008] 731.946530: net:netif_receive_skb: dev=test_vxlan skbaddr=0xffff966497101d00 len=9112 (2) + [...] + + # netperf -H 10.55.10.4 -t TCP_STREAM -l 20 + MIGRATED TCP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 10.55.10.4 () port 0 AF_INET : demo + Recv Send Send + Socket Socket Message Elapsed + Size Size Size Time Throughput + bytes bytes bytes secs. 10^6bits/sec + + 87380 16384 16384 20.01 13129.24 + +After: + + [...] + swapper 0 [026] 521.862641: net:netif_receive_skb: dev=enp10s0f0 skbaddr=0xffff93ab0d479000 len=11286 (1) + swapper 0 [026] 521.862643: net:netif_receive_skb: dev=test_vxlan skbaddr=0xffff93ab0d479000 len=11236 (1) + swapper 0 [026] 521.862650: net:netif_receive_skb: dev=enp10s0f0 skbaddr=0xffff93ab0d478500 len=2898 (2) + swapper 0 [026] 521.862650: net:netif_receive_skb: dev=enp10s0f0 skbaddr=0xffff93ab0d479f00 len=8490 (3) + swapper 0 [026] 521.862653: net:netif_receive_skb: dev=test_vxlan skbaddr=0xffff93ab0d478500 len=2848 (2) + swapper 0 [026] 521.862653: net:netif_receive_skb: dev=test_vxlan skbaddr=0xffff93ab0d479f00 len=8440 (3) + [...] + + # netperf -H 10.55.10.4 -t TCP_STREAM -l 20 + MIGRATED TCP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 10.55.10.4 () port 0 AF_INET : demo + Recv Send Send + Socket Socket Message Elapsed + Size Size Size Time Throughput + bytes bytes bytes secs. 10^6bits/sec + + 87380 16384 16384 20.01 24576.53 + +Fixes: 57c67ff4bd92 ("udp: additional GRO support") +Fixes: 662880f44203 ("net: Allow GRO to use and set levels of checksum unnecessary") +Signed-off-by: Daniel Borkmann +Cc: Eric Dumazet +Cc: Jesse Brandeburg +Cc: Tom Herbert +Acked-by: Willem de Bruijn +Acked-by: John Fastabend +Link: https://lore.kernel.org/r/20210226212248.8300-1-daniel@iogearbox.net +Signed-off-by: Jakub Kicinski +Signed-off-by: Greg Kroah-Hartman +--- + net/ipv4/udp_offload.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/net/ipv4/udp_offload.c ++++ b/net/ipv4/udp_offload.c +@@ -300,7 +300,7 @@ struct sk_buff **udp_gro_receive(struct + int flush = 1; + + if (NAPI_GRO_CB(skb)->encap_mark || +- (skb->ip_summed != CHECKSUM_PARTIAL && ++ (uh->check && skb->ip_summed != CHECKSUM_PARTIAL && + NAPI_GRO_CB(skb)->csum_cnt == 0 && + !NAPI_GRO_CB(skb)->csum_valid)) + goto out; diff --git a/queue-4.4/series b/queue-4.4/series new file mode 100644 index 00000000000..4adfdeda32a --- /dev/null +++ b/queue-4.4/series @@ -0,0 +1,3 @@ +uapi-nfnetlink_cthelper.h-fix-userspace-compilation-error.patch +ath9k-fix-transmitting-to-stations-in-dynamic-smps-mode.patch +net-fix-gro-aggregation-for-udp-encaps-with-zero-csum.patch diff --git a/queue-4.4/uapi-nfnetlink_cthelper.h-fix-userspace-compilation-error.patch b/queue-4.4/uapi-nfnetlink_cthelper.h-fix-userspace-compilation-error.patch new file mode 100644 index 00000000000..85c5fff21bf --- /dev/null +++ b/queue-4.4/uapi-nfnetlink_cthelper.h-fix-userspace-compilation-error.patch @@ -0,0 +1,33 @@ +From c33cb0020ee6dd96cc9976d6085a7d8422f6dbed Mon Sep 17 00:00:00 2001 +From: "Dmitry V. Levin" +Date: Mon, 22 Feb 2021 08:00:00 +0000 +Subject: uapi: nfnetlink_cthelper.h: fix userspace compilation error + +From: Dmitry V. Levin + +commit c33cb0020ee6dd96cc9976d6085a7d8422f6dbed upstream. + +Apparently, and + could not be included into the same +compilation unit because of a cut-and-paste typo in the former header. + +Fixes: 12f7a505331e6 ("netfilter: add user-space connection tracking helper infrastructure") +Cc: # v3.6 +Signed-off-by: Dmitry V. Levin +Signed-off-by: Pablo Neira Ayuso +Signed-off-by: Greg Kroah-Hartman +--- + include/uapi/linux/netfilter/nfnetlink_cthelper.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/include/uapi/linux/netfilter/nfnetlink_cthelper.h ++++ b/include/uapi/linux/netfilter/nfnetlink_cthelper.h +@@ -4,7 +4,7 @@ + #define NFCT_HELPER_STATUS_DISABLED 0 + #define NFCT_HELPER_STATUS_ENABLED 1 + +-enum nfnl_acct_msg_types { ++enum nfnl_cthelper_msg_types { + NFNL_MSG_CTHELPER_NEW, + NFNL_MSG_CTHELPER_GET, + NFNL_MSG_CTHELPER_DEL,