فهرست منبع

qcacmn: Use the appropriate desc pool for mon status ring

In dp_mon_status_srng_drop_for_mac, the rx_desc pool
used for status ring is dest ring desc pool which is
not the appropriate one.

Fix is to use the appropriate desc pool for mon status
ring.

Change-Id: I6f178354789212b375a7a541366bef590a925568
CRs-Fixed: 2800658
Yeshwanth Sriram Guntuka 4 سال پیش
والد
کامیت
7e9e7e4bcd
3فایلهای تغییر یافته به همراه20 افزوده شده و 5 حذف شده
  1. 1 0
      dp/inc/cdp_txrx_mon_struct.h
  2. 18 3
      dp/wifi3.0/dp_rx_mon_dest.c
  3. 1 2
      dp/wifi3.0/dp_rx_mon_status.c

+ 1 - 0
dp/inc/cdp_txrx_mon_struct.h

@@ -261,5 +261,6 @@ struct cdp_pdev_mon_stats {
 	uint32_t dest_ppdu_drop;
 	uint32_t mon_link_desc_invalid;
 	uint32_t mon_rx_desc_invalid;
+	uint32_t mon_nbuf_sanity_err;
 };
 #endif

+ 18 - 3
dp/wifi3.0/dp_rx_mon_dest.c

@@ -2090,11 +2090,11 @@ dp_mon_dest_srng_drop_for_mac(struct dp_pdev *pdev, uint32_t mac_id)
 	while ((rxdma_dst_ring_desc =
 		hal_srng_dst_peek(hal_soc, mon_dst_srng)) &&
 		reap_cnt < MON_DROP_REAP_LIMIT) {
-		msdu_count = 0;
+
+		hal_rx_reo_ent_buf_paddr_get(rxdma_dst_ring_desc,
+					     &buf_info, &msdu_count);
 
 		do {
-			hal_rx_reo_ent_buf_paddr_get(rxdma_dst_ring_desc,
-						     &buf_info, &msdu_count);
 			rx_msdu_link_desc = dp_rx_cookie_2_mon_link_desc(pdev,
 							      buf_info, mac_id);
 
@@ -2108,6 +2108,7 @@ dp_mon_dest_srng_drop_for_mac(struct dp_pdev *pdev, uint32_t mac_id)
 
 			for (i = 0; i < num_msdus; i++) {
 				struct dp_rx_desc *rx_desc;
+				qdf_dma_addr_t buf_paddr;
 
 				rx_desc = dp_rx_get_mon_desc(soc,
 							msdu_list.sw_cookie[i]);
@@ -2119,6 +2120,16 @@ dp_mon_dest_srng_drop_for_mac(struct dp_pdev *pdev, uint32_t mac_id)
 				}
 
 				nbuf = DP_RX_MON_GET_NBUF_FROM_DESC(rx_desc);
+				buf_paddr =
+					 dp_rx_mon_get_paddr_from_desc(rx_desc);
+
+				if (qdf_unlikely(!rx_desc->in_use || !nbuf ||
+						 msdu_list.paddr[i] !=
+						 buf_paddr)) {
+					pdev->rx_mon_stats.
+							mon_nbuf_sanity_err++;
+					continue;
+				}
 				rx_bufs_used++;
 
 				if (!rx_desc->unmapped) {
@@ -2130,6 +2141,10 @@ dp_mon_dest_srng_drop_for_mac(struct dp_pdev *pdev, uint32_t mac_id)
 				qdf_nbuf_free(nbuf);
 				dp_rx_add_to_free_desc_list(&head, &tail,
 							    rx_desc);
+
+				if (!(msdu_list.msdu_info[i].msdu_flags &
+				      HAL_MSDU_F_MSDU_CONTINUATION))
+					msdu_count--;
 			}
 
 			/*

+ 1 - 2
dp/wifi3.0/dp_rx_mon_status.c

@@ -2466,8 +2466,7 @@ dp_mon_status_srng_drop_for_mac(struct dp_pdev *pdev, uint32_t mac_id,
 			struct dp_rx_desc *rx_desc;
 			union dp_rx_desc_list_elem_t *rx_desc_elem;
 
-			rx_desc_pool = dp_rx_get_mon_desc_pool(soc, mac_id,
-							       pdev->pdev_id);
+			rx_desc_pool = &soc->rx_desc_status[mac_id];
 
 			qdf_spin_lock_bh(&rx_desc_pool->lock);