mac80211: improve performance a bit
[openwrt.git] / package / mac80211 / patches / 580-tx_status_optimization.patch
1 --- a/net/mac80211/status.c
2 +++ b/net/mac80211/status.c
3 @@ -171,7 +171,7 @@ void ieee80211_tx_status(struct ieee8021
4 struct net_device *prev_dev = NULL;
5 struct sta_info *sta, *tmp;
6 int retry_count = -1, i;
7 - bool injected;
8 + bool send_to_cooked;
9
10 for (i = 0; i < IEEE80211_TX_MAX_RATES; i++) {
11 /* the HW cannot have attempted that rate */
12 @@ -296,11 +296,15 @@ void ieee80211_tx_status(struct ieee8021
13 /* this was a transmitted frame, but now we want to reuse it */
14 skb_orphan(skb);
15
16 + /* Need to make a copy before skb->cb gets cleared */
17 + send_to_cooked = !!(info->flags & IEEE80211_TX_CTL_INJECTED) ||
18 + (type != IEEE80211_FTYPE_DATA);
19 +
20 /*
21 * This is a bit racy but we can avoid a lot of work
22 * with this test...
23 */
24 - if (!local->monitors && !local->cooked_mntrs) {
25 + if (!local->monitors && (!send_to_cooked || !local->cooked_mntrs)) {
26 dev_kfree_skb(skb);
27 return;
28 }
29 @@ -345,9 +349,6 @@ void ieee80211_tx_status(struct ieee8021
30 /* for now report the total retry_count */
31 rthdr->data_retries = retry_count;
32
33 - /* Need to make a copy before skb->cb gets cleared */
34 - injected = !!(info->flags & IEEE80211_TX_CTL_INJECTED);
35 -
36 /* XXX: is this sufficient for BPF? */
37 skb_set_mac_header(skb, 0);
38 skb->ip_summed = CHECKSUM_UNNECESSARY;
39 @@ -362,8 +363,7 @@ void ieee80211_tx_status(struct ieee8021
40 continue;
41
42 if ((sdata->u.mntr_flags & MONITOR_FLAG_COOK_FRAMES) &&
43 - !injected &&
44 - (type == IEEE80211_FTYPE_DATA))
45 + !send_to_cooked)
46 continue;
47
48 if (prev_dev) {
This page took 0.043647 seconds and 5 git commands to generate.