summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPing-Ke Shih <pkshih@realtek.com>2022-06-10 15:26:08 +0800
committerKalle Valo <kvalo@kernel.org>2022-06-21 09:15:48 +0300
commitc4756d5de72e549fdaa32a1fab12ae776fca5be7 (patch)
treedeadf962e09547dacff18f77e375cefa4b4c960f
parent9a3a593cba9a6743022ab742c01b06280e8a288a (diff)
downloadlinux-next-c4756d5de72e549fdaa32a1fab12ae776fca5be7.tar.gz
wifi: rtw89: fix long RX latency in low power mode
In low power mode, regular IO is power off, so we don't schedule napi to poll RX and TX completion. Therefore, calling ieee80211_rx_napi() with napi instance causes long RX latency. To fix this, use NULL as argument, and then it can use netif_receive_skb_list() to receive. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20220610072610.27095-10-pkshih@realtek.com
-rw-r--r--drivers/net/wireless/realtek/rtw89/core.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/net/wireless/realtek/rtw89/core.c b/drivers/net/wireless/realtek/rtw89/core.c
index e6b073283609..a5880a54812e 100644
--- a/drivers/net/wireless/realtek/rtw89/core.c
+++ b/drivers/net/wireless/realtek/rtw89/core.c
@@ -1483,11 +1483,17 @@ static void rtw89_core_rx_to_mac80211(struct rtw89_dev *rtwdev,
struct sk_buff *skb_ppdu,
struct ieee80211_rx_status *rx_status)
{
+ struct napi_struct *napi = &rtwdev->napi;
+
+ /* In low power mode, napi isn't scheduled. Receive it to netif. */
+ if (unlikely(!test_bit(NAPI_STATE_SCHED, &napi->state)))
+ napi = NULL;
+
rtw89_core_hw_to_sband_rate(rx_status);
rtw89_core_rx_stats(rtwdev, phy_ppdu, desc_info, skb_ppdu);
/* In low power mode, it does RX in thread context. */
local_bh_disable();
- ieee80211_rx_napi(rtwdev->hw, NULL, skb_ppdu, &rtwdev->napi);
+ ieee80211_rx_napi(rtwdev->hw, NULL, skb_ppdu, napi);
local_bh_enable();
rtwdev->napi_budget_countdown--;
}