All of lore.kernel.org
 help / color / mirror / Atom feed
From: Felix Fietkau <nbd@openwrt.org>
To: Karl Beldan <karl.beldan@gmail.com>,
	Johannes Berg <johannes@sipsolutions.net>
Cc: linux-wireless <linux-wireless@vger.kernel.org>
Subject: Re: [PATCH 2/2] mac80211: minstrel_ht: do not sample unsupported rates
Date: Fri, 08 Nov 2013 17:43:35 +0100	[thread overview]
Message-ID: <527D14B7.3090204@openwrt.org> (raw)
In-Reply-To: <1383928473-798-2-git-send-email-karl.beldan@gmail.com>

On 2013-11-08 17:34, Karl Beldan wrote:
> From: Karl Beldan <karl.beldan@rivierawaves.com>
> 
> ATM minstrel_ht does not check whether the sampling rate is supported.
> Unsupported rates attempts can trigger when there are holes between
> supported MCSes belonging to the same group (e.g many devices are
> capable of MCS32 without being capable of MCS33->MCS39).
> This change replaces an unsupported sample index with the fls of the
> bitfield of supported indexes.
> This is not a problem in minstrel which fills a per STA sample table
> with only supported rates (though only at init).
> 
> Signed-off-by: Karl Beldan <karl.beldan@rivierawaves.com>
> ---
>  net/mac80211/rc80211_minstrel_ht.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/net/mac80211/rc80211_minstrel_ht.c b/net/mac80211/rc80211_minstrel_ht.c
> index aeec401..1b835ad 100644
> --- a/net/mac80211/rc80211_minstrel_ht.c
> +++ b/net/mac80211/rc80211_minstrel_ht.c
> @@ -703,6 +703,8 @@ minstrel_get_sample_rate(struct minstrel_priv *mp, struct minstrel_ht_sta *mi)
>  
>  	mg = &mi->groups[mi->sample_group];
>  	sample_idx = sample_table[mg->column][mg->index];
> +	if (!(mg->supported & BIT(sample_idx)))
> +		sample_idx = fls(sample_idx) - 1;
You probably meant fls(mg->supported) - 1 here, however I think a better
approach would be to just skip the sample attempt. If there are fewer
rates in a group, we can run fewer sample attempts on it.

- Felix

  reply	other threads:[~2013-11-08 16:43 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-08 16:34 [PATCH 1/2] mac80211: minstrels: spare numerous useless calls to get_random_bytes Karl Beldan
2013-11-08 16:34 ` [PATCH 2/2] mac80211: minstrel_ht: do not sample unsupported rates Karl Beldan
2013-11-08 16:43   ` Felix Fietkau [this message]
2013-11-08 16:54     ` Karl Beldan
2013-11-11 12:10     ` [PATCH v2] " Karl Beldan
2013-11-11 15:46       ` Johannes Berg
2013-11-11 19:44         ` Karl Beldan
2013-11-08 16:39 ` [PATCH 1/2] mac80211: minstrels: spare numerous useless calls to get_random_bytes Felix Fietkau
2013-11-11 15:45 ` Johannes Berg
2013-11-11 19:43   ` Karl Beldan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=527D14B7.3090204@openwrt.org \
    --to=nbd@openwrt.org \
    --cc=johannes@sipsolutions.net \
    --cc=karl.beldan@gmail.com \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.