5469a419bfef053b584f9fe3113b39594d11e179
[openwrt/staging/zorun.git] /
1 From: Felix Fietkau <nbd@nbd.name>
2 Date: Thu, 20 Aug 2020 17:27:00 +0200
3 Subject: [PATCH] mac80211: support using ieee80211_tx_status_ext to free
4 skbs without status info
5
6 For encap-offloaded packets, ieee80211_free_txskb cannot be used, since it
7 does not have the vif pointer.
8 Using ieee80211_tx_status_ext for this purpose has the advantage of being able
9 avoid an extra station lookup for AQL
10
11 Signed-off-by: Felix Fietkau <nbd@nbd.name>
12 ---
13
14 --- a/net/mac80211/status.c
15 +++ b/net/mac80211/status.c
16 @@ -1103,6 +1103,21 @@ void ieee80211_tx_status_ext(struct ieee
17 sta->tx_stats.last_rate_info = *status->rate;
18 }
19
20 + if (skb && (tx_time_est =
21 + ieee80211_info_get_tx_time_est(IEEE80211_SKB_CB(skb))) > 0) {
22 + /* Do this here to avoid the expensive lookup of the sta
23 + * in ieee80211_report_used_skb().
24 + */
25 + ieee80211_sta_update_pending_airtime(local, sta,
26 + skb_get_queue_mapping(skb),
27 + tx_time_est,
28 + true);
29 + ieee80211_info_set_tx_time_est(IEEE80211_SKB_CB(skb), 0);
30 + }
31 +
32 + if (!status->info)
33 + goto free;
34 +
35 rates_idx = ieee80211_tx_get_rates(hw, info, &retry_count);
36
37 sband = hw->wiphy->bands[info->band];
38 @@ -1146,17 +1161,6 @@ void ieee80211_tx_status_ext(struct ieee
39 ieee80211s_update_metric(local, sta, status);
40 }
41
42 - if (skb && (tx_time_est = ieee80211_info_get_tx_time_est(info)) > 0) {
43 - /* Do this here to avoid the expensive lookup of the sta
44 - * in ieee80211_report_used_skb().
45 - */
46 - ieee80211_sta_update_pending_airtime(local, sta,
47 - skb_get_queue_mapping(skb),
48 - tx_time_est,
49 - true);
50 - ieee80211_info_set_tx_time_est(info, 0);
51 - }
52 -
53 if (skb && !(info->flags & IEEE80211_TX_CTL_HW_80211_ENCAP))
54 return __ieee80211_tx_status(hw, status, rates_idx,
55 retry_count);
56 @@ -1173,6 +1177,7 @@ void ieee80211_tx_status_ext(struct ieee
57 I802_DEBUG_INC(local->dot11FailedCount);
58 }
59
60 +free:
61 if (!skb)
62 return;
63