mac80211: don't re-init rate control when receiving mesh beacon
authorChun-Yeow Yeoh <yeohchunyeow@gmail.com>
Tue, 24 Jul 2012 03:52:35 +0000 (11:52 +0800)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 31 Jul 2012 14:10:55 +0000 (16:10 +0200)
Rate control is re-initialized whenever a beacon from a mesh
peer received, breaking the algorithms and resulting in low
performance. Return early from mesh_peer_init if we already
established a link with this peer to avoid this.

Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com>
[clarify commit message]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/mesh_plink.c

index af671b984df37123cf6841fb9a8e4e5db70bde65..fa642c794719676f995866c7694ec54fa9fb1c1e 100644 (file)
@@ -362,6 +362,11 @@ static struct sta_info *mesh_peer_init(struct ieee80211_sub_if_data *sdata,
 
        spin_lock_bh(&sta->lock);
        sta->last_rx = jiffies;
+       if (sta->plink_state == NL80211_PLINK_ESTAB) {
+               spin_unlock_bh(&sta->lock);
+               return sta;
+       }
+
        sta->sta.supp_rates[band] = rates;
        if (elems->ht_cap_elem &&
            sdata->local->_oper_channel_type != NL80211_CHAN_NO_HT)