Commit 5935839a authored by Thomas Huehn's avatar Thomas Huehn Committed by Johannes Berg

mac80211: improve minstrel_ht rate sorting by throughput & probability

This patch improves the way minstrel_ht sorts rates according to throughput
and success probability. 3 FOR-loops across the entire rate and mcs group set
in function minstrel_ht_update_stats() which where used to determine the
fastest, second fastest and most robust rate are reduced to 2 FOR-loop.

The sorted list of rates according throughput is extended to the best four
rates as we need them in upcoming joint rate and power control. The sorting
is done via the new function minstrel_ht_sort_best_tp_rates(). The annotation
of those 4 best throughput rates in the debugfs file rc-stats is changes to:
"A,B,C,D", where A is the fastest rate and C the 4th fastest.
Signed-off-by: default avatarThomas Huehn <thomas@net.t-labs.tu-berlin.de>
Tested-by: default avatarStefan Venz <ikstream86@gmail.com>
Acked-by: default avatarFelix Fietkau <nbd@openwrt.org>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent ca12c0c8
This diff is collapsed.
...@@ -33,10 +33,9 @@ struct minstrel_mcs_group_data { ...@@ -33,10 +33,9 @@ struct minstrel_mcs_group_data {
/* bitfield of supported MCS rates of this group */ /* bitfield of supported MCS rates of this group */
u8 supported; u8 supported;
/* selected primary rates */ /* sorted rate set within a MCS group*/
unsigned int max_tp_rate; u8 max_group_tp_rate[MAX_THR_RATES];
unsigned int max_tp_rate2; u8 max_group_prob_rate;
unsigned int max_prob_rate;
/* MCS rate statistics */ /* MCS rate statistics */
struct minstrel_rate_stats rates[MCS_GROUP_RATES]; struct minstrel_rate_stats rates[MCS_GROUP_RATES];
...@@ -52,15 +51,9 @@ struct minstrel_ht_sta { ...@@ -52,15 +51,9 @@ struct minstrel_ht_sta {
/* ampdu length (EWMA) */ /* ampdu length (EWMA) */
unsigned int avg_ampdu_len; unsigned int avg_ampdu_len;
/* best throughput rate */ /* overall sorted rate set */
unsigned int max_tp_rate; u8 max_tp_rate[MAX_THR_RATES];
u8 max_prob_rate;
/* second best throughput rate */
unsigned int max_tp_rate2;
/* best probability rate */
unsigned int max_prob_rate;
unsigned int max_prob_streams;
/* time of last status update */ /* time of last status update */
unsigned long stats_update; unsigned long stats_update;
......
...@@ -46,8 +46,10 @@ minstrel_ht_stats_dump(struct minstrel_ht_sta *mi, int i, char *p) ...@@ -46,8 +46,10 @@ minstrel_ht_stats_dump(struct minstrel_ht_sta *mi, int i, char *p)
else else
p += sprintf(p, "HT%c0/%cGI ", htmode, gimode); p += sprintf(p, "HT%c0/%cGI ", htmode, gimode);
*(p++) = (idx == mi->max_tp_rate) ? 'T' : ' '; *(p++) = (idx == mi->max_tp_rate[0]) ? 'A' : ' ';
*(p++) = (idx == mi->max_tp_rate2) ? 't' : ' '; *(p++) = (idx == mi->max_tp_rate[1]) ? 'B' : ' ';
*(p++) = (idx == mi->max_tp_rate[2]) ? 'C' : ' ';
*(p++) = (idx == mi->max_tp_rate[3]) ? 'D' : ' ';
*(p++) = (idx == mi->max_prob_rate) ? 'P' : ' '; *(p++) = (idx == mi->max_prob_rate) ? 'P' : ' ';
if (i == max_mcs) { if (i == max_mcs) {
...@@ -100,8 +102,8 @@ minstrel_ht_stats_open(struct inode *inode, struct file *file) ...@@ -100,8 +102,8 @@ minstrel_ht_stats_open(struct inode *inode, struct file *file)
file->private_data = ms; file->private_data = ms;
p = ms->buf; p = ms->buf;
p += sprintf(p, "type rate throughput ewma prob this prob " p += sprintf(p, "type rate throughput ewma prob "
"retry this succ/attempt success attempts\n"); "this prob retry this succ/attempt success attempts\n");
p = minstrel_ht_stats_dump(mi, max_mcs, p); p = minstrel_ht_stats_dump(mi, max_mcs, p);
for (i = 0; i < max_mcs; i++) for (i = 0; i < max_mcs; i++)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment