From: Felix Fietkau <nbd@nbd.name>
To: linux-wireless@vger.kernel.org
Cc: johannes@sipsolutions.net
Subject: [PATCH 1/5] mac80211: mesh: drop redundant rcu_read_lock/unlock calls
Date: Sat, 16 Mar 2019 18:06:30 +0100 [thread overview]
Message-ID: <20190316170634.13125-1-nbd@nbd.name> (raw)
The callers of these functions are all within RCU locked sections
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
net/mac80211/mesh_hwmp.c | 26 +++++++-------------------
net/mac80211/mesh_pathtbl.c | 2 +-
2 files changed, 8 insertions(+), 20 deletions(-)
diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c
index f7517668e77a..dcbca7c8c67d 100644
--- a/net/mac80211/mesh_hwmp.c
+++ b/net/mac80211/mesh_hwmp.c
@@ -1130,16 +1130,13 @@ int mesh_nexthop_resolve(struct ieee80211_sub_if_data *sdata,
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);
@@ -1147,8 +1144,7 @@ int mesh_nexthop_resolve(struct ieee80211_sub_if_data *sdata,
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);
}
}
@@ -1161,13 +1157,10 @@ int mesh_nexthop_resolve(struct ieee80211_sub_if_data *sdata,
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;
}
/**
@@ -1187,13 +1180,10 @@ int mesh_nexthop_lookup(struct ieee80211_sub_if_data *sdata,
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 -
@@ -1208,12 +1198,10 @@ int mesh_nexthop_lookup(struct ieee80211_sub_if_data *sdata,
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)
diff --git a/net/mac80211/mesh_pathtbl.c b/net/mac80211/mesh_pathtbl.c
index 0a1148328f19..498bf580bff4 100644
--- a/net/mac80211/mesh_pathtbl.c
+++ b/net/mac80211/mesh_pathtbl.c
@@ -219,7 +219,7 @@ static struct mesh_path *mpath_lookup(struct mesh_table *tbl, const u8 *dst,
{
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);
--
2.17.0
next reply other threads:[~2019-03-16 17:06 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-16 17:06 Felix Fietkau [this message]
2019-03-16 17:06 ` [PATCH 2/5] mac80211: fix memory accounting with A-MSDU aggregation Felix Fietkau
2019-03-16 18:12 ` Toke Høiland-Jørgensen
2019-03-16 17:06 ` [PATCH 3/5] mac80211: calculate hash for fq without holding fq->lock in itxq enqueue Felix Fietkau
2019-03-16 18:13 ` Toke Høiland-Jørgensen
2019-03-16 17:06 ` [PATCH 4/5] mac80211: run late dequeue late tx handlers without holding fq->lock Felix Fietkau
2019-03-16 18:13 ` Toke Høiland-Jørgensen
2022-12-05 9:46 ` Wen Gong
2022-12-07 6:30 ` Wen Gong
2022-12-12 8:31 ` Wen Gong
2019-03-16 17:06 ` [PATCH 5/5] mac80211: set NETIF_F_LLTX when using intermediate tx queues Felix Fietkau
2019-03-16 18:14 ` Toke Høiland-Jørgensen
2019-04-14 9:44 ` Arend Van Spriel
2019-04-14 11:19 ` Felix Fietkau
2019-04-14 12:34 ` Arend Van Spriel
2019-04-16 7:34 ` Arend Van Spriel
2019-04-16 7:44 ` Herbert Xu
2019-04-16 8:04 ` Arend Van Spriel
2019-04-16 8:36 ` Herbert Xu
2019-04-16 8:37 ` Johannes Berg
2019-04-16 9:17 ` Arend Van Spriel
2019-04-16 9:29 ` Herbert Xu
2019-04-16 9:33 ` Toke Høiland-Jørgensen
2019-04-16 9:33 ` Johannes Berg
2019-04-16 9:37 ` Herbert Xu
2019-04-16 9:39 ` Johannes Berg
2019-04-16 10:02 ` Toke Høiland-Jørgensen
2019-04-17 2:11 ` Herbert Xu
2019-04-17 8:28 ` Toke Høiland-Jørgensen
2019-04-16 13:13 ` Herbert Xu
2019-04-16 13:18 ` Toke Høiland-Jørgensen
2019-04-17 3:38 ` Herbert Xu
2019-04-17 9:09 ` Toke Høiland-Jørgensen
2019-04-17 9:16 ` Arend Van Spriel
2019-04-17 9:17 ` Toke Høiland-Jørgensen
2019-04-23 12:41 ` Johannes Berg
2019-04-25 8:35 ` Herbert Xu
2019-04-25 8:39 ` Johannes Berg
2019-04-25 8:44 ` Herbert Xu
2019-04-25 8:49 ` Johannes Berg
2019-04-16 19:13 ` Johannes Berg
2019-04-17 2:13 ` Herbert Xu
2019-04-16 9:38 ` Toke Høiland-Jørgensen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190316170634.13125-1-nbd@nbd.name \
--to=nbd@nbd.name \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).