2012-07-24 03:54:36

by Chun-Yeow Yeoh

[permalink] [raw]
Subject: [PATCH v4] mac80211: add extra checking for RC init upon receiving mesh beacon

Rate control statistic is flushed whenever the mesh beacon
is received. This may not optimizes the performance of rate
control algorithm. This patch ensures that we return early
from mesh_peer_init if the plink_state is ESTAB. Thus, avoid
calling the rate_control_rate_init again for established mesh
STA.

Signed-off-by: Chun-Yeow Yeoh <[email protected]>
---
v2: simplify the logic checking (Thomas Pedersen)
v3: updating the sta last rx activity (Thomas Pedersen)
v4: avoid duplicate assignment (Thomas Pedersen)

net/mac80211/mesh_plink.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c
index 4256859..dfeb243 100644
--- a/net/mac80211/mesh_plink.c
+++ b/net/mac80211/mesh_plink.c
@@ -361,6 +361,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)
--
1.7.0.4



2012-07-24 14:07:18

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH v4] mac80211: add extra checking for RC init upon receiving mesh beacon

On Tue, 2012-07-24 at 11:52 +0800, Chun-Yeow Yeoh wrote:
> Rate control statistic is flushed whenever the mesh beacon
> is received. This may not optimizes the performance of rate
> control algorithm. This patch ensures that we return early
> from mesh_peer_init if the plink_state is ESTAB. Thus, avoid
> calling the rate_control_rate_init again for established mesh
> STA.

Applied.

johannes