Browse Source

msm: ipa: Fix incorrect common bufffer cache size

"ipa3_replenish_rx_cache" would skip the new buff allocation,
in that case "wlan_comm_total_cnt count" update is not
expected. wlan_comm_total_cnt count needs to be updated based
on new "len" and previous "len" (rx_len_cached).

Change-Id: Iacd15d39e48d2948806d0edfe51d6b328116681d
Signed-off-by: Piyush Dhyani <[email protected]>
Piyush Dhyani 3 years ago
parent
commit
bd4165c96b

+ 10 - 0
drivers/platform/msm/ipa/ipa_v3/ipa_debugfs.c

@@ -1669,6 +1669,16 @@ static ssize_t ipa3_read_wstats(struct file *file, char __user *ubuf,
 			FRMT_STR1, "Tx Pkts Dropped:",
 			ep->wstats.tx_pkts_dropped);
 		cnt += nbytes;
+		if (ep->sys) {
+			nbytes = scnprintf(dbg_buff + cnt, IPA_MAX_MSG_LEN - cnt,
+				FRMT_STR1, "sys len:",
+				ep->sys->len);
+			cnt += nbytes;
+			nbytes = scnprintf(dbg_buff + cnt, IPA_MAX_MSG_LEN - cnt,
+				FRMT_STR1, "rx_pool_sz:",
+				ep->sys->rx_pool_sz);
+			cnt += nbytes;
+		}
 
 nxt_clnt_cons:
 			switch (client) {

+ 1 - 1
drivers/platform/msm/ipa/ipa_v3/ipa_dp.c

@@ -2567,7 +2567,7 @@ static void ipa3_replenish_wlan_rx_cache(struct ipa3_sys_context *sys)
 			 IPA_WLAN_COMM_RX_POOL_HIGH) {
 		ipa3_replenish_rx_cache(sys);
 		ipa3_ctx->wc_memb.wlan_comm_total_cnt +=
-			(sys->rx_pool_sz - rx_len_cached);
+			(sys->len - rx_len_cached);
 	}
 
 	return;