Prechádzať zdrojové kódy

qcacmn: Changes to make correct buffer allocation for monitor

Changes to allocate correct number of buffers for monitor during boot
time and allocate remaining buffers only when monitor vap is created.

Change-Id: I8a2cd7b6a20a281934c47ca0418904b426d17a4d
CRs-Fixed: 3432525
Hariharan Ramanathan 2 rokov pred
rodič
commit
7a22157418
1 zmenil súbory, kde vykonal 10 pridanie a 6 odobranie
  1. 10 6
      dp/wifi3.0/monitor/2.0/dp_mon_2.0.c

+ 10 - 6
dp/wifi3.0/monitor/2.0/dp_mon_2.0.c

@@ -881,8 +881,8 @@ QDF_STATUS dp_rx_mon_refill_buf_ring_2_0(struct dp_intr *int_ctx)
 	struct dp_srng *rx_mon_buf_ring;
 	struct dp_intr_stats *intr_stats = &int_ctx->intr_stats;
 	struct dp_mon_soc_be *mon_soc_be = dp_get_be_mon_soc_from_dp_mon_soc(mon_soc);
-	uint32_t num_entries_avail;
-	int sync_hw_ptr = 1, hp = 0, tp = 0, num_entries;
+	uint32_t num_entries_avail, num_entries, num_entries_in_ring;
+	int sync_hw_ptr = 1, hp = 0, tp = 0;
 	void *hal_srng;
 
 	rx_mon_buf_ring = &soc->rxdma_mon_buf_ring[0];
@@ -894,18 +894,22 @@ QDF_STATUS dp_rx_mon_refill_buf_ring_2_0(struct dp_intr *int_ctx)
 	num_entries_avail = hal_srng_src_num_avail(soc->hal_soc,
 						   hal_srng,
 						   sync_hw_ptr);
+	num_entries_in_ring = rx_mon_buf_ring->num_entries - num_entries_avail;
 	hal_get_sw_hptp(soc->hal_soc, (hal_ring_handle_t)hal_srng, &tp, &hp);
 	hal_srng_access_end(soc->hal_soc, hal_srng);
 
-	num_entries = num_entries_avail;
-	if (mon_soc_be->rx_mon_ring_fill_level < rx_mon_buf_ring->num_entries)
-		num_entries = num_entries_avail - mon_soc_be->rx_mon_ring_fill_level;
+	if (num_entries_avail) {
+		if (num_entries_in_ring < mon_soc_be->rx_mon_ring_fill_level)
+			num_entries = mon_soc_be->rx_mon_ring_fill_level
+				      - num_entries_in_ring;
+		else
+			return QDF_STATUS_SUCCESS;
 
-	if (num_entries)
 		dp_mon_buffers_replenish(soc, rx_mon_buf_ring,
 					 &mon_soc_be->rx_desc_mon,
 					 num_entries, &desc_list, &tail,
 					 NULL);
+	}
 
 	return QDF_STATUS_SUCCESS;
 }