Skip to contentSkip to conversation

mac80211: minstrel_ht: fix rates selection

PATCH Superseded Karl Beldan 3 participants 6 messages Nov 13, 2013 – Nov 17, 2013 mac80211

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mac80211: minstrel_ht: fix rates selection

From: Karl Beldan <[email protected]>

When initializing rates selections starting indexes upon stats update, the minstrel_sta->max_* rates should be 'group * MCS_GROUP_RATES + i' not 'i'. This affects settings where one of the peers does not support any of the rates of the group 0 (i.e. when ht_cap.mcs.rx_mask[0] == 0).

---
 net/mac80211/rc80211_minstrel_ht.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
net/mac80211/rc80211_minstrel_ht.c +2 -1
index 88c932e..6c173a2 100644
@@ -390,7 +390,8 @@ minstrel_ht_update_stats(struct minstrel_priv *mp, struct minstrel_ht_sta *mi)
 					mg->max_prob_rate = i;
 				if (!mi_rates_valid) {
 					mi->max_tp_rate = mi->max_tp_rate2 =
-						mi->max_prob_rate = i;
+						mi->max_prob_rate =
+						group * MCS_GROUP_RATES + i;
 					mi_rates_valid = true;
 				}
 				mg_rates_valid = true;
Signature · 1 line
1.8.2
#1 lore raw
Quoted 17 lines · Karl Beldan

From: Karl Beldan <[email protected]>

When initializing rates selections starting indexes upon stats update, the minstrel_sta->max_* rates should be 'group * MCS_GROUP_RATES + i' not 'i'. This affects settings where one of the peers does not support any of the rates of the group 0 (i.e. when ht_cap.mcs.rx_mask[0] == 0).

---
 net/mac80211/rc80211_minstrel_ht.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
net/mac80211/rc80211_minstrel_ht.c +0 -0
index 88c932e..6c173a2 100644

net/mac80211/rc80211_minstrel_ht.c minstrel_ht_update_stats(struct minstrel_priv *mp, struct minstrel_ht_sta *mi) · line 394

Quoted 6 lines
net/mac80211/rc80211_minstrel_ht.c +2 -1
@@ -390,7 +390,8 @@ minstrel_ht_update_stats(struct minstrel_priv *mp, struct minstrel_ht_sta *mi)
 					mg->max_prob_rate = i;
 				if (!mi_rates_valid) {
 					mi->max_tp_rate = mi->max_tp_rate2 =
-						mi->max_prob_rate = i;
+						mi->max_prob_rate =
+						group * MCS_GROUP_RATES + i;

How about moving the 'index = ...' line further up and using that instead of duplicating it?

- Felix

#2 lore raw
Quoted 13 lines · Felix Fietkau
Quoted 12 lines · Karl Beldan

From: Karl Beldan <[email protected]>

When initializing rates selections starting indexes upon stats update, the minstrel_sta->max_* rates should be 'group * MCS_GROUP_RATES + i' not 'i'. This affects settings where one of the peers does not support any of the rates of the group 0 (i.e. when ht_cap.mcs.rx_mask[0] == 0).

---
 net/mac80211/rc80211_minstrel_ht.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Quoted 14 lines

net/mac80211/rc80211_minstrel_ht.c minstrel_ht_update_stats(struct minstrel_priv *mp, struct minstrel_ht_sta *mi) · line 394

Quoted 11 lines
net/mac80211/rc80211_minstrel_ht.c +2 -1
index 88c932e..6c173a2 100644
@@ -390,7 +390,8 @@ minstrel_ht_update_stats(struct minstrel_priv *mp, struct minstrel_ht_sta *mi)
 					mg->max_prob_rate = i;
 				if (!mi_rates_valid) {
 					mi->max_tp_rate = mi->max_tp_rate2 =
-						mi->max_prob_rate = i;
+						mi->max_prob_rate =
+						group * MCS_GROUP_RATES + i;

How about moving the 'index = ...' line further up and using that instead of duplicating it?

D'ohf course.

Karl

#3 lore raw

PATCH v2 1/1 mac80211: minstrel_ht: fix rates selection

In reply to Felix Fietkau

From: Karl Beldan <[email protected]>

When initializing rates selections starting indexes upon stats update, the minstrel_sta->max_* rates should be 'group * MCS_GROUP_RATES + i' not 'i'. This affects settings where one of the peers does not support any of the rates of the group 0 (i.e. when ht_cap.mcs.rx_mask[0] == 0).

---
 net/mac80211/rc80211_minstrel_ht.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
net/mac80211/rc80211_minstrel_ht.c +3 -2
index 53db728..e2a57e2 100644
@@ -277,13 +277,15 @@ minstrel_ht_update_stats(struct minstrel_priv *mp, struct minstrel_ht_sta *mi)
 			if (!(mg->supported & BIT(i)))
 				continue;
 
+			index = MCS_GROUP_RATES * group + i;
+
 			/* initialize rates selections starting indexes */
 			if (!mg_rates_valid) {
 				mg->max_tp_rate = mg->max_tp_rate2 =
 					mg->max_prob_rate = i;
 				if (!mi_rates_valid) {
 					mi->max_tp_rate = mi->max_tp_rate2 =
-						mi->max_prob_rate = i;
+						mi->max_prob_rate = index;
 					mi_rates_valid = true;
 				}
 				mg_rates_valid = true;
@@ -291,7 +293,6 @@ minstrel_ht_update_stats(struct minstrel_priv *mp, struct minstrel_ht_sta *mi)
 
 			mr = &mg->rates[i];
 			mr->retry_updated = false;
-			index = MCS_GROUP_RATES * group + i;
 			minstrel_calc_rate_ewma(mr);
 			minstrel_ht_calc_tp(mi, group, i);
 
Signature · 1 line
1.8.2
Acked-by on v2 1/1
#4 lore raw
Quoted 8 lines · Karl Beldan

From: Karl Beldan <[email protected]>

When initializing rates selections starting indexes upon stats update, the minstrel_sta->max_* rates should be 'group * MCS_GROUP_RATES + i' not 'i'. This affects settings where one of the peers does not support any of the rates of the group 0 (i.e. when ht_cap.mcs.rx_mask[0] == 0).

maintainer Applied
#5 lore raw
In reply to Karl Beldan
Quoted 6 lines · Karl Beldan

From: Karl Beldan <[email protected]>

When initializing rates selections starting indexes upon stats update, the minstrel_sta->max_* rates should be 'group * MCS_GROUP_RATES + i' not 'i'. This affects settings where one of the peers does not support any of the rates of the group 0 (i.e. when ht_cap.mcs.rx_mask[0] == 0).

Applied.

johannes