Skip to contentSkip to conversation

wifi: brcmsmac: clean up unnecessary current_ampdu_cnt and related checks

PATCH In review Dmitry Kandybka 3 participants 3 messages Aug 1, 2024 – Aug 4, 2024 Broadcom BRCM80211 IEEE802.11 wireless drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 wifi: brcmsmac: clean up unnecessary current_ampdu_cnt and related checks

In 'brcms_c_ffpld_check_txfunfl()', 'current_ampdu_cnt' is hardcoded to zero, so 'txunfl_ratio' is always zero as well and some dead code can be removed. Compile tested only.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

---
 .../broadcom/brcm80211/brcmsmac/ampdu.c       | 22 +------------------
 1 file changed, 1 insertion(+), 21 deletions(-)
drivers/net/wireless/broadcom/brcm80211/brcmsmac/ampdu.c +1 -21
index 33d17b779201..a767cbb79185 100644
@@ -351,9 +351,7 @@ static int brcms_c_ffpld_check_txfunfl(struct brcms_c_info *wlc, int fid)
 {
 	struct ampdu_info *ampdu = wlc->ampdu;
 	u32 phy_rate = mcs_2_rate(FFPLD_MAX_MCS, true, false);
-	u32 txunfl_ratio;
 	u8 max_mpdu;
-	u32 current_ampdu_cnt = 0;
 	u16 max_pld_size;
 	u32 new_txunfl;
 	struct brcms_fifo_info *fifo = (ampdu->fifo_tb + fid);
@@ -389,26 +387,8 @@ static int brcms_c_ffpld_check_txfunfl(struct brcms_c_info *wlc, int fid)
 	if (fifo->accum_txfunfl < 10)
 		return 0;
 
-	brcms_dbg_ht(wlc->hw->d11core, "ampdu_count %d  tx_underflows %d\n",
-		     current_ampdu_cnt, fifo->accum_txfunfl);
+	brcms_dbg_ht(wlc->hw->d11core, "tx_underflows %d\n", fifo->accum_txfunfl);
 
-	/*
-	   compute the current ratio of tx unfl per ampdu.
-	   When the current ampdu count becomes too
-	   big while the ratio remains small, we reset
-	   the current count in order to not
-	   introduce too big of a latency in detecting a
-	   large amount of tx underflows later.
-	 */
-
-	txunfl_ratio = current_ampdu_cnt / fifo->accum_txfunfl;
-
-	if (txunfl_ratio > ampdu->tx_max_funl) {
-		if (current_ampdu_cnt >= FFPLD_MAX_AMPDU_CNT)
-			fifo->accum_txfunfl = 0;
-
-		return 0;
-	}
 	max_mpdu = min_t(u8, fifo->mcs2ampdu_table[FFPLD_MAX_MCS],
 			 AMPDU_NUM_MPDU_LEGACY);
 
Signature · 1 line
2.43.5
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Dmitry Kandybka

In 'brcms_c_ffpld_check_txfunfl()', 'current_ampdu_cnt' is hardcoded to zero, so 'txunfl_ratio' is always zero as well and some dead code can be removed. Compile tested only.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Quoted 4 lines

---
.../broadcom/brcm80211/brcmsmac/ampdu.c | 22 +------------------

1 file changed, 1 insertion(+), 21 deletions(-)
#2 lore raw
In reply to Dmitry Kandybka
Quoted 8 lines · Dmitry Kandybka

In 'brcms_c_ffpld_check_txfunfl()', 'current_ampdu_cnt' is hardcoded to zero, so 'txunfl_ratio' is always zero as well and some dead code can be removed. Compile tested only.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Patch applied to wireless-next.git, thanks.

420a549395c2 wifi: brcmsmac: clean up unnecessary current_ampdu_cnt and related checks

Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches