1 From: Felix Fietkau <nbd@nbd.name>
2 Date: Sat, 16 Mar 2019 17:43:58 +0100
3 Subject: [PATCH] mac80211: mesh: drop redundant rcu_read_lock/unlock calls
5 The callers of these functions are all within RCU locked sections
7 Signed-off-by: Felix Fietkau <nbd@nbd.name>
10 --- a/net/mac80211/mesh_hwmp.c
11 +++ b/net/mac80211/mesh_hwmp.c
12 @@ -1122,16 +1122,13 @@ int mesh_nexthop_resolve(struct ieee8021
13 struct mesh_path *mpath;
14 struct sk_buff *skb_to_free = NULL;
15 u8 *target_addr = hdr->addr3;
18 /* Nulls are only sent to peers for PS and should be pre-addressed */
19 if (ieee80211_is_qos_nullfunc(hdr->frame_control))
23 - err = mesh_nexthop_lookup(sdata, skb);
26 + if (!mesh_nexthop_lookup(sdata, skb))
29 /* no nexthop found, start resolving */
30 mpath = mesh_path_lookup(sdata, target_addr);
31 @@ -1139,8 +1136,7 @@ int mesh_nexthop_resolve(struct ieee8021
32 mpath = mesh_path_add(sdata, target_addr);
34 mesh_path_discard_frame(sdata, skb);
35 - err = PTR_ERR(mpath);
37 + return PTR_ERR(mpath);
41 @@ -1154,13 +1150,10 @@ int mesh_nexthop_resolve(struct ieee8021
42 info->flags |= IEEE80211_TX_INTFL_NEED_TXPROCESSING;
43 ieee80211_set_qos_hdr(sdata, skb);
44 skb_queue_tail(&mpath->frame_queue, skb);
47 mesh_path_discard_frame(sdata, skb_to_free);
56 @@ -1180,13 +1173,10 @@ int mesh_nexthop_lookup(struct ieee80211
57 struct sta_info *next_hop;
58 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
59 u8 *target_addr = hdr->addr3;
63 mpath = mesh_path_lookup(sdata, target_addr);
65 if (!mpath || !(mpath->flags & MESH_PATH_ACTIVE))
69 if (time_after(jiffies,
71 @@ -1201,12 +1191,10 @@ int mesh_nexthop_lookup(struct ieee80211
72 memcpy(hdr->addr1, next_hop->sta.addr, ETH_ALEN);
73 memcpy(hdr->addr2, sdata->vif.addr, ETH_ALEN);
74 ieee80211_mps_set_frame_flags(sdata, next_hop, hdr);
85 void mesh_path_timer(struct timer_list *t)
86 --- a/net/mac80211/mesh_pathtbl.c
87 +++ b/net/mac80211/mesh_pathtbl.c
88 @@ -219,7 +219,7 @@ static struct mesh_path *mpath_lookup(st
90 struct mesh_path *mpath;
92 - mpath = rhashtable_lookup_fast(&tbl->rhead, dst, mesh_rht_params);
93 + mpath = rhashtable_lookup(&tbl->rhead, dst, mesh_rht_params);
95 if (mpath && mpath_expired(mpath)) {
96 spin_lock_bh(&mpath->state_lock);