All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Aditya Kumar Singh <quic_adisi@quicinc.com>,
	Ping-Ke Shih <pkshih@realtek.com>
Cc: "linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
	 Jeff Johnson <quic_jjohnson@quicinc.com>,
	Ilan Peer <ilan.peer@intel.com>, Jouni Malinen <j@w1.fi>,
	Ryder Lee <ryder.lee@mediatek.com>,
	Arend van Spriel <arend.vanspriel@broadcom.com>,
	 Felix Fietkau <nbd@openwrt.org>
Subject: Re: [PATCH v8 4/5] wifi: mac80211: start and finalize channel switch on link basis
Date: Wed, 21 Feb 2024 14:08:03 +0100	[thread overview]
Message-ID: <31b97f3c18129edd835ca4d968cd59947efab950.camel@sipsolutions.net> (raw)
In-Reply-To: <beee9cc5-6174-473b-bd57-1101430f200b@quicinc.com>

Hi,

On Wed, 2024-02-21 at 18:22 +0530, Aditya Kumar Singh wrote:
> On 2/21/24 13:39, Johannes Berg wrote:
> > Qualcomm:
> >   - copies and updates CSA/ECSA elements all by itself
> >   - btw, not sure here about probe responses, does it do that too?
> 
> We had a thought about keeping this CSA/ECSA handling at host/kernel 
> level only. But the major point of concern is _synchronization_ among 
> firmware of each of the links participating in the MLD.

Sure.

> * Even if we ignore TSF/TBTT synchronization for a moment, how firmware 
> will know when to transmit the beacon with a particular counter or when 
> CSA has finished on other link? If rely on host's update then there is 
> room for further delay and hence errors.
>       - This is because, counter value on the reported link depends on 
> the last beacon transmitted by the affected link.

Sure.

I don't think anyone suggested that the host will put the exact counter
value there, just to have the template.

> * Host can send the template on all links

Right.

> but how to ensure that first 
> template is reached on the affected link and then only on the partner 
> links? Host will queue the command properly but reaping of the command 
> on n (no of links) independent firmware can not be guaranteed in the 
> same order in which host has filled. It depends how busy each of host to 
> firmware path is.

True, and there's a potential for race conditions there I suppose, but I
suppose in the Intel, Realtek and hwsim case at least we wouldn't have
*different* firmwares running multiple links, but a single one.

In any case, you could solve this even with multiple, by applying the
new template only after you have the CSA'ing link's new beacon template,
if it requires filling in CSA counters, or such.

> * And then obviously, considering TSF/TBTT will be again complicating 
> the synchronization part and making it more difficult to manage just via 
> host.

Again, not suggesting that it is managed completely by the host, just
the templates.

> Hence there is a strong urge to let firmware handle all this for beacons.

Sure, that's fine, your call :)

> As far as how firmware will _magically_ communicate among themselves is 
> concerned, we have *IPC* in place to achieve that. One link firmware can 
> talk to other link firmware when required.

:-)

It probably doesn't actually help you make it race-free though, so does
it really matter? But again, it's your call how you want to do it, and
we'll just have to handle it in software appropriately. While I'd prefer
to have _one_ way of doing things, at least so far we've basically seen
one way of having the host involved and ath12k not having the host
involved, so it's all still really simple.

> 				Kernel Level
> ____________________________________________________________________________
>   -------------- 	      -------------- 		 --------------
> >   Firmware 1 |  <- IPC ->  |   Firmware 2 | <- IPC -> |   Firmware 3 |
> >    on HW 1   |	     |    on HW 2   |           |    on HW 3   |
>   -------------- 	      --------------             --------------
> 
> 
> Hence, host just needs to update template of the affected link and 
> indicate to firmware that it is a critical update. This firmware then 
> can indicate other link firmware(s) to append CSA/ECSA IE with a given 
> counter value to its beacon via this IPC.

Sure. You still have a race, because if you send a message over IPC
saying that the CSA needs to be included and it's just before the TBTT,
chances are the TBTT event will still happen without that. So in a sense
it's similar to the host updating the partner link's beacon template
"too late". You can have a situation where the CSA link's template is
updated just before _its_ TBTT, and the partner link's TBTT is just a
little bit later, but the update is delayed ...

You could probably solve that by making your IPC synchronous but then
you risk your TBTT timings in cases like this.

Arguably, I'm not sure it matters. I'm thinking we'll enforce that the
CSA must be in progress when updating the partner links beacon/probe
response templates referring to it (*), but ... ultimately,  I think we
can accept that the partner link updates the CSA one beacon later if
their TBTTs are very close.


(*) and now that I think about it, that might have to immediately come
with a separate template to use _after_ the switch, like CSA does for
the CSA link

>  Parsing the IE and 
> de-fragmenting and fragmenting it again can be done by firmware itself. 
> (Agree that it is bit complex but when comparing with complexity of 
> maintaining synchronicity across links, this looks more doable)

That sync maintenance is because of your hardware design though, others
don't necessarily have that because multiple links are handled by the
same NIC, not separate ones.

> Hence we have taken "offloading beacons fully to firmware" approach.

Sure, fair enough.

> For probe responses, it is handled in host/kernel only. Firmware sends 
> back the last transmitted count in beacon to host. So we have the last 
> transmitted count info. Per STA profile generation logic is also there. 
> So we manage via that.

So I think like in Realtek's case I'd probably advocate doing that in
the driver with the offsets given by hostapd/software stack, although
that requires having *two* feature flags, one for beacons and one for
probe responses ... since you lack the "magic" for probe responses.

johannes

  reply	other threads:[~2024-02-21 13:08 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-30 14:09 [PATCH v8 0/5] wifi: cfg80211/mac80211: add link_id handling in AP channel switch during Multi-Link Operation Aditya Kumar Singh
2024-01-30 14:09 ` [PATCH v8 1/5] wifi: cfg80211: send link id in channel_switch ops Aditya Kumar Singh
2024-01-30 14:09 ` [PATCH v8 2/5] wifi: mac80211: update beacon counters per link basis Aditya Kumar Singh
2024-01-30 14:09 ` [PATCH v8 3/5] wifi: mac80211: handle set csa/after_csa beacon on " Aditya Kumar Singh
2024-01-30 14:09 ` [PATCH v8 4/5] wifi: mac80211: start and finalize channel switch on " Aditya Kumar Singh
2024-02-08 13:48   ` Johannes Berg
2024-02-08 14:05     ` Johannes Berg
2024-02-12  6:40       ` Aditya Kumar Singh
2024-02-12  7:18         ` Aditya Kumar Singh
2024-02-12 14:46           ` Johannes Berg
2024-02-13  5:16             ` Aditya Kumar Singh
2024-02-13  8:42               ` Johannes Berg
2024-02-13  8:45                 ` Johannes Berg
2024-02-13 10:18                 ` Aditya Kumar Singh
2024-02-13 10:55                   ` Johannes Berg
2024-02-13 12:41                     ` Aditya Kumar Singh
2024-02-13 12:49                       ` Johannes Berg
2024-02-21  7:58                         ` Ping-Ke Shih
2024-02-21  8:09                           ` Johannes Berg
2024-02-21  8:19                             ` Ping-Ke Shih
2024-02-21  8:20                               ` Johannes Berg
2024-02-21  8:28                                 ` Ping-Ke Shih
2024-02-21  8:35                                   ` Johannes Berg
2024-02-21  8:57                                     ` Ping-Ke Shih
2024-02-21  8:59                                       ` Johannes Berg
2024-02-21  9:17                                         ` Ping-Ke Shih
2024-02-21  9:19                                           ` Johannes Berg
2024-02-21  9:29                                             ` Ping-Ke Shih
2024-02-21  9:42                             ` Johannes Berg
2024-02-21 12:19                               ` Aditya Kumar Singh
2024-02-21 12:21                               ` Aditya Kumar Singh
2024-02-21 12:52                             ` Aditya Kumar Singh
2024-02-21 13:08                               ` Johannes Berg [this message]
2024-02-21 13:22                                 ` Aditya Kumar Singh
2024-03-11  6:20                             ` Michael-cy Lee (李峻宇)
2024-01-30 14:09 ` [PATCH v8 5/5] wifi: mac80211: add support to call csa_finish on a link Aditya Kumar Singh

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=31b97f3c18129edd835ca4d968cd59947efab950.camel@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=arend.vanspriel@broadcom.com \
    --cc=ilan.peer@intel.com \
    --cc=j@w1.fi \
    --cc=linux-wireless@vger.kernel.org \
    --cc=nbd@openwrt.org \
    --cc=pkshih@realtek.com \
    --cc=quic_adisi@quicinc.com \
    --cc=quic_jjohnson@quicinc.com \
    --cc=ryder.lee@mediatek.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.