Commit efe117ab authored by Eric Dumazet's avatar Eric Dumazet Committed by John W. Linville

mac80211: Speedup ieee80211_remove_interfaces()

Speedup ieee80211_remove_interfaces() by factorizing synchronize_rcu() calls
Signed-off-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
Reviewed-by: default avatarJohannes Berg <johannes@sipsolutions.net>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 4ba3eb03
...@@ -860,22 +860,18 @@ void ieee80211_if_remove(struct ieee80211_sub_if_data *sdata) ...@@ -860,22 +860,18 @@ void ieee80211_if_remove(struct ieee80211_sub_if_data *sdata)
void ieee80211_remove_interfaces(struct ieee80211_local *local) void ieee80211_remove_interfaces(struct ieee80211_local *local)
{ {
struct ieee80211_sub_if_data *sdata, *tmp; struct ieee80211_sub_if_data *sdata, *tmp;
LIST_HEAD(unreg_list);
ASSERT_RTNL(); ASSERT_RTNL();
mutex_lock(&local->iflist_mtx);
list_for_each_entry_safe(sdata, tmp, &local->interfaces, list) { list_for_each_entry_safe(sdata, tmp, &local->interfaces, list) {
/*
* we cannot hold the iflist_mtx across unregister_netdevice,
* but we only need to hold it for list modifications to lock
* out readers since we're under the RTNL here as all other
* writers.
*/
mutex_lock(&local->iflist_mtx);
list_del(&sdata->list); list_del(&sdata->list);
mutex_unlock(&local->iflist_mtx);
unregister_netdevice(sdata->dev); unregister_netdevice_queue(sdata->dev, &unreg_list);
} }
mutex_unlock(&local->iflist_mtx);
unregister_netdevice_many(&unreg_list);
} }
static u32 ieee80211_idle_off(struct ieee80211_local *local, static u32 ieee80211_idle_off(struct ieee80211_local *local,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment