aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2018-05-21 10:31:13 -0500
committerJohannes Berg <johannes.berg@intel.com>2018-05-23 11:06:40 +0200
commitd1e23c9456b2881b71732594f4cdb52d78aedecb (patch)
tree199f0dfd20859c5699f4dc77c432a1b8377f5b8b /net/wireless
parentmac80211: Support adding duration for prepare_tx() callback (diff)
downloadlinux-dev-d1e23c9456b2881b71732594f4cdb52d78aedecb.tar.xz
linux-dev-d1e23c9456b2881b71732594f4cdb52d78aedecb.zip
nl80211: Optimize cfg80211_bss_expire invocations
Only invoke cfg80211_bss_expire on the first nl80211_dump_scan invocation to avoid (likely) redundant processing. Signed-off-by: Denis Kenzior <denkenz@gmail.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless')
-rw-r--r--net/wireless/nl80211.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index a3dcea2fbd7a..451f12ecb894 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -8100,7 +8100,15 @@ static int nl80211_dump_scan(struct sk_buff *skb, struct netlink_callback *cb)
wdev_lock(wdev);
spin_lock_bh(&rdev->bss_lock);
- cfg80211_bss_expire(rdev);
+
+ /*
+ * dump_scan will be called multiple times to break up the scan results
+ * into multiple messages. It is unlikely that any more bss-es will be
+ * expired after the first call, so only call only call this on the
+ * first dump_scan invocation.
+ */
+ if (start == 0)
+ cfg80211_bss_expire(rdev);
cb->seq = rdev->bss_generation;