Hi all,
I am currently using 802.11s for a project using openWrt mesh portals.
All mesh points use 802.11a (non HT) and minstrel. Airtime metric uses a
"rate"
which is ultimately computed using sta->last_tx_rate from minstrel.
This last_tx_rate is also updated by minstrel attempts at lower and
higher speeds. Even if these occasional attempts are outnumbered by
frames at max_tp_rate[0], they cause unexpected airtime metric
variations resulting in unneeded mesh path changes.
My idea is to use max_tp_rate[0] (from minstrel) instead. This rate is
not subject to minstrel attempts and directly reflects the speed used
for the vast majority of the frames.
In order to validate this idea, I patched the code to retrieve the
max_tp_rate[0] directly from minstrel and then used it in
airtime_link_metric_get (see patch below). This is done in a very ugly
way but the goal is to prove that max_tp_rate[0] is a better candidate
than
sta->last_tx_rate.
Results are really encouraging. The mesh path change is now only related
to error rate or actual rate changes.
I am now stuck trying to implement it in a suitable way (including all
other rate control algorithms). I am planning to do this by creating a
new rate control API function to retrieve the max_tp_rate[0].
Can someone give me some pointers on how to implement it in a correct
way or stop me right now from attempting something that is not desirable
for some reasons.
Thank in advance,
Cedric
---
net/mac80211/mesh_hwmp.c | 8 ++++++--
net/mac80211/rc80211_minstrel.c | 8 ++++++++
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c index
f951468..9662d56 100644
--- a/net/mac80211/mesh_hwmp.c
+++ b/net/mac80211/mesh_hwmp.c
@@ -322,6 +322,8 @@ void ieee80211s_update_metric(struct ieee80211_local
*local,
mesh_plink_broken(sta);
}
+u8 get_max_tp_rate(struct sta_info *si);
+
static u32 airtime_link_metric_get(struct ieee80211_local *local,
struct sta_info *sta)
{
@@ -337,8 +339,10 @@ static u32 airtime_link_metric_get(struct
ieee80211_local *local,
if (sta->fail_avg >= 100)
return MAX_METRIC;
- sta_set_rate_info_tx(sta, &sta->last_tx_rate, &rinfo);
- rate = cfg80211_calculate_bitrate(&rinfo);
+ u8 idx=get_max_tp_rate(sta);
+ struct ieee80211_supported_band *sband;
+ sband =
sta->local->hw.wiphy->bands[ieee80211_get_sdata_band(sta->sdata)];
+ rate = sband->bitrates[idx].bitrate;
if (WARN_ON(!rate))
return MAX_METRIC;
diff --git a/net/mac80211/rc80211_minstrel.c
b/net/mac80211/rc80211_minstrel.c index 270f76f..edf5f62 100644
--- a/net/mac80211/rc80211_minstrel.c
+++ b/net/mac80211/rc80211_minstrel.c
@@ -58,6 +58,14 @@
#define SAMPLE_TBL(_mi, _idx, _col) \
_mi->sample_table[(_idx * SAMPLE_COLUMNS) + _col]
+/* CD le 14/03/2013 */
+u8 get_max_tp_rate(struct sta_info *si) {
+ struct minstrel_sta_info *mi;
+ mi = (struct minstrel_sta_info *)si->rate_ctrl_priv;
+ return mi->max_tp_rate[0];
+}
+
/* convert mac80211 rate index to local array index */ static inline
int rix_to_ndx(struct minstrel_sta_info *mi, int rix)
--
1.7.9.5
_______________________________________________
Devel mailing list
[email protected]
http://lists.open80211s.org/cgi-bin/mailman/listinfo/devel