diff mbox

[1/3] rtlwifi: Reduce IO in RX interrupt to boost throughput

Message ID 20171113093935.20431-2-pkshih@realtek.com (mailing list archive)
State Accepted
Commit fb9829e90dcd5365c45478629e45075560ea8644
Delegated to: Kalle Valo
Headers show

Commit Message

Ping-Ke Shih Nov. 13, 2017, 9:39 a.m. UTC
From: Ping-Ke Shih <pkshih@realtek.com>

Check remaining count of RX packets cost a lot of CPU time, so only update
when the counter decreases to zero. In old flow, the counter was updated
once a RX packet is received.

Signed-off-by: Steven Ting <steventing@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
---
 drivers/net/wireless/realtek/rtlwifi/pci.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Kalle Valo Dec. 7, 2017, 1:15 p.m. UTC | #1
Ping-Ke Shih <pkshih@realtek.com> wrote:

> From: Ping-Ke Shih <pkshih@realtek.com>
> 
> Check remaining count of RX packets cost a lot of CPU time, so only update
> when the counter decreases to zero. In old flow, the counter was updated
> once a RX packet is received.
> 
> Signed-off-by: Steven Ting <steventing@realtek.com>
> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>

3 patches applied to wireless-drivers-next.git, thanks.

fb9829e90dcd rtlwifi: Reduce IO in RX interrupt to boost throughput
dc9682a0cca5 rtlwifi: fix the wrong size to calculate fifo space
cf54622c8076 rtlwifi: cleanup the code that check whether TX ring is available
diff mbox

Patch

diff --git a/drivers/net/wireless/realtek/rtlwifi/pci.c b/drivers/net/wireless/realtek/rtlwifi/pci.c
index c2575b0b9440..ca3f4716c1b6 100644
--- a/drivers/net/wireless/realtek/rtlwifi/pci.c
+++ b/drivers/net/wireless/realtek/rtlwifi/pci.c
@@ -747,7 +747,7 @@  static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw)
 	u8 tmp_one;
 	bool unicast = false;
 	u8 hw_queue = 0;
-	unsigned int rx_remained_cnt;
+	unsigned int rx_remained_cnt = 0;
 	struct rtl_stats stats = {
 		.signal = 0,
 		.rate = 0,
@@ -768,7 +768,8 @@  static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw)
 		struct sk_buff *new_skb;
 
 		if (rtlpriv->use_new_trx_flow) {
-			rx_remained_cnt =
+			if (rx_remained_cnt == 0)
+				rx_remained_cnt =
 				rtlpriv->cfg->ops->rx_desc_buff_remained_cnt(hw,
 								      hw_queue);
 			if (rx_remained_cnt == 0)