wifi: rtw88: process VO packets without workqueue to avoid PTK rekey failed
authorChih-Kang Chang <gary.chang@realtek.com>
Fri, 16 Jun 2023 03:17:13 +0000 (11:17 +0800)
committerKalle Valo <kvalo@kernel.org>
Wed, 21 Jun 2023 09:41:21 +0000 (12:41 +0300)
commit67d7f24b194e6e8e82540aa4fe97580f6cfa0902
treec9b9f46a708f0618b4803e9b256e33700f40ef16
parent2ce9a91fe8bfb0c8e647a6b7b88055881faf7502
wifi: rtw88: process VO packets without workqueue to avoid PTK rekey failed

In the wpa_supplicant rekey flow, it sends an EAPOL packet 4/4 through
nl80211_tx_control_port() and triggers wake_tx_queue() in the driver.
Then, it sends nl80211_new_key() to configure a new key in mac80211.
However, in wake_tx_queue(), a workqueue is used to process the tx packet,
which might cause the driver to process the EAPOL packet later than
nl80211_new_key(). As a result, the EAPOL 4/4 packet is dropped by mac80211
due to the rekey configuration being finished. The EAPOL packets belongs to
VO packets that need high priority. Therefore, we process VO packets
directly without workqueue to ensure that packets can process immediately.

VO is normally used by voice application that is low traffic load and low
latency, that doesn't affect user experience.
We test iperf with VO packets(iperf3 -P4 -u -b 10000M -S 0xdf)
                          before       after
TX throughput             162M         162M
ping RTT                  3.8ms        3.7ms

Signed-off-by: Chih-Kang Chang <gary.chang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230616031713.16769-1-pkshih@realtek.com
drivers/net/wireless/realtek/rtw88/mac80211.c
drivers/net/wireless/realtek/rtw88/tx.c
drivers/net/wireless/realtek/rtw88/tx.h