diff mbox

[v2] mac80211: add extra checking for RC init upon receiving mesh beacon

Message ID 1343016370-31163-1-git-send-email-yeohchunyeow@gmail.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Chun-Yeow Yeoh July 23, 2012, 4:06 a.m. UTC
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 <yeohchunyeow@gmail.com>
---
v2: simplify the logic checking (Thomas Pedersen)

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

Comments

Thomas Pedersen July 23, 2012, 5:07 p.m. UTC | #1
Hi Chun-Yeow,

> diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c
> index 4256859..a73741c 100644
> --- a/net/mac80211/mesh_plink.c
> +++ b/net/mac80211/mesh_plink.c
> @@ -359,6 +359,9 @@ static struct sta_info *mesh_peer_init(struct ieee80211_sub_if_data *sdata,
>                 insert = true;
>         }
>
> +       if (sta->plink_state == NL80211_PLINK_ESTAB)
> +               return sta;
> +

Please keep updating sta->last_rx.

>         spin_lock_bh(&sta->lock);
>         sta->last_rx = jiffies;
>         sta->sta.supp_rates[band] = rates;

Thomas
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Chun-Yeow Yeoh July 24, 2012, 1:19 a.m. UTC | #2
Hi, Thomas

> Please keep updating sta->last_rx.
Noted. Resubmit the patch.

Regards,
Chun-Yeow
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c
index 4256859..a73741c 100644
--- a/net/mac80211/mesh_plink.c
+++ b/net/mac80211/mesh_plink.c
@@ -359,6 +359,9 @@  static struct sta_info *mesh_peer_init(struct ieee80211_sub_if_data *sdata,
 		insert = true;
 	}
 
+	if (sta->plink_state == NL80211_PLINK_ESTAB)
+		return sta;
+
 	spin_lock_bh(&sta->lock);
 	sta->last_rx = jiffies;
 	sta->sta.supp_rates[band] = rates;