All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Dmitry Antipov <dmantipov@yandex.ru>
Cc: Kalle Valo <kvalo@kernel.org>,
	linux-wireless@vger.kernel.org,  lvc-project@linuxtesting.org,
	 syzbot+fdc5123366fb9c3fdc6d@syzkaller.appspotmail.com
Subject: Re: [PATCH 1/1] wifi: mac80211: ignore the bitrate mask when scanning
Date: Fri, 26 Jan 2024 11:06:50 +0100	[thread overview]
Message-ID: <818ba565b910f87d6863576044a32459cbb84839.camel@sipsolutions.net> (raw)
In-Reply-To: <20240125090737.49673-2-dmantipov@yandex.ru>

On Thu, 2024-01-25 at 12:07 +0300, Dmitry Antipov wrote:
> 
> +++ b/net/mac80211/rate.c
> @@ -351,6 +351,7 @@ static void __rate_control_send_low(struct ieee80211_hw *hw,
>  	int i;
>  	u32 rate_flags =
>  		ieee80211_chandef_rate_flags(&hw->conf.chandef);
> +	bool scanning = !!(info->control.flags & IEEE80211_TX_CTRL_SCAN_TX);
>  
>  	if (sband->band == NL80211_BAND_S1GHZ) {
>  		info->control.rates[0].flags |= IEEE80211_TX_RC_S1G_MCS;
> @@ -364,7 +365,8 @@ static void __rate_control_send_low(struct ieee80211_hw *hw,
>  
>  	info->control.rates[0].idx = 0;
>  	for (i = 0; i < sband->n_bitrates; i++) {
> -		if (!(rate_mask & BIT(i)))
> +		/* Do not use the bitrate mask when scanning. */
> +		if (!scanning && !(rate_mask & BIT(i)))
>  			continue;
> 

I know my patch didn't work, but I think I'd still prefer if we didn't
pass a 0 rate mask around to ignore it - maybe we can just make it ~0 in
the outer place that looks at the sdata mask(s)?

I'm not sure why we fill "BIT(sband->n_bitrates) - 1" rather than ~0 in
the first place, we always (have to) check anyway, so wouldn't really
care about having more bits set than rates exist ...

johannes

  reply	other threads:[~2024-01-26 10:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-17 12:48 [PATCH] wifi: mac80211: don't ask rate control with zero rate mask if scanning Dmitry Antipov
2024-01-18 13:46 ` Johannes Berg
2024-01-19  8:07   ` Dmitry Antipov
2024-01-19 17:19     ` Johannes Berg
2024-01-24 15:11       ` Dmitry Antipov
2024-01-25  9:07       ` [PATCH 0/1] " Dmitry Antipov
2024-01-25  9:07         ` [PATCH 1/1] wifi: mac80211: ignore the bitrate mask when scanning Dmitry Antipov
2024-01-26 10:06           ` Johannes Berg [this message]
2024-01-26 10:05         ` [PATCH 0/1] Re: wifi: mac80211: don't ask rate control with zero rate mask if scanning Johannes Berg

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=818ba565b910f87d6863576044a32459cbb84839.camel@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=dmantipov@yandex.ru \
    --cc=kvalo@kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=lvc-project@linuxtesting.org \
    --cc=syzbot+fdc5123366fb9c3fdc6d@syzkaller.appspotmail.com \
    /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.