* [PATCH] mac80211: minstrel_ht: fix rates selection
@ 2013-11-13 17:41 Karl Beldan
2013-11-13 21:20 ` Felix Fietkau
0 siblings, 1 reply; 6+ messages in thread
From: Karl Beldan @ 2013-11-13 17:41 UTC (permalink / raw)
To: Johannes Berg; +Cc: Felix Fietkau, linux-wireless, Karl Beldan
From: Karl Beldan <karl.beldan@rivierawaves.com>
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).
Signed-off-by: Karl Beldan <karl.beldan@rivierawaves.com>
---
net/mac80211/rc80211_minstrel_ht.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/mac80211/rc80211_minstrel_ht.c b/net/mac80211/rc80211_minstrel_ht.c
index 88c932e..6c173a2 100644
--- a/net/mac80211/rc80211_minstrel_ht.c
+++ b/net/mac80211/rc80211_minstrel_ht.c
@@ -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;
--
1.8.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] mac80211: minstrel_ht: fix rates selection
2013-11-13 17:41 [PATCH] mac80211: minstrel_ht: fix rates selection Karl Beldan
@ 2013-11-13 21:20 ` Felix Fietkau
2013-11-13 22:03 ` Karl Beldan
2013-11-13 22:07 ` [PATCH v2] " Karl Beldan
0 siblings, 2 replies; 6+ messages in thread
From: Felix Fietkau @ 2013-11-13 21:20 UTC (permalink / raw)
To: Karl Beldan, Johannes Berg; +Cc: linux-wireless
On 2013-11-13 18:41, Karl Beldan wrote:
> From: Karl Beldan <karl.beldan@rivierawaves.com>
>
> 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).
>
> Signed-off-by: Karl Beldan <karl.beldan@rivierawaves.com>
> ---
> net/mac80211/rc80211_minstrel_ht.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/net/mac80211/rc80211_minstrel_ht.c b/net/mac80211/rc80211_minstrel_ht.c
> index 88c932e..6c173a2 100644
> --- a/net/mac80211/rc80211_minstrel_ht.c
> +++ b/net/mac80211/rc80211_minstrel_ht.c
> @@ -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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] mac80211: minstrel_ht: fix rates selection
2013-11-13 21:20 ` Felix Fietkau
@ 2013-11-13 22:03 ` Karl Beldan
2013-11-13 22:07 ` [PATCH v2] " Karl Beldan
1 sibling, 0 replies; 6+ messages in thread
From: Karl Beldan @ 2013-11-13 22:03 UTC (permalink / raw)
To: Felix Fietkau; +Cc: Johannes Berg, linux-wireless
On Wed, Nov 13, 2013 at 10:20:49PM +0100, Felix Fietkau wrote:
> On 2013-11-13 18:41, Karl Beldan wrote:
> > From: Karl Beldan <karl.beldan@rivierawaves.com>
> >
> > 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).
> >
> > Signed-off-by: Karl Beldan <karl.beldan@rivierawaves.com>
> > ---
> > net/mac80211/rc80211_minstrel_ht.c | 3 ++-
> > 1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/net/mac80211/rc80211_minstrel_ht.c b/net/mac80211/rc80211_minstrel_ht.c
> > index 88c932e..6c173a2 100644
> > --- a/net/mac80211/rc80211_minstrel_ht.c
> > +++ b/net/mac80211/rc80211_minstrel_ht.c
> > @@ -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
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2] mac80211: minstrel_ht: fix rates selection
2013-11-13 21:20 ` Felix Fietkau
2013-11-13 22:03 ` Karl Beldan
@ 2013-11-13 22:07 ` Karl Beldan
2013-11-13 22:11 ` Felix Fietkau
2013-11-17 9:31 ` Johannes Berg
1 sibling, 2 replies; 6+ messages in thread
From: Karl Beldan @ 2013-11-13 22:07 UTC (permalink / raw)
To: Johannes Berg; +Cc: Felix Fietkau, linux-wireless, Karl Beldan
From: Karl Beldan <karl.beldan@rivierawaves.com>
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).
Signed-off-by: Karl Beldan <karl.beldan@rivierawaves.com>
---
net/mac80211/rc80211_minstrel_ht.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/net/mac80211/rc80211_minstrel_ht.c b/net/mac80211/rc80211_minstrel_ht.c
index 53db728..e2a57e2 100644
--- a/net/mac80211/rc80211_minstrel_ht.c
+++ b/net/mac80211/rc80211_minstrel_ht.c
@@ -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);
--
1.8.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v2] mac80211: minstrel_ht: fix rates selection
2013-11-13 22:07 ` [PATCH v2] " Karl Beldan
@ 2013-11-13 22:11 ` Felix Fietkau
2013-11-17 9:31 ` Johannes Berg
1 sibling, 0 replies; 6+ messages in thread
From: Felix Fietkau @ 2013-11-13 22:11 UTC (permalink / raw)
To: Karl Beldan, Johannes Berg; +Cc: linux-wireless, Karl Beldan
On 2013-11-13 23:07, Karl Beldan wrote:
> From: Karl Beldan <karl.beldan@rivierawaves.com>
>
> 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).
>
> Signed-off-by: Karl Beldan <karl.beldan@rivierawaves.com>
Acked-by: Felix Fietkau <nbd@openwrt.org>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] mac80211: minstrel_ht: fix rates selection
2013-11-13 22:07 ` [PATCH v2] " Karl Beldan
2013-11-13 22:11 ` Felix Fietkau
@ 2013-11-17 9:31 ` Johannes Berg
1 sibling, 0 replies; 6+ messages in thread
From: Johannes Berg @ 2013-11-17 9:31 UTC (permalink / raw)
To: Karl Beldan; +Cc: Felix Fietkau, linux-wireless, Karl Beldan
On Wed, 2013-11-13 at 23:07 +0100, Karl Beldan wrote:
> From: Karl Beldan <karl.beldan@rivierawaves.com>
>
> 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
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2013-11-17 9:31 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-13 17:41 [PATCH] mac80211: minstrel_ht: fix rates selection Karl Beldan
2013-11-13 21:20 ` Felix Fietkau
2013-11-13 22:03 ` Karl Beldan
2013-11-13 22:07 ` [PATCH v2] " Karl Beldan
2013-11-13 22:11 ` Felix Fietkau
2013-11-17 9:31 ` Johannes Berg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).