Browse Source

qcacmn: Free Rx Desc during WiFi unload

Rx desc pools are reused across wifi up
and wifi down, only nbufs part of these
pools are free during down

Free Rx desc pools during WiFi Unload

CRs-Fixed: 2418941
Change-Id: I5cc3a82d99efd84f51f9eb048cf06da5a4495e55
phadiman 6 năm trước cách đây
mục cha
commit
7dd261d614
3 tập tin đã thay đổi với 32 bổ sung1 xóa
  1. 15 1
      dp/wifi3.0/dp_main.c
  2. 3 0
      dp/wifi3.0/dp_rx.h
  3. 14 0
      dp/wifi3.0/dp_rx_desc.c

+ 15 - 1
dp/wifi3.0/dp_main.c

@@ -3733,7 +3733,8 @@ static void dp_pdev_detach(struct cdp_pdev *txrx_pdev, int force)
 {
 	struct dp_pdev *pdev = (struct dp_pdev *)txrx_pdev;
 	struct dp_soc *soc = pdev->soc;
-	int mac_id;
+	struct rx_desc_pool *rx_desc_pool;
+	int mac_id, mac_for_pdev;
 
 	if (wlan_cfg_per_pdev_tx_ring(soc->wlan_cfg_ctx)) {
 		dp_srng_cleanup(soc, &soc->tcl_data_ring[pdev->pdev_id],
@@ -3756,6 +3757,19 @@ static void dp_pdev_detach(struct cdp_pdev *txrx_pdev, int force)
 		dp_mon_ring_cleanup(soc, pdev, mac_id);
 		dp_srng_cleanup(soc, &pdev->rxdma_err_dst_ring[mac_id],
 				RXDMA_DST, 0);
+		if (dp_is_soc_reinit(soc)) {
+			mac_for_pdev = dp_get_mac_id_for_pdev(mac_id,
+							      pdev->pdev_id);
+			rx_desc_pool = &soc->rx_desc_status[mac_for_pdev];
+			dp_rx_desc_free_array(soc, rx_desc_pool);
+			rx_desc_pool = &soc->rx_desc_mon[mac_for_pdev];
+			dp_rx_desc_free_array(soc, rx_desc_pool);
+		}
+	}
+
+	if (dp_is_soc_reinit(soc)) {
+		rx_desc_pool = &soc->rx_desc_buf[pdev->pdev_id];
+		dp_rx_desc_free_array(soc, rx_desc_pool);
 	}
 
 	soc->pdev_list[pdev->pdev_id] = NULL;

+ 3 - 0
dp/wifi3.0/dp_rx.h

@@ -370,6 +370,9 @@ void dp_rx_desc_pool_free(struct dp_soc *soc,
 void dp_rx_desc_nbuf_pool_free(struct dp_soc *soc,
 			       struct rx_desc_pool *rx_desc_pool);
 
+void dp_rx_desc_free_array(struct dp_soc *soc,
+			   struct rx_desc_pool *rx_desc_pool);
+
 void dp_rx_deliver_raw(struct dp_vdev *vdev, qdf_nbuf_t nbuf_list,
 				struct dp_peer *peer);
 

+ 14 - 0
dp/wifi3.0/dp_rx_desc.c

@@ -125,6 +125,20 @@ void dp_rx_desc_nbuf_pool_free(struct dp_soc *soc,
 	qdf_spinlock_destroy(&rx_desc_pool->lock);
 }
 
+/*
+ * dp_rx_desc_pool_free_array() - free the sw rx desc array called during
+ *			         de-initialization of wifi module.
+ *
+ * @soc: core txrx main context
+ * @pool_id: pool_id which is one of 3 mac_ids
+ * @rx_desc_pool: rx descriptor pool pointer
+ */
+void dp_rx_desc_free_array(struct dp_soc *soc,
+			   struct rx_desc_pool *rx_desc_pool)
+{
+	qdf_mem_free(rx_desc_pool->array);
+}
+
 /*
  * dp_rx_get_free_desc_list() - provide a list of descriptors from
  *				the free rx desc pool.