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 <rate_control_
rate_init> is called only if the peer's channel type is
changed.
Signed-off-by: Chun-Yeow Yeoh <[email protected]>
---
net/mac80211/mesh_plink.c | 10 +++++++++-
net/mac80211/sta_info.h | 4 ++++
2 files changed, 13 insertions(+), 1 deletions(-)
diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c
index 4256859..a3fce28 100644
--- a/net/mac80211/mesh_plink.c
+++ b/net/mac80211/mesh_plink.c
@@ -357,6 +357,7 @@ static struct sta_info *mesh_peer_init(struct ieee80211_sub_if_data *sdata,
if (!sta)
return NULL;
insert = true;
+ sta->mesh_rate_init = false;
}
spin_lock_bh(&sta->lock);
@@ -377,9 +378,16 @@ static struct sta_info *mesh_peer_init(struct ieee80211_sub_if_data *sdata,
~IEEE80211_HT_CAP_SUP_WIDTH_20_40;
sta->ch_type =
ieee80211_ht_oper_to_channel_type(elems->ht_operation);
+ } else {
+ sta->ch_type = NL80211_CHAN_NO_HT;
+ }
+
+ if (!sta->mesh_rate_init || sta->pre_ch_type != sta->ch_type) {
+ rate_control_rate_init(sta);
+ sta->mesh_rate_init = true;
+ sta->pre_ch_type = sta->ch_type;
}
- rate_control_rate_init(sta);
spin_unlock_bh(&sta->lock);
if (insert && sta_info_insert(sta))
diff --git a/net/mac80211/sta_info.h b/net/mac80211/sta_info.h
index a470e11..ed10ee7 100644
--- a/net/mac80211/sta_info.h
+++ b/net/mac80211/sta_info.h
@@ -274,6 +274,8 @@ struct sta_ampdu_mlme {
* @t_offset_setpoint: reference timing offset of this sta to be used when
* calculating clockdrift
* @ch_type: peer's channel type
+ * @pre_ch_type: previous peer's channel type
+ * @mesh_rate_init: rate control initilization flag
* @debugfs: debug filesystem info
* @dead: set to true when sta is unlinked
* @uploaded: set to true when sta is uploaded to the driver
@@ -368,6 +370,8 @@ struct sta_info {
s64 t_offset;
s64 t_offset_setpoint;
enum nl80211_channel_type ch_type;
+ enum nl80211_channel_type pre_ch_type;
+ bool mesh_rate_init;
#endif
#ifdef CONFIG_MAC80211_DEBUGFS
--
1.7.0.4
Hi Chun-Yeow,
On Fri, Jul 20, 2012 at 5:36 AM, Chun-Yeow Yeoh <[email protected]> wrote:
> Rate control statistic is flushed whenever the mesh beacon
> is received.
That's terrible! Thanks for catching this.
> This may not optimizes the performance of rate
> control algorithm. This patch ensures that <rate_control_
> rate_init> is called only if the peer's channel type is
> changed.
>
> Signed-off-by: Chun-Yeow Yeoh <[email protected]>
> ---
> net/mac80211/mesh_plink.c | 10 +++++++++-
> net/mac80211/sta_info.h | 4 ++++
> 2 files changed, 13 insertions(+), 1 deletions(-)
>
> diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c
> index 4256859..a3fce28 100644
> --- a/net/mac80211/mesh_plink.c
> +++ b/net/mac80211/mesh_plink.c
> @@ -357,6 +357,7 @@ static struct sta_info *mesh_peer_init(struct ieee80211_sub_if_data *sdata,
> if (!sta)
> return NULL;
> insert = true;
> + sta->mesh_rate_init = false;
> }
>
> spin_lock_bh(&sta->lock);
> @@ -377,9 +378,16 @@ static struct sta_info *mesh_peer_init(struct ieee80211_sub_if_data *sdata,
> ~IEEE80211_HT_CAP_SUP_WIDTH_20_40;
> sta->ch_type =
> ieee80211_ht_oper_to_channel_type(elems->ht_operation);
> + } else {
> + sta->ch_type = NL80211_CHAN_NO_HT;
> + }
> +
> + if (!sta->mesh_rate_init || sta->pre_ch_type != sta->ch_type) {
> + rate_control_rate_init(sta);
> + sta->mesh_rate_init = true;
> + sta->pre_ch_type = sta->ch_type;
> }
I think right now there is an assumption that the peer's ch_type and
other capabilities won't change while a peering is established. In
that case, it seems simpler to just return early if sta->plink_state
== NL80211_PLINK_ESTAB. The sta->last_rx should probably still be
updated though.
Thomas
Hi, Thomas
> I think right now there is an assumption that the peer's ch_type and
> other capabilities won't change while a peering is established. In
> that case, it seems simpler to just return early if sta->plink_state
> == NL80211_PLINK_ESTAB. The sta->last_rx should probably still be
> updated though.
Thanks for your comment. Yes, I think that it will be simpler as you
mention by using plink_state. I will resubmit a patch on this.
Regards,
Chun-Yeow
On 2012-07-20 20:36 +0800, Chun-Yeow Yeoh wrote [email protected]:
Hi, it seems fixed issue with my emty rc_stats.
CY>Rate control statistic is flushed whenever the mesh beacon
CY>is received. This may not optimizes the performance of rate
CY>control algorithm. This patch ensures that <rate_control_
CY>rate_init> is called only if the peer's channel type is
CY>changed.
C ????????? With Best Regards
???????????? ????. Georgiewskiy Yuriy
+7 4872 711666 +7 4872 711666
???? +7 4872 711143 fax +7 4872 711143
???????? ??? "?? ?? ??????" IT Service Ltd
http://nkoort.ru http://nkoort.ru
JID: [email protected] JID: [email protected]
YG129-RIPE YG129-RIPE