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
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
11 Signed-off-by: Felix Fietkau <nbd@nbd.name>
14 --- a/net/mac80211/status.c
15 +++ b/net/mac80211/status.c
16 @@ -1101,6 +1101,21 @@ void ieee80211_tx_status_ext(struct ieee
17 sta->tx_stats.last_rate_info = *status->rate;
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().
25 + ieee80211_sta_update_pending_airtime(local, sta,
26 + skb_get_queue_mapping(skb),
29 + ieee80211_info_set_tx_time_est(IEEE80211_SKB_CB(skb), 0);
35 rates_idx = ieee80211_tx_get_rates(hw, info, &retry_count);
37 sband = hw->wiphy->bands[info->band];
38 @@ -1144,17 +1159,6 @@ void ieee80211_tx_status_ext(struct ieee
39 ieee80211s_update_metric(local, sta, status);
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().
46 - ieee80211_sta_update_pending_airtime(local, sta,
47 - skb_get_queue_mapping(skb),
50 - ieee80211_info_set_tx_time_est(info, 0);
53 if (skb && !(info->flags & IEEE80211_TX_CTL_HW_80211_ENCAP))
54 return __ieee80211_tx_status(hw, status, rates_idx,
56 @@ -1171,6 +1175,7 @@ void ieee80211_tx_status_ext(struct ieee
57 I802_DEBUG_INC(local->dot11FailedCount);