Răsfoiți Sursa

qca-wifi: Free TX/RX_PPDU nbuf after processing

Before this change when peer rate stats are enabled,
TX/RX_PPDU_DESC nbuf was getting free in ol_ath_sched_ppdu_stats()
which is not proper as whoever is consumer should free the buffer.

Change-Id: I0543072ddca7aa14e9092864a8c07229072925a5
CRs-Fixed: 2451257
Amir Patel 6 ani în urmă
părinte
comite
53eceec86d
1 a modificat fișierele cu 10 adăugiri și 0 ștergeri
  1. 10 0
      dp/src/dp_rate_stats.c

+ 10 - 0
dp/src/dp_rate_stats.c

@@ -292,6 +292,11 @@ wlan_peer_update_tx_rate_stats(struct wlan_soc_rate_stats_ctx *soc_stats_ctx,
 		stats_ctx = (struct wlan_peer_rate_stats_ctx *)
 				ppdu_user->cookie;
 
+		if (qdf_unlikely(!ppdu_user->tx_ratekbps ||
+				 ppdu_user->rix > DP_RATE_TABLE_SIZE)) {
+			continue;
+		}
+
 		if (qdf_unlikely(!stats_ctx)) {
 			qdf_debug("peer rate stats ctx is NULL, investigate");
 			qdf_debug("peer_mac: " QDF_MAC_ADDR_STR,
@@ -407,13 +412,18 @@ void wlan_peer_update_rate_stats(void *ctx,
 		cdp_tx_ppdu = (struct cdp_tx_completion_ppdu *)
 					qdf_nbuf_data(nbuf);
 		wlan_peer_update_tx_rate_stats(soc_stats_ctx, cdp_tx_ppdu);
+		qdf_nbuf_free(nbuf);
 		break;
 	case WDI_EVENT_RX_PPDU_DESC:
 		cdp_rx_ppdu = (struct cdp_rx_indication_ppdu *)
 					qdf_nbuf_data(nbuf);
 		wlan_peer_update_rx_rate_stats(soc_stats_ctx, cdp_rx_ppdu);
+		qdf_nbuf_free(nbuf);
 		break;
 	case WDI_EVENT_TX_SOJOURN_STAT:
+		/* sojourn stats buffer is statically allocated buffer
+		 * at pdev level, do not free it
+		 */
 		sojourn_stats = (struct cdp_tx_sojourn_stats *)
 					qdf_nbuf_data(nbuf);
 		wlan_peer_update_sojourn_stats(soc_stats_ctx, sojourn_stats);