325-mac80211-extend-ieee80211_tx_status_ext-to-support-b.patch 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. From: Felix Fietkau <[email protected]>
  2. Date: Fri, 21 Aug 2020 05:49:07 +0200
  3. Subject: [PATCH] mac80211: extend ieee80211_tx_status_ext to support
  4. bulk free
  5. Store processed skbs ready to be freed in a list so the driver bulk free them
  6. Signed-off-by: Felix Fietkau <[email protected]>
  7. ---
  8. --- a/include/net/mac80211.h
  9. +++ b/include/net/mac80211.h
  10. @@ -1095,12 +1095,14 @@ ieee80211_info_get_tx_time_est(struct ie
  11. * @info: Basic tx status information
  12. * @skb: Packet skb (can be NULL if not provided by the driver)
  13. * @rate: The TX rate that was used when sending the packet
  14. + * @free_list: list where processed skbs are stored to be free'd by the driver
  15. */
  16. struct ieee80211_tx_status {
  17. struct ieee80211_sta *sta;
  18. struct ieee80211_tx_info *info;
  19. struct sk_buff *skb;
  20. struct rate_info *rate;
  21. + struct list_head *free_list;
  22. };
  23. /**
  24. --- a/net/mac80211/status.c
  25. +++ b/net/mac80211/status.c
  26. @@ -1051,7 +1051,10 @@ static void __ieee80211_tx_status(struct
  27. * with this test...
  28. */
  29. if (!local->monitors && (!send_to_cooked || !local->cooked_mntrs)) {
  30. - dev_kfree_skb(skb);
  31. + if (status->free_list)
  32. + list_add_tail(&skb->list, status->free_list);
  33. + else
  34. + dev_kfree_skb(skb);
  35. return;
  36. }
  37. @@ -1180,7 +1183,10 @@ free:
  38. return;
  39. ieee80211_report_used_skb(local, skb, false);
  40. - dev_kfree_skb(skb);
  41. + if (status->free_list)
  42. + list_add_tail(&skb->list, status->free_list);
  43. + else
  44. + dev_kfree_skb(skb);
  45. }
  46. EXPORT_SYMBOL(ieee80211_tx_status_ext);