mac80211: ath10k: add tags for upstreamed patches
[openwrt/staging/nbd.git] / package / kernel / mac80211 / patches / ath10k / 081-01-v6.0-ath10k-improve-tx-status-reporting.patch
1 From 2587d5198aa5adcbd8896aae4a2404dc13d48637 Mon Sep 17 00:00:00 2001
2 From: Sergey Ryazanov <ryazanov.s.a@gmail.com>
3 Date: Wed, 18 May 2022 10:27:26 +0300
4 Subject: ath10k: improve tx status reporting
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 We use ieee80211_tx_status() to report each completed tx frame.
10 Internally, this function calls sta_info_get_by_addrs(), what has a
11 couple of drawbacks:
12 1. additional station lookup causes a performance degradation;
13 2. mac80211 can not properly account Ethernet encapsulated frames due
14 to the inability to properly determine the destination (station) MAC
15 address since ieee80211_tx_status() assumes the frame has a 802.11
16 header.
17
18 The latter is especially destructive if we want to use hardware frames
19 encapsulation.
20
21 To fix both of these issues, replace ieee80211_tx_status() with
22 ieee80211_tx_status_ext() call and feed it station pointer from the tx
23 queue associated with the transmitted frame.
24
25 Tested-on: QCA9888 hw2.0 PCI 10.4-3.9.0.2-00131
26 Tested-on: QCA6174 hw3.2 PCI WLAN.RM.4.4.1-00157-QCARMSWPZ-1
27
28 Signed-off-by: Sergey Ryazanov <ryazanov.s.a@gmail.com>
29 Tested-by: Oldřich Jedlička <oldium.pro@gmail.com> # TP-Link Archer C7 v4 & v5 (QCA9563 + QCA9880)
30 Tested-by: Edward Matijevic <motolav@gmail.com> # TP-Link Archer C2600 (IPQ8064 + QCA9980 10.4.1.00030-1)
31 Tested-by: Edward Matijevic <motolav@gmail.com> # QCA9377 PCI in Sta mode
32 Tested-by: Zhijun You <hujy652@gmail.com> # NETGEAR R7800 (QCA9984 10.4-3.9.0.2-00159)
33 Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
34 Link: https://lore.kernel.org/r/20220516032519.29831-2-ryazanov.s.a@gmail.com
35 ---
36 drivers/net/wireless/ath/ath10k/txrx.c | 15 ++++++++++++++-
37 1 file changed, 14 insertions(+), 1 deletion(-)
38
39 --- a/drivers/net/wireless/ath/ath10k/txrx.c
40 +++ b/drivers/net/wireless/ath/ath10k/txrx.c
41 @@ -43,6 +43,7 @@ out:
42 int ath10k_txrx_tx_unref(struct ath10k_htt *htt,
43 const struct htt_tx_done *tx_done)
44 {
45 + struct ieee80211_tx_status status;
46 struct ath10k *ar = htt->ar;
47 struct device *dev = ar->dev;
48 struct ieee80211_tx_info *info;
49 @@ -128,7 +129,19 @@ int ath10k_txrx_tx_unref(struct ath10k_h
50 info->status.is_valid_ack_signal = true;
51 }
52
53 - ieee80211_tx_status(htt->ar->hw, msdu);
54 + memset(&status, 0, sizeof(status));
55 + status.skb = msdu;
56 + status.info = info;
57 +
58 + rcu_read_lock();
59 +
60 + if (txq)
61 + status.sta = txq->sta;
62 +
63 + ieee80211_tx_status_ext(htt->ar->hw, &status);
64 +
65 + rcu_read_unlock();
66 +
67 /* we do not own the msdu anymore */
68
69 return 0;