1. 如何排查 Wi-Fi TPUT 问题
- 掌握每个 Wi-Fi 协议下的 Wi-Fi TPUT 的计算方法
- 一文让你轻松理解WLAN物理层速率计算方式_wifi速率计算公式-CSDN博客
- 配查 CPU 的资源占用率:interrupt、CPU loading
- Linux/Android 系统使用 mpstat 工具
- 具体工具的使用方法,请自行查询,很简答!
- 协议栈的调优
- Linux/Android 系统使用 mpstat 工具
- 统计 Wi-Fi 报文的 MCS 值、丢包率、空间流个数
- 每家芯片厂商的获取方式有所差异
- 确定测试环境
- 环境嘈杂度
- 天线角度
- 抓取 Wi-Fi driver/FW log
- 每个芯片厂家的方法不同,这里不具体列举,在第二章节以 Qualcomm 的芯片为例,提供一个参考示例。
- 抓取空口 Wi-Fi Sniffer
- 确认带宽、GI、空间流、信号强度、调制解调(Wi-Fi 7支持了4k,速率对应MCS 13)等符合预期;
- 排除 UDP/TCP 差异,尝试先测试 UDP 性能,因为 UDP 是无连接型的,性能会比 TCP 好;
- 切换信道
- 调整聚合包长度
- 确定天线 OTA 性能、传导性能
- 这里就是和发射功率、接收灵敏度相关,涉及到射频、天线等硬件性能指标;
2. Debugging
2.1 How to get txrx status on Qualcomm Wi-Fi platform?
cnss_diag_lite -f -c > /dev/null & // 抓取 Wi-Fi driver/FW logiwpriv wlan0 getConfig // 通过命令行的方式,获取相关信息抓取Wi-Fi Sniffer log,使用Wi-Fi sniffer设备使用Open的加密方式,连接DUTiwpriv wlan0 txrx_stats 20 0 - Reset Host Statsiperf3跑流一段时间Host statsiwpriv wlan0 txrx_stats 21 0 - Rx Rate Statsiwpriv wlan0 txrx_stats 22 0 - Tx Rate Statsiwpriv wlan0 txrx_stats 23 0 - Tx Statsiwpriv wlan0 txrx_stats 24 0 - Rx Statsiwpriv wlan0 txrx_stats 25 0 - AST Statsiwpriv wlan0 txrx_stats 26 0 - Head/Tail Pointer Ring Statsiwpriv wlan0 txrx_stats 24 0 - Monitor Mode StatsFirmware statsiwpriv wlan0 txrx_stats 1 0 - Pdev Tx Statsiwpriv wlan0 txrx_stats 2 0 - Pdev Rx Statsiwpriv wlan0 txrx_stats 3 0 - Pdev Tx HW Queue Statsiwpriv wlan0 txrx_stats 4 0 - Pdev Tx HW Scheduler Statsiwpriv wlan0 txrx_stats 5 0 - Pdev Error Statsiwpriv wlan0 txrx_stats 6 0 - TQM Statsiwpriv wlan0 txrx_stats 7 0 - TQM_CMDQ Statsiwpriv wlan0 txrx_stats 8 0 - Tx_DE_CMN thread Statsiwpriv wlan0 txrx_stats 9 0 - Tx rate statsiwpriv wlan0 txrx_stats 10 0 - Rx rate statsiwpriv wlan0 txrx_stats 11 0 -Peer statsiwpriv wlan0 txrx_stats 12 0 - Tx Self Gen Statsiwpriv wlan0 txrx_stats 13 0 - Tx MU Queue Statsiwpriv wlan0 txrx_stats 15 0 - SRNG Info Statsiwpriv wlan0 txrx_stats 16 0 - SFM Info statsiwpriv wlan0 txrx_stats 17 0 - TX_MU_MIMO_SCHED_INFO Statsiwpriv wlan0 txrx_stats 18 0 - PEER_LIST STATS
2.2 How to get memory status on Qualcomm Wi-Fi platform?
cnss_diag_lite -f -c > /dev/null &iwpriv wlan0 txrx_stats 29 0
Examples
root@imx8qxpmek:~#
iwpriv wlan0 txrx_stats 29 0
[iwpriv][0x5cf3b590][14:07:27.945234]wlan: [3622:IH:DP] AST Table:
[iwpriv][0x5cf3b5b8][14:07:27.945275]wlan: [3622:IH:DP] MEC Stats:
[iwpriv][0x5cf3b5c1][14:07:27.945284]wlan: [3622:IH:DP] Entries Added = 0
[iwpriv][0x5cf3b5ca][14:07:27.945293]wlan: [3622:IH:DP] Entries Deleted = 0
[iwpriv][0x5cf3b5d3][14:07:27.945302]wlan: [3622:IH:DP] Dumping Peer Table Stats:
[soft_i][0x5cf3b5e4][14:07:27.945319]wlan: [0:IH:DP] peer_mac_addr = ae:92:b4:9e:c6:71 nawds_enabled = 0 bss_peer = 0 wds_enabled = 0 tx_cap_enabled = 0 rx_cap_enabled = 0 peer id = 65535
[iwpriv][0x5cf3b5ee][14:07:27.945329]wlan: [3622:D:HDD] __iw_set_var_ints_getnone: exit
[schedu][0x5fab0768][14:08:13.513707]wlan: [3536:D:WMI] send_time_stamp_sync_cmd_tlv: WMA --> DBGLOG_TIME_STAMP_SYNC_CMDID mode 0 time_stamp low 50893513 high 0
[schedu][0x5fab0788][14:08:13.513739]wlan: [3536:D:WMI] wmi_log_cmd_id: Send WMI command:WMI_DBGLOG_TIME_STAMP_SYNC_CMDID command_id:118804 htc_tag:0
[iwpriv][0x60798ff8][14:08:27.049084]wlan: [3623:D:HDD] __iw_set_var_ints_getnone: enter(wlan0)
[iwpriv][0x6079900e][14:08:27.049105]wlan: [3623:D:HDD] __iw_set_var_ints_getnone: Received length 1
[iwpriv][0x6079901b][14:08:27.049118]wlan: [3623:D:HDD] __iw_set_var_ints_getnone: WE_SET_TXRX_STATS stats cmd: 29 mac_id: 0
[iwpriv][0x6079902d][14:08:27.049136]wlan: [3623:IH:DP] dp_txrx_stats_request: stats: 29 fw_stats_type: -1 host_stats: 9
[iwpriv][0x6079905a][14:08:27.049180]wlan: [3623:IH:DP] No. of interrupt contexts: 7
[iwpriv][0x60799065][14:08:27.049192]wlan: [3623:IH:DP] Max clients: 64
[iwpriv][0x60799070][14:08:27.049203]wlan: [3623:IH:DP] Max alloc size: 2097152
[iwpriv][0x6079907b][14:08:27.049214]wlan: [3623:IH:DP] Per pdev tx ring: 1
[iwpriv][0x60799086][14:08:27.049225]wlan: [3623:IH:DP] Num tcl data rings: 3
[iwpriv][0x60799091][14:08:27.049236]wlan: [3623:IH:DP] Per pdev rx ring: 0
[iwpriv][0x6079909c][14:08:27.049247]wlan: [3623:IH:DP] Per pdev lmac ring: 0
[iwpriv][0x607990a7][14:08:27.049258]wlan: [3623:IH:DP] Num of reo dest rings: 4
[iwpriv][0x607990ce][14:08:27.049296]wlan: [3623:IH:DP] Num tx desc pool: 4
[iwpriv][0x607990d7][14:08:27.049306]wlan: [3623:IH:DP] Num tx ext desc pool: 3
[iwpriv][0x607990e0][14:08:27.049315]wlan: [3623:IH:DP] Num tx desc: 4096
[iwpriv][0x607990e9][14:08:27.049324]wlan: [3623:IH:DP] Num tx ext desc: 4096
[iwpriv][0x607990f2][14:08:27.049333]wlan: [3623:IH:DP] Htt packet type: 2
[iwpriv][0x607990fb][14:08:27.049342]wlan: [3623:IH:DP] Max peer_ids: 64
[iwpriv][0x60799104][14:08:27.049351]wlan: [3623:IH:DP] Tx ring size: 3072
[iwpriv][0x6079910d][14:08:27.049360]wlan: [3623:IH:DP] Tx comp ring size: 4096
[iwpriv][0x60799116][14:08:27.049369]wlan: [3623:IH:DP] Tx comp ring size nss: 8192
[iwpriv][0x6079911f][14:08:27.049378]wlan: [3623:IH:DP] Int batch threshold tx: 1
[iwpriv][0x60799128][14:08:27.049387]wlan: [3623:IH:DP] Int timer threshold tx: 8
[iwpriv][0x60799131][14:08:27.049396]wlan: [3623:IH:DP] Int batch threshold rx: 0
[iwpriv][0x6079913a][14:08:27.049405]wlan: [3623:IH:DP] Int timer threshold rx: 512
[iwpriv][0x60799144][14:08:27.049414]wlan: [3623:IH:DP] Int batch threshold other: 1
[iwpriv][0x6079914f][14:08:27.049425]wlan: [3623:IH:DP] Int timer threshold other: 8
[iwpriv][0x6079915f][14:08:27.049442]wlan: [3623:IH:DP] Tx ring mask (0-7): 1 0 0 0 0 0 0
[iwpriv][0x6079916d][14:08:27.049456]wlan: [3623:IH:DP] Rx ring mask (0-7): 0 1 2 4 8 0 0
[iwpriv][0x6079917d][14:08:27.049472]wlan: [3623:IH:DP] Rx mon ring mask (0-7): 0 1 2 0 0 0 0
[iwpriv][0x6079918c][14:08:27.049487]wlan: [3623:IH:DP] Rx err ring mask (0-7): 0 0 0 0 0 0 1
[iwpriv][0x6079919d][14:08:27.049504]wlan: [3623:IH:DP] Rx wbm rel ring mask (0-7): 0 0 0 0 0 0 1
[iwpriv][0x607991aa][14:08:27.049517]wlan: [3623:IH:DP] Reo ring mask (0-7): 0 0 0 0 0 0 1
[iwpriv][0x607991b8][14:08:27.049531]wlan: [3623:IH:DP] Rxdma2host ring mask (0-7): 0 0 0 0 0 1 2
[iwpriv][0x607991c8][14:08:27.049546]wlan: [3623:IH:DP] Host2rxdma ring mask (0-7): 0 0 0 0 0 0 0
[iwpriv][0x607991d6][14:08:27.049561]wlan: [3623:IH:DP] Rx hash: 1
[iwpriv][0x607991df][14:08:27.049570]wlan: [3623:IH:DP] Tso enabled: 1
[iwpriv][0x607991ea][14:08:27.049581]wlan: [3623:IH:DP] Lro enabled: 0
[iwpriv][0x607991f3][14:08:27.049590]wlan: [3623:IH:DP] Sg enabled: 0
[iwpriv][0x607991fd][14:08:27.049600]wlan: [3623:IH:DP] Gro enabled: 1
[iwpriv][0x60799208][14:08:27.049611]wlan: [3623:IH:DP] rawmode enabled: 0
[iwpriv][0x60799211][14:08:27.049620]wlan: [3623:IH:DP] peer flow ctrl enabled: 0
[iwpriv][0x6079921c][14:08:27.049631]wlan: [3623:IH:DP] napi enabled: 1
[iwpriv][0x6079927b][14:08:27.049726]wlan: [3623:IH:DP] P2P Tcp Udp checksum offload: 1
[iwpriv][0x60799285][14:08:27.049736]wlan: [3623:IH:DP] NAN Tcp Udp checksum offload: 1
[iwpriv][0x6079928e][14:08:27.049745]wlan: [3623:IH:DP] Tcp Udp checksum offload: 1
[iwpriv][0x60799297][14:08:27.049754]wlan: [3623:IH:DP] Defrag timeout check: 1
[iwpriv][0x607992a1][14:08:27.049763]wlan: [3623:IH:DP] Rx defrag min timeout: 100
[iwpriv][0x607992ab][14:08:27.049773]wlan: [3623:IH:DP] WBM release ring: 1024
[iwpriv][0x607992b5][14:08:27.049783]wlan: [3623:IH:DP] TCL CMD_CREDIT ring: 32
[iwpriv][0x607992c0][14:08:27.049794]wlan: [3623:IH:DP] TCL Status ring: 32
[iwpriv][0x607992c9][14:08:27.049804]wlan: [3623:IH:DP] REO Reinject ring: 128
[iwpriv][0x607992d2][14:08:27.049813]wlan: [3623:IH:DP] RX release ring: 1024
[iwpriv][0x607992db][14:08:27.049822]wlan: [3623:IH:DP] REO Exception ring: 256
[iwpriv][0x607992e5][14:08:27.049832]wlan: [3623:IH:DP] REO CMD ring: 128
[iwpriv][0x607992f0][14:08:27.049843]wlan: [3623:IH:DP] REO STATUS ring: 256
[iwpriv][0x607992fb][14:08:27.049853]wlan: [3623:IH:DP] RXDMA refill ring: 4096
[iwpriv][0x60799304][14:08:27.049863]wlan: [3623:IH:DP] TX_desc limit_0: 0
[iwpriv][0x6079930f][14:08:27.049873]wlan: [3623:IH:DP] TX_desc limit_1: 0