diff options
author | Felix Fietkau <nbd@nbd.name> | 2019-03-16 19:50:44 +0100 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2019-03-16 19:59:02 +0100 |
commit | 4cf1394f51ba4b28edab016e36fb0f7a1c208f30 (patch) | |
tree | b4e35b4e35f2e72e37fcf5bf27e93517423d1b28 /package/kernel/mac80211/patches/subsys/353-mac80211-mesh-drop-redundant-rcu_read_lock-unlock-ca.patch | |
parent | 1f68aac9d7b15013407afca581c5da09b45b9afa (diff) | |
download | upstream-4cf1394f51ba4b28edab016e36fb0f7a1c208f30.tar.gz upstream-4cf1394f51ba4b28edab016e36fb0f7a1c208f30.tar.bz2 upstream-4cf1394f51ba4b28edab016e36fb0f7a1c208f30.zip |
mac80211: add a few performance improvement patches
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'package/kernel/mac80211/patches/subsys/353-mac80211-mesh-drop-redundant-rcu_read_lock-unlock-ca.patch')
-rw-r--r-- | package/kernel/mac80211/patches/subsys/353-mac80211-mesh-drop-redundant-rcu_read_lock-unlock-ca.patch | 96 |
1 files changed, 96 insertions, 0 deletions
diff --git a/package/kernel/mac80211/patches/subsys/353-mac80211-mesh-drop-redundant-rcu_read_lock-unlock-ca.patch b/package/kernel/mac80211/patches/subsys/353-mac80211-mesh-drop-redundant-rcu_read_lock-unlock-ca.patch new file mode 100644 index 0000000000..ae5be18170 --- /dev/null +++ b/package/kernel/mac80211/patches/subsys/353-mac80211-mesh-drop-redundant-rcu_read_lock-unlock-ca.patch @@ -0,0 +1,96 @@ +From: Felix Fietkau <nbd@nbd.name> +Date: Sat, 16 Mar 2019 17:43:58 +0100 +Subject: [PATCH] mac80211: mesh: drop redundant rcu_read_lock/unlock calls + +The callers of these functions are all within RCU locked sections + +Signed-off-by: Felix Fietkau <nbd@nbd.name> +--- + +--- a/net/mac80211/mesh_hwmp.c ++++ b/net/mac80211/mesh_hwmp.c +@@ -1112,16 +1112,13 @@ int mesh_nexthop_resolve(struct ieee8021 + struct mesh_path *mpath; + struct sk_buff *skb_to_free = NULL; + u8 *target_addr = hdr->addr3; +- int err = 0; + + /* Nulls are only sent to peers for PS and should be pre-addressed */ + if (ieee80211_is_qos_nullfunc(hdr->frame_control)) + return 0; + +- rcu_read_lock(); +- err = mesh_nexthop_lookup(sdata, skb); +- if (!err) +- goto endlookup; ++ if (!mesh_nexthop_lookup(sdata, skb)) ++ return 0; + + /* no nexthop found, start resolving */ + mpath = mesh_path_lookup(sdata, target_addr); +@@ -1129,8 +1126,7 @@ int mesh_nexthop_resolve(struct ieee8021 + mpath = mesh_path_add(sdata, target_addr); + if (IS_ERR(mpath)) { + mesh_path_discard_frame(sdata, skb); +- err = PTR_ERR(mpath); +- goto endlookup; ++ return PTR_ERR(mpath); + } + } + +@@ -1143,13 +1139,10 @@ int mesh_nexthop_resolve(struct ieee8021 + info->flags |= IEEE80211_TX_INTFL_NEED_TXPROCESSING; + ieee80211_set_qos_hdr(sdata, skb); + skb_queue_tail(&mpath->frame_queue, skb); +- err = -ENOENT; + if (skb_to_free) + mesh_path_discard_frame(sdata, skb_to_free); + +-endlookup: +- rcu_read_unlock(); +- return err; ++ return -ENOENT; + } + + /** +@@ -1169,13 +1162,10 @@ int mesh_nexthop_lookup(struct ieee80211 + struct sta_info *next_hop; + struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; + u8 *target_addr = hdr->addr3; +- int err = -ENOENT; + +- rcu_read_lock(); + mpath = mesh_path_lookup(sdata, target_addr); +- + if (!mpath || !(mpath->flags & MESH_PATH_ACTIVE)) +- goto endlookup; ++ return -ENOENT; + + if (time_after(jiffies, + mpath->exp_time - +@@ -1190,12 +1180,10 @@ int mesh_nexthop_lookup(struct ieee80211 + memcpy(hdr->addr1, next_hop->sta.addr, ETH_ALEN); + memcpy(hdr->addr2, sdata->vif.addr, ETH_ALEN); + ieee80211_mps_set_frame_flags(sdata, next_hop, hdr); +- err = 0; ++ return 0; + } + +-endlookup: +- rcu_read_unlock(); +- return err; ++ return -ENOENT; + } + + void mesh_path_timer(struct timer_list *t) +--- a/net/mac80211/mesh_pathtbl.c ++++ b/net/mac80211/mesh_pathtbl.c +@@ -217,7 +217,7 @@ static struct mesh_path *mpath_lookup(st + { + struct mesh_path *mpath; + +- mpath = rhashtable_lookup_fast(&tbl->rhead, dst, mesh_rht_params); ++ mpath = rhashtable_lookup(&tbl->rhead, dst, mesh_rht_params); + + if (mpath && mpath_expired(mpath)) { + spin_lock_bh(&mpath->state_lock); |