Bug 217652

Summary: ath11k: QCN9074: low data throughput
Product: Drivers Reporter: Tanguy S. (tanguy)
Component: network-wirelessAssignee: drivers_network-wireless (drivers_network-wireless)
Status: NEW ---    
Severity: normal CC: kvalo, michal.smulski
Priority: P3    
Hardware: All   
OS: Linux   
Kernel Version: 6.4 Subsystem:
Regression: Yes Bisected commit-id:
Attachments: HTT_PHY_STATS_TLV
HTT_RX_PDEV_STATS_TLV
HTT_TX_PDEV_STATS_TLV
hostapd_config
dmesg_sta
kernel config

Description Tanguy S. 2023-07-10 10:31:15 UTC
Created attachment 304580 [details]
HTT_PHY_STATS_TLV

Hi everyone, 

Following a message sent to the mailing list, below my investigation. 

I am trying to get high throughput between 2x QCN9074. 

I have tried multiple vendor including: 
1) Emwicon WMX7406
2) Sparklan WPEQ-405AX
3) Compex WLE3000HX

Associating both chips now works however, RX and TX MCS indices remain quite low. 

This behavior is also present when pairing with other APs. 

Namely, HE-MCS in RX goes rarely over 4 and is most of the time at 4 for TX:

Connected to 00:15:61:27:cd:dc (on wlp6s0)
	SSID: SpaceX
	freq: 5745
	RX: 1542818942 bytes (1033835 packets)
	TX: 1180809360 bytes (801938 packets)
	signal: -38 dBm
	rx bitrate: 1729.3 MBit/s 160MHz HE-MCS 4 HE-NSS 4 HE-GI 0 HE-DCM 0
	tx bitrate: 1729.3 MBit/s 160MHz HE-MCS 4 HE-NSS 4 HE-GI 0 HE-DCM 0

	bss flags:	short-slot-time
	dtim period:	4
	beacon int:	100

This gives with iperf3: 
[SUM]   0.00-10.04  sec  1.35 GBytes  1.16 Gbits/sec  136             sender
[SUM]   0.00-10.00  sec  1.35 GBytes  1.16 Gbits/sec                  receiver

Current setup is: 
- Intel x86
- Ubuntu 22.04
- Kernel built from ath 6.4.0-rc6-wt-ath+ (commit:
c60d15f389ef9832a8da410e438d81b10327751f)
with commit reverted from the bug ticket I opened
(https://bugzilla.kernel.org/show_bug.cgi?id=217536).
- 50cm between STA and AP

Best FW for now is 2.5.0: 
sudo md5sum /lib/firmware/ath11k/QCN9074/hw1.0/*
823915206101779f8cab6b89066e1040  /lib/firmware/ath11k/QCN9074/hw1.0/amss.bin
668f53050a92db5b4281ae5f26c7e35d  /lib/firmware/ath11k/QCN9074/hw1.0/board-2.bin
fcca36959c5f56f9f0fb7015083dc806  /lib/firmware/ath11k/QCN9074/hw1.0/m3.bin
3c2311ff705aa9089d7914c5d6e0f12a  /lib/firmware/ath11k/QCN9074/hw1.0/Notice.txt

Using latest FW 2.7.0 leads to lower TX performance and Illegal rate phy errors  count is higher in: 
sudo cat /sys/kernel/debug/ath11k/pci-0000:06:00.0/mac0/fw_stats/pdev_stats
 ath11k PDEV TX stats
 ====================
...
 Illegal rate phy errors          54321
...

I have enabled WMI and MAC debug logs which gives (with some prints added): 

[ 1588.093324] ath11k_pci 0000:06:00.0: wmi cmd vdev set param vdev 0x0 param 7 value 2
[ 1588.093325] ath11k_pci 0000:06:00.0: mac Set slottime: 2 for VDEV: 0
[ 1588.093327] ath11k_pci 0000:06:00.0: mac vdev 0 assoc bssid 00:15:61:27:cd:dc aid 18
[ 1588.093331] ath11k_pci 0000:06:00.0: wmi ath11k_peer_assoc_h_crypto: rsn ie found
[ 1588.093333] ath11k_pci 0000:06:00.0: mac peer 00:15:61:27:cd:dc phymode 11ax-he160
[ 1588.093335] ath11k_pci 0000:06:00.0: mac ht peer 00:15:61:27:cd:dc mcs cnt 32 nss 4
[ 1588.093337] ath11k_pci 0000:06:00.0: mac vht peer 00:15:61:27:cd:dc max_mpdu 1048575 flags 0x0 nss_override 0x0
[ 1588.093339] ath11k_pci 0000:06:00.0: mac he_cap switch IEEE80211_STA_RX_BW_160.
[ 1588.093341] ath11k_pci 0000:06:00.0: mac he_cap switch default.
[ 1588.093342] ath11k_pci 0000:06:00.0: mac he_cap RX rx_mcs_160 0xffaa (mask: 0x40a4f5a8)
[ 1588.093344] ath11k_pci 0000:06:00.0: mac he_cap RX peer_he_rx_mcs_set 0x40a4f7f4 (160BW: 0xffaa)
[ 1588.093345] ath11k_pci 0000:06:00.0: mac he_cap TX tx_mcs_160 0xffaa (mask: 0x40a4f5a8)
[ 1588.093347] ath11k_pci 0000:06:00.0: mac he_cap TX peer_he_tx_mcs_set 0x40a4f800 (160BW: 0xffaa)
[ 1588.093349] ath11k_pci 0000:06:00.0: mac he peer 00:15:61:27:cd:dc nss 4 mcs cnt 2 nss_override 0x80000003
[ 1588.093351] ath11k_pci 0000:06:00.0: mac peer 00:15:61:27:cd:dc qos 1
[ 1588.093354] ath11k_pci 0000:06:00.0: wmi cmd peer assoc vdev id 0 assoc id 1 peer mac 00:15:61:27:cd:dc peer_flags 42a1b406 rate_caps 22e peer_caps 111 listen_intval 5 ht_caps 8cf max_mpdu 8388607 nss 4 phymode 20 peer_mpdu_density 0 vht_caps 3380007a he cap_info 9a18000d he ops 3ff0 he cap_info_ext 1040 he phy 84c600c 9c83dbfc c11 peer_bw_rxnss_override 80000003
[ 1588.095673] ath11k_pci 0000:06:00.0: wmi event peer assoc conf ev vdev id 0 macaddr 00:15:61:27:cd:dc
[ 1588.095704] ath11k_pci 0000:06:00.0: wmi cmd peer set param vdev 0 peer 0x00:15:61:27:cd:dc set param 1 value 0
[ 1588.095708] ath11k_pci 0000:06:00.0: wmi cmd vdev set param vdev 0x0 param 32770 value 48
[ 1588.095712] ath11k_pci 0000:06:00.0: wmi cmd vdev up id 0x0 assoc id 1 bssid 00:15:61:27:cd:dc
[ 1588.095723] ath11k_pci 0000:06:00.0: mac vdev 0 up (associated) bssid 00:15:61:27:cd:dc aid 1
[ 1588.095729] ath11k_pci 0000:06:00.0: wmi cmd pdev obss pd spatial reuse
[ 1588.095731] ath11k_pci 0000:06:00.0: wmi cmd vdev set param vdev 0x0 param 71 value 3
[ 1588.095733] ath11k_pci 0000:06:00.0: mac stop soc 11d scan
[ 1588.095736] ath11k_pci 0000:06:00.0: mac chanctx change freq 5520 width 5 ptr 0000000004d2af9b changed 2
[ 1588.121589] ath11k_pci 0000:06:00.0: mac vdev_id 0 txpower 21
[ 1588.121591] ath11k_pci 0000:06:00.0: mac txpower to set in hw 21
[ 1588.121596] ath11k_pci 0000:06:00.0: wmi cmd pdev set param 4 pdev id 1 value 42
[ 1588.138234] ath11k_pci 0000:06:00.0: wmi cmd vdev install key idx 0 cipher 4 len 16
[ 1588.139214] ath11k_pci 0000:06:00.0: wmi event vdev install key ev idx 0 flags 00000000 macaddr 00:15:61:27:cd:dc status 0
[ 1588.139391] ath11k_pci 0000:06:00.0: wmi cmd vdev install key idx 1 cipher 4 len 16
[ 1588.139894] ath11k_pci 0000:06:00.0: wmi event vdev install key ev idx 1 flags 00000001 macaddr 00:15:61:27:cd:dc status 0
[ 1588.140104] ath11k_pci 0000:06:00.0: mac sta statistics ppdu rssi[0] 0
[ 1588.140107] ath11k_pci 0000:06:00.0: mac sta statistics ppdu rssi[1] 0
[ 1588.140109] ath11k_pci 0000:06:00.0: mac sta statistics ppdu rssi[2] 0
[ 1588.140110] ath11k_pci 0000:06:00.0: mac sta statistics ppdu rssi[3] 0
[ 1588.140112] ath11k_pci 0000:06:00.0: mac sta statistics db2dbm 0 rssi comb 74 rssi beacon 0
[ 1588.140114] ath11k_pci 0000:06:00.0: mac sta statistics fw stats rssi[0] 0
[ 1588.140115] ath11k_pci 0000:06:00.0: mac sta statistics fw stats rssi[1] 0
[ 1588.140117] ath11k_pci 0000:06:00.0: mac sta statistics fw stats rssi[2] 0
[ 1588.140118] ath11k_pci 0000:06:00.0: mac sta statistics fw stats rssi[3] 0
[ 1588.140119] ath11k_pci 0000:06:00.0: mac sta statistics db2dbm 0 rssi comb 74 rssi beacon 0
[ 1588.140121] ath11k_pci 0000:06:00.0: mac sta statistics sinfo->signal -21
[ 1588.140154] ath11k_pci 0000:06:00.0: wmi cmd request stats 0x4 vdev id 0 pdev id 1
[ 1588.141176] ath11k_pci 0000:06:00.0: wmi stats id 0x4 num chain 0
[ 1588.141180] ath11k_pci 0000:06:00.0: wmi event update stats
[ 1588.141205] ath11k_pci 0000:06:00.0: mac txpower from firmware 42, reported 21 dBm
[ 1588.141245] ath11k_pci 0000:06:00.0: wmi cmd pdev bss chan info request type 1
[ 1588.141413] ath11k_pci 0000:06:00.0: wmi event pdev bss chan info:
[ 1588.141514] ath11k_pci 0000:06:00.0: wmi cmd pdev bss chan info request type 1
[ 1588.141644] ath11k_pci 0000:06:00.0: wmi event pdev bss chan info:
[ 1588.141747] ath11k_pci 0000:06:00.0: wmi cmd peer set param vdev 0 peer 0x00:15:61:27:cd:dc set param 3 value 1
[ 1588.141782] ath11k_pci 0000:06:00.0: mac set rekey data vdev 0
[ 1588.141784] ath11k_pci 0000:06:00.0: mac kck
[ 1588.141786] ath11k_pci 0000:06:00.0: 00000000: 82 61 9f 05 0c 04 14 51 f4 59 6a cc 2b 1d 9c 04  .a.....Q.Yj.+...
[ 1588.141787] ath11k_pci 0000:06:00.0: mac kek
[ 1588.141789] ath11k_pci 0000:06:00.0: 00000000: 82 61 9f 05 0c 04 14 51 f4 59 6a cc 2b 1d 9c 04  .a.....Q.Yj.+...
[ 1588.141790] ath11k_pci 0000:06:00.0: mac replay ctr
[ 1588.141791] ath11k_pci 0000:06:00.0: 00000000: 02 00 00 00 00 00 00 00                          ........
[ 1588.145675] ath11k_pci 0000:06:00.0: mac op ipv6 changed
[ 1588.145679] ath11k_pci 0000:06:00.0: mac count 0 ipv6 uc fe80:0000:0000:0000:415f:9494:10b4:5dd8 scope 2
[ 1588.145682] ath11k_pci 0000:06:00.0: mac NS solicited addr ff02:0000:0000:0000:0000:0001:ffb4:5dd8
[ 1588.146306] ath11k_pci 0000:06:00.0: mac arp_addr_cnt 1 vif->addr 00:15:61:27:cd:da, offload_addr 10.0.0.2
[ 1588.151044] ath11k_pci 0000:06:00.0: mac sta statistics ppdu rssi[0] -1
[ 1588.151050] ath11k_pci 0000:06:00.0: mac sta statistics ppdu rssi[1] -1
[ 1588.151051] ath11k_pci 0000:06:00.0: mac sta statistics ppdu rssi[2] -1
[ 1588.151053] ath11k_pci 0000:06:00.0: mac sta statistics ppdu rssi[3] -1
[ 1588.151054] ath11k_pci 0000:06:00.0: mac sta statistics db2dbm 0 rssi comb 74 rssi beacon 0


Most relevant section is:
[ 1588.093354] ath11k_pci 0000:06:00.0: wmi cmd peer assoc vdev id 0 assoc id 1 peer mac 00:15:61:27:cd:dc peer_flags 42a1b406 rate_caps 22e peer_caps 111 listen_intval 5 ht_caps 8cf max_mpdu 8388607 nss 4 phymode 20 peer_mpdu_density 0 vht_caps 3380007a he cap_info 9a18000d he ops 3ff0 he cap_info_ext 1040 he phy 84c600c 9c83dbfc c11 peer_bw_rxnss_override 80000003

I have double checked he capabilities in wmi.c: 
2051: he_mcs->rx_mcs_set = param->peer_he_tx_mcs_set[i]; = 0xFFAA
2052: he_mcs->tx_mcs_set = param->peer_he_rx_mcs_set[i]; = 0xFFAA

I have also pulled htt_stats for TX, RX and PHY attached. 

Seems from these logs that anything related to OFDMA or MUMIMO is not working.
This is also suggested in 
HTT_PHY_COUNTERS_TLV:
rx_ofdma_timing_err_cnt = 171524


Any assistance would be extremely helpful.

Thank you.
Comment 1 Tanguy S. 2023-07-10 10:32:14 UTC
Created attachment 304581 [details]
HTT_RX_PDEV_STATS_TLV
Comment 2 Tanguy S. 2023-07-10 10:32:34 UTC
Created attachment 304582 [details]
HTT_TX_PDEV_STATS_TLV
Comment 3 Tanguy S. 2023-07-10 10:56:56 UTC
Created attachment 304583 [details]
hostapd_config
Comment 4 Tanguy S. 2023-07-11 07:56:52 UTC
Testing 3m apart as suggested, leads to slightly better results on the TX side: MCS index 6 instead of 4. 

However, as for RX previously, 6-7 are the maximum indices I could see. 

> iw wlp6s0 link
Connected to 00:15:61:27:cd:dc (on wlp6s0)
	SSID: SpaceX
	freq: 5520
	RX: 2167311077 bytes (7283470 packets)
	TX: 2984256290 bytes (7782284 packets)
	signal: -45 dBm
	rx bitrate: 2594.2 MBit/s 160MHz HE-MCS 6 HE-NSS 4 HE-GI 0 HE-DCM 0
	tx bitrate: 2594.2 MBit/s 160MHz HE-MCS 6 HE-NSS 4 HE-GI 0 HE-DCM 0

	bss flags:	short-slot-time
	dtim period:	4
	beacon int:	100


Which produces the following throuhgput from STA:

> iperf3 -P2 -R -c 10.0.0.1
[SUM]   0.00-10.04  sec  1.39 GBytes  1.19 Gbits/sec    2             sender
[SUM]   0.00-10.00  sec  1.38 GBytes  1.18 Gbits/sec                  receiver

> iperf3 -P2 -c 10.0.0.1
[SUM]   0.00-10.00  sec  1.38 GBytes  1.19 Gbits/sec    0             sender
[SUM]   0.00-10.04  sec  1.38 GBytes  1.18 Gbits/sec                  receiver

Attached full .config file and dmesg output from STA.
Comment 5 Tanguy S. 2023-07-11 07:58:25 UTC
Created attachment 304607 [details]
dmesg_sta
Comment 6 Tanguy S. 2023-07-11 08:03:14 UTC
Created attachment 304608 [details]
kernel config
Comment 7 Kalle Valo 2023-07-11 09:35:35 UTC
What kind of throughput are you expecting to see?
Comment 8 Tanguy S. 2023-07-11 09:40:52 UTC
2.5 Gb/s would be ideal. Is that realistic ? 

I relaunched hostapd and re-associated without moving the setup and I am back to 

Connected to 00:15:61:27:cd:dc (on wlp6s0)
	SSID: SpaceX
	freq: 5500
	RX: 3617195032 bytes (2428274 packets)
	TX: 1830499898 bytes (1272822 packets)
	signal: -46 dBm
	rx bitrate: 1729.3 MBit/s 160MHz HE-MCS 4 HE-NSS 4 HE-GI 0 HE-DCM 0
	tx bitrate: 1729.3 MBit/s 160MHz HE-MCS 4 HE-NSS 4 HE-GI 0 HE-DCM 0

	bss flags:	short-slot-time
	dtim period:	4
	beacon int:	100
Comment 9 Michal Smulski 2023-07-14 22:54:51 UTC
I have an (ARM based) embedded system with QCN9074 module running Linux 5.15 with backported driver (5.15.92) in client mode. AP is a router with QCN9074 module (running closed sourced driver).

On embedded client:
#iw dev wlan0 link
Connected to 90:09:d0:31:02:77 (on wlan0)
        SSID: xxxxx
        freq: 5745
        RX: 1777648714 bytes (1475595 packets)
        TX: 3011532761 bytes (4820061 packets)
        signal: -95 dBm
        rx bitrate: 1921.5 MBit/s 80MHz HE-MCS 9 HE-NSS 4 HE-GI 0 HE-DCM 0
        tx bitrate: 1729.6 MBit/s 80MHz HE-MCS 8 HE-NSS 4 HE-GI 0 HE-DCM 0

        bss flags:      short-slot-time
        dtim period:    4
        beacon int:     100

The client and router (AP) are close to each other. 'Signal: -95 dBm' is wrong. It looks like a software bug.

iperf3 is limited to the wired connection between router and a laptop (iperf3 -s) so my throughput is around 930Mbit in both directions.