2022-04-08 05:23:38

by Hari Chandrakanthan

[permalink] [raw]
Subject: [PATCH] mac80211 : fix bw change to 40 MHz during channel switch

From: Hari Chandrakanthan <[email protected]>

When AP reduces its channel bandwidth from 80 MHz to 40 MHz, the associated
station reduces the channel bandwidth from 80 MHz to 20 MHz.

In the above case, the associated sta is expected to reduce the channel
bandwidth to 40 MHz.

The API ieee80211_parse_ch_switch_ie which parses CSA element,
checks for 80 MHz and 160 MHz if wide band channel switch element and does not
consider 40 MHz.

From IEEE Std 802.11-2020 9.4.2.162 Channel Switch Wrapper element :

The Wide Bandwidth Channel Switch subelement is present under the
following conditions:
1.Channel switching to a BSS operating channel width of 40 MHz or
wider
2.Extended channel switching to a BSS operating channel width of
80 MHz or wider

So if a station receives a CSA element from AP and if Wide Bandwidth Channel
Switch subelement is present, station can assume that ap is switching to a
bandwidth of 40 MHz and higher.

To fix the issue, station can assume 40 MHz as default new channel bandwidth
if Wide Bandwidth Channel Switch subelement is present.

Signed-off-by: Hari Chandrakanthan <[email protected]>
---
net/mac80211/spectmgmt.c | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/net/mac80211/spectmgmt.c b/net/mac80211/spectmgmt.c
index 76747bf..cc29436 100644
--- a/net/mac80211/spectmgmt.c
+++ b/net/mac80211/spectmgmt.c
@@ -148,6 +148,11 @@ int ieee80211_parse_ch_switch_ie(struct ieee80211_sub_if_data *sdata,
IEEE80211_HT_OP_MODE_CCFS2_SHIFT),
};

+ csa_ie->chandef.width = NL80211_CHAN_WIDTH_40;
+ csa_ie->chandef.center_freq1 =
+ ieee80211_channel_to_frequency(wide_bw_chansw_ie->new_center_freq_seg0,
+ new_chan->band);
+
/* default, for the case of IEEE80211_VHT_CHANWIDTH_USE_HT,
* to the previously parsed chandef
*/
--
2.7.4


2022-04-12 01:03:12

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH] mac80211 : fix bw change to 40 MHz during channel switch


> +++ b/net/mac80211/spectmgmt.c
> @@ -148,6 +148,11 @@ int ieee80211_parse_ch_switch_ie(struct ieee80211_sub_if_data *sdata,
> IEEE80211_HT_OP_MODE_CCFS2_SHIFT),
> };
>
> + csa_ie->chandef.width = NL80211_CHAN_WIDTH_40;
> + csa_ie->chandef.center_freq1 =
> + ieee80211_channel_to_frequency(wide_bw_chansw_ie->new_center_freq_seg0,
> + new_chan->band);
> +
> /* default, for the case of IEEE80211_VHT_CHANWIDTH_USE_HT,
> * to the previously parsed chandef
> */

It seems like this should go under the comment, and change
new_vht_chandef, not csa_ie->chandef?

johannes

2022-04-14 13:20:50

by Oliver Sang

[permalink] [raw]
Subject: [mac80211 ] 865233fbfb: hwsim.p2p_channel_avoid3.fail



Greeting,

FYI, we noticed the following commit (built with gcc-11):

commit: 865233fbfb1f9a18378d1a541c77387775d5215f ("[PATCH] mac80211 : fix bw change to 40 MHz during channel switch")
url: https://github.com/intel-lab-lkp/linux/commits/quic_haric-quicinc-com/mac80211-fix-bw-change-to-40-MHz-during-channel-switch/20220408-125623
base: https://git.kernel.org/cgit/linux/kernel/git/wireless/wireless-next.git main
patch link: https://lore.kernel.org/linux-wireless/[email protected]

in testcase: hwsim
version: hwsim-x86_64-717e5d7-1_20220411
with following parameters:

test: group-11
ucode: 0xec



on test machine: 4 threads Intel(R) Core(TM) i5-6500 CPU @ 3.20GHz with 32G memory

caused below changes (please refer to attached dmesg/kmsg for entire log/backtrace):




If you fix the issue, kindly add following tag
Reported-by: kernel test robot <[email protected]>



2022-04-14 11:04:49 ./run-tests.py p2p_channel_avoid3
DEV: wlan0: 02:00:00:00:00:00
DEV: wlan1: 02:00:00:00:01:00
DEV: wlan2: 02:00:00:00:02:00
APDEV: wlan3
APDEV: wlan4
START p2p_channel_avoid3 1/1
Test: P2P and avoid frequencies driver event on 5 GHz
Form a persistent group
Start GO negotiation wlan0 -> wlan1
wlan1: Trying to discover peer 02:00:00:00:00:00
wlan0: Trying to discover peer 02:00:00:00:01:00
Group formed
Terminate persistent group
Re-invoke persistent group from GO
wlan0: Trying to discover peer 02:00:00:00:01:00
Failed to trigger scan: FAIL-BUSY

Traceback (most recent call last):
File "./run-tests.py", line 535, in main
t(dev)
File "/lkp/benchmarks/hwsim/tests/hwsim/test_p2p_channel.py", line 256, in test_p2p_channel_avoid3
dev[1].flush_scan_cache()
File "/lkp/benchmarks/hwsim/tests/hwsim/wpasupplicant.py", line 1187, in flush_scan_cache
self.scan(freq=freq, only_new=True)
File "/lkp/benchmarks/hwsim/tests/hwsim/wpasupplicant.py", line 1164, in scan
raise Exception("Failed to trigger scan: " + str(res))
Exception: Failed to trigger scan: FAIL-BUSY

FAIL p2p_channel_avoid3 6.108844 2022-04-14 11:04:55.853359
passed 0 test case(s)
skipped 0 test case(s)
failed tests: p2p_channel_avoid3



To reproduce:

git clone https://github.com/intel/lkp-tests.git
cd lkp-tests
sudo bin/lkp install job.yaml # job file is attached in this email
bin/lkp split-job --compatible job.yaml # generate the yaml file for lkp run
sudo bin/lkp run generated-yaml-file

# if come across any failure that blocks the test,
# please remove ~/.lkp and /lkp dir to run from a clean state.



--
0-DAY CI Kernel Test Service
https://01.org/lkp



Attachments:
(No filename) (2.69 kB)
config-5.18.0-rc1-00106-g865233fbfb1f (169.38 kB)
job-script (5.69 kB)
dmesg.xz (49.53 kB)
hwsim (57.55 kB)
job.yaml (4.69 kB)
reproduce (3.94 kB)
Download all attachments