Kaynağa Gözat

qcacld-3.0: Fix wrong calculation of DP thread stats

In FISA path number of list elements in head nbuf is not updated,
leading to wrong calculation of dp thread stats and packets are dropped.
Update the number of list elements in head nbuf before flush.

During calculation of outstanding packets to be processed
by dp rx thread take rx flushed packets into consideration.

Change-Id: Id96ceee71e035fdbe17f0da4b662c6f848296fbd
CRs-Fixed: 2811001
Karthik Kantamneni 4 yıl önce
ebeveyn
işleme
51cd57c4d9

+ 2 - 0
core/dp/txrx3.0/dp_fisa_rx.c

@@ -1303,6 +1303,7 @@ dp_rx_fisa_flush_udp_flow(struct dp_vdev *vdev,
 	}
 
 	qdf_nbuf_set_next(fisa_flow->head_skb, NULL);
+	QDF_NBUF_CB_RX_NUM_ELEMENTS_IN_LIST(fisa_flow->head_skb) = 1;
 	if (fisa_flow->last_skb)
 		qdf_nbuf_set_next(fisa_flow->last_skb, NULL);
 
@@ -1773,6 +1774,7 @@ pull_nbuf:
 				     head_nbuf);
 
 deliver_nbuf: /* Deliver without FISA */
+		QDF_NBUF_CB_RX_NUM_ELEMENTS_IN_LIST(head_nbuf) = 1;
 		qdf_nbuf_set_next(head_nbuf, NULL);
 		hex_dump_skb_data(head_nbuf, false);
 		if (!vdev->osif_rx || QDF_STATUS_SUCCESS !=

+ 6 - 2
core/dp/txrx3.0/dp_rx_thread.c

@@ -154,6 +154,7 @@ QDF_STATUS dp_check_and_update_pending(struct dp_rx_tm_handle_cmn
 	uint32_t rx_pending_lo_threshold;
 	uint32_t nbuf_queued_total = 0;
 	uint32_t nbuf_dequeued_total = 0;
+	uint32_t rx_flushed_total = 0;
 	uint32_t pending = 0;
 	int i;
 
@@ -184,11 +185,14 @@ QDF_STATUS dp_check_and_update_pending(struct dp_rx_tm_handle_cmn
 			    rx_tm_hdl->rx_thread[i]->stats.nbuf_queued_total;
 			nbuf_dequeued_total +=
 			    rx_tm_hdl->rx_thread[i]->stats.nbuf_dequeued;
+			rx_flushed_total +=
+			    rx_tm_hdl->rx_thread[i]->stats.rx_flushed;
 		}
 	}
 
-	if (nbuf_queued_total > nbuf_dequeued_total)
-		pending = nbuf_queued_total - nbuf_dequeued_total;
+	if (nbuf_queued_total > (nbuf_dequeued_total + rx_flushed_total))
+		pending = nbuf_queued_total - (nbuf_dequeued_total +
+					       rx_flushed_total);
 
 	if (unlikely(pending > rx_pending_hl_threshold))
 		qdf_atomic_set(&rx_tm_hdl->allow_dropping, 1);