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