324-mac80211-support-using-ieee80211_tx_status_ext-to-fr.patch 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. From: Felix Fietkau <[email protected]>
  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. For encap-offloaded packets, ieee80211_free_txskb cannot be used, since it
  6. does not have the vif pointer.
  7. Using ieee80211_tx_status_ext for this purpose has the advantage of being able
  8. avoid an extra station lookup for AQL
  9. Signed-off-by: Felix Fietkau <[email protected]>
  10. ---
  11. --- a/net/mac80211/status.c
  12. +++ b/net/mac80211/status.c
  13. @@ -1101,6 +1101,21 @@ void ieee80211_tx_status_ext(struct ieee
  14. sta->tx_stats.last_rate_info = *status->rate;
  15. }
  16. + if (skb && (tx_time_est =
  17. + ieee80211_info_get_tx_time_est(IEEE80211_SKB_CB(skb))) > 0) {
  18. + /* Do this here to avoid the expensive lookup of the sta
  19. + * in ieee80211_report_used_skb().
  20. + */
  21. + ieee80211_sta_update_pending_airtime(local, sta,
  22. + skb_get_queue_mapping(skb),
  23. + tx_time_est,
  24. + true);
  25. + ieee80211_info_set_tx_time_est(IEEE80211_SKB_CB(skb), 0);
  26. + }
  27. +
  28. + if (!status->info)
  29. + goto free;
  30. +
  31. rates_idx = ieee80211_tx_get_rates(hw, info, &retry_count);
  32. sband = hw->wiphy->bands[info->band];
  33. @@ -1144,17 +1159,6 @@ void ieee80211_tx_status_ext(struct ieee
  34. ieee80211s_update_metric(local, sta, status);
  35. }
  36. - if (skb && (tx_time_est = ieee80211_info_get_tx_time_est(info)) > 0) {
  37. - /* Do this here to avoid the expensive lookup of the sta
  38. - * in ieee80211_report_used_skb().
  39. - */
  40. - ieee80211_sta_update_pending_airtime(local, sta,
  41. - skb_get_queue_mapping(skb),
  42. - tx_time_est,
  43. - true);
  44. - ieee80211_info_set_tx_time_est(info, 0);
  45. - }
  46. -
  47. if (skb && !(info->flags & IEEE80211_TX_CTL_HW_80211_ENCAP))
  48. return __ieee80211_tx_status(hw, status, rates_idx,
  49. retry_count);
  50. @@ -1171,6 +1175,7 @@ void ieee80211_tx_status_ext(struct ieee
  51. I802_DEBUG_INC(local->dot11FailedCount);
  52. }
  53. +free:
  54. if (!skb)
  55. return;