linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Ben Greear <greearb@candelatech.com>,
	linux-wireless <linux-wireless@vger.kernel.org>
Subject: Re: Question on why ieee80211_prep_channel clears the IEEE80211_CONN_DISABLE_160MHZ flag.
Date: Tue, 25 Apr 2023 20:32:38 +0200	[thread overview]
Message-ID: <1c2667ea4e668c53cca4d0a1663f7a9fcfc0fb20.camel@sipsolutions.net> (raw)
In-Reply-To: <dab721af-4f9b-20b8-94da-fb1913ff4095@candelatech.com>

On Mon, 2023-04-24 at 12:58 -0700, Ben Greear wrote:
> > > 
> > > 	*conn_flags &= ~(IEEE80211_CONN_DISABLE_40MHZ |
> > > 			 IEEE80211_CONN_DISABLE_80P80MHZ |
> > > 			 IEEE80211_CONN_DISABLE_160MHZ);
> > > 
> > 
> > I'm guessing - I don't really remember right now - that this is so we
> > can make a new decision to set these flags? We don't really clear them
> > in any other place, I guess?

Looks like this goes back to my commit 24398e39c8ee ("mac80211: set HT
channel before association"). But looking at it briefly now, I'm not
really sure why. I mean, it _looks_ like it needs to be preserved to not
flip around the channel type between auth and assoc, but ... why this
way?

> > But honestly I don't know. There's a lot of state and maybe we should
> > just memset() it all whenever we disconnect (get into some kind of idle
> > state), just like we do with the links now that we free...
> 
> We have been running this patch below for 3 or so weeks, and have not noticed any problems.

:)

I'll note that we've also not added 320 MHz here and not seen any
issues, but that may not mean all that much.

> I am personally worried about making bigger changes to this sort of logic (ie, memset),
> as the over all code is convoluted and hard to think through all of the changes
> and use cases.
> 
> The MLO changes seem to have done a better job of splitting up
> the configured vs current settings.  I think that split is key to better
> architecture over all.  Conn-flags is 'configured' as I understand it, so
> probably removing mac80211 code that changes it (as opposed to changing it from
> user-space or other configured input) is in the right direction.

Well my point here was that for the links that aren't deflink we already
now reset them to 0 because we completely free them and reallocate new
ones, and expect that to work. So if that doesn't work for the deflink
we have a problem with the others as well, most likely.

So seems to me we should also reset this data, and see what falls out.
Maybe we'll find bugs that apply to both cases, but hopefully not that
much will break?

> @@ -4762,9 +4762,13 @@ static int ieee80211_prep_channel(struct ieee80211_sub_if_data *sdata,
> 
>   	sband = local->hw.wiphy->bands[cbss->channel->band];
> 
> +	/* This makes our logic to disable 160Mhz (at least) not work.
> +	 * I am not sure it is useful in any case, so commenting out for now.
> +	 * --Ben
>   	*conn_flags &= ~(IEEE80211_CONN_DISABLE_40MHZ |
>   			 IEEE80211_CONN_DISABLE_80P80MHZ |
>   			 IEEE80211_CONN_DISABLE_160MHZ);
> +	*/
> 
>   	/* disable HT/VHT/HE if we don't support them */
>   	if (!sband->ht_cap.ht_supported && !is_6ghz) {
> 
> I can send a patch to just remove those three lines if you think that is good approach?

I wish I knew :)

Clearly we eventually still call ieee80211_determine_chantype(), which
should result in the same calculations again, right? And while it gets
the input conn_flags, it anyway doesn't check the bandwidth bits
there...

So _seems_ safe? Maybe we were trying to be able to upgrade a connection
to 40 MHz later on assoc, originally?

johannes

      reply	other threads:[~2023-04-25 18:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-30 23:55 Question on why ieee80211_prep_channel clears the IEEE80211_CONN_DISABLE_160MHZ flag Ben Greear
2023-04-24 16:58 ` Johannes Berg
2023-04-24 19:58   ` Ben Greear
2023-04-25 18:32     ` Johannes Berg [this message]

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=1c2667ea4e668c53cca4d0a1663f7a9fcfc0fb20.camel@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=greearb@candelatech.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 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).