Ver Fonte

qcacmn: Add support for MEC stats and null queue stats

Add support for MEC stats and null queue stats

Change-Id: Ie523d8e5cbca6660cd5477d152360db448d75708
Tallapragada Kalyan há 6 anos atrás
pai
commit
5deeef2fec

+ 2 - 0
dp/inc/cdp_txrx_stats_struct.h

@@ -309,6 +309,7 @@ struct cdp_tx_stats {
  * @bcast:  Broadcast Packet Count
  * @raw: Raw Pakets received
  * @nawds_mcast_drop: Total multicast packets
+ * @mec_drop: Total MEC packets dropped
  * @pkts: Intra BSS packets received
  * @fail: Intra BSS packets failed
  * @mic_err: Rx MIC errors CCMP
@@ -357,6 +358,7 @@ struct cdp_rx_stats {
 	struct cdp_pkt_info bcast;
 	struct cdp_pkt_info raw;
 	uint32_t nawds_mcast_drop;
+	struct cdp_pkt_info mec_drop;
 	struct {
 		struct cdp_pkt_info pkts;
 		struct cdp_pkt_info fail;

+ 5 - 0
dp/wifi3.0/dp_internal.h

@@ -366,6 +366,8 @@ static inline void dp_update_pdev_stats(struct dp_pdev *tgtobj,
 
 	tgtobj->stats.tx.last_ack_rssi =
 		srcobj->tx.last_ack_rssi;
+	tgtobj->stats.rx.mec_drop.num += srcobj->rx.mec_drop.num;
+	tgtobj->stats.rx.mec_drop.bytes += srcobj->rx.mec_drop.bytes;
 }
 
 static inline void dp_update_vdev_stats(struct cdp_vdev_stats *tgtobj,
@@ -494,6 +496,8 @@ static inline void dp_update_vdev_stats(struct cdp_vdev_stats *tgtobj,
 			srcobj->stats.rx.intra_bss.fail.bytes;
 	tgtobj->tx.last_ack_rssi =
 		srcobj->stats.tx.last_ack_rssi;
+	tgtobj->rx.mec_drop.num += srcobj->stats.rx.mec_drop.num;
+	tgtobj->rx.mec_drop.bytes += srcobj->stats.rx.mec_drop.bytes;
 }
 
 #define DP_UPDATE_STATS(_tgtobj, _srcobj)	\
@@ -581,6 +585,7 @@ static inline void dp_update_vdev_stats(struct cdp_vdev_stats *tgtobj,
 		DP_STATS_AGGR_PKT(_tgtobj, _srcobj, rx.raw); \
 		DP_STATS_AGGR_PKT(_tgtobj, _srcobj, rx.intra_bss.pkts); \
 		DP_STATS_AGGR_PKT(_tgtobj, _srcobj, rx.intra_bss.fail); \
+		DP_STATS_AGGR_PKT(_tgtobj, _srcobj, rx.mec_drop); \
 								  \
 		_tgtobj->stats.tx.last_ack_rssi =	\
 			_srcobj->stats.tx.last_ack_rssi; \

+ 8 - 4
dp/wifi3.0/dp_main.c

@@ -5812,6 +5812,10 @@ dp_print_pdev_rx_stats(struct dp_pdev *pdev)
 			pdev->stats.dropped.msdu_not_done);
 	DP_PRINT_STATS("        mon_rx_drop = %d",
 			pdev->stats.dropped.mon_rx_drop);
+	DP_PRINT_STATS("        mec_drop = %d",
+		       pdev->stats.rx.mec_drop.num);
+	DP_PRINT_STATS("	Bytes = %llu",
+		       pdev->stats.rx.mec_drop.bytes);
 	DP_PRINT_STATS("Sent To Stack:");
 	DP_PRINT_STATS("	Packets = %d",
 			pdev->stats.rx.to_stack.num);
@@ -5819,11 +5823,9 @@ dp_print_pdev_rx_stats(struct dp_pdev *pdev)
 			pdev->stats.rx.to_stack.bytes);
 	DP_PRINT_STATS("Multicast/Broadcast:");
 	DP_PRINT_STATS("	Packets = %d",
-			(pdev->stats.rx.multicast.num +
-			pdev->stats.rx.bcast.num));
+			pdev->stats.rx.multicast.num);
 	DP_PRINT_STATS("	Bytes = %llu",
-			(pdev->stats.rx.multicast.bytes +
-			pdev->stats.rx.bcast.bytes));
+			pdev->stats.rx.multicast.bytes);
 	DP_PRINT_STATS("Errors:");
 	DP_PRINT_STATS("	Rxdma Ring Un-inititalized = %d",
 			pdev->stats.replenish.rxdma_err);
@@ -5934,6 +5936,8 @@ dp_print_soc_rx_stats(struct dp_soc *soc)
 			soc->stats.rx.err.rx_invalid_peer.num);
 	DP_PRINT_STATS("HAL Ring Access Fail = %d",
 			soc->stats.rx.err.hal_ring_access_fail);
+	DP_PRINT_STATS("RX frags: %d", soc->stats.rx.rx_frags);
+	DP_PRINT_STATS("RX HP out_of_sync: %d", soc->stats.rx.hp_oos);
 
 	for (i = 0; i < HAL_RXDMA_ERR_MAX; i++) {
 		index += qdf_snprint(&rxdma_error[index],

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

@@ -1368,6 +1368,7 @@ uint32_t dp_rx_process(struct dp_intr *int_ctx, void *hal_ring,
 			ring_desc = hal_srng_dst_get_next(hal_soc, hal_ring);
 			if (!ring_desc)
 				break;
+			DP_STATS_INC(soc, rx.hp_oos, 1);
 		}
 
 		error = HAL_RX_ERROR_STATUS_GET(ring_desc);
@@ -1599,7 +1600,7 @@ done:
 			QDF_TRACE(QDF_MODULE_ID_DP,
 				QDF_TRACE_LEVEL_ERROR,
 				FL("received pkt with same src MAC"));
-			DP_STATS_INC(vdev->pdev, dropped.mec, 1);
+			DP_STATS_INC_PKT(peer, rx.mec_drop, 1, msdu_len);
 
 			/* Drop & free packet */
 			qdf_nbuf_free(nbuf);

+ 12 - 2
dp/wifi3.0/dp_rx_err.c

@@ -607,6 +607,11 @@ dp_rx_null_q_desc_handle(struct dp_soc *soc, qdf_nbuf_t nbuf,
 
 		QDF_TRACE_DEBUG_RL(QDF_MODULE_ID_DP, "peer is NULL");
 
+		DP_STATS_INC_PKT(soc,
+				 rx.err.rx_invalid_peer,
+				 1,
+				 qdf_nbuf_len(nbuf));
+
 		mpdu_done = dp_rx_chain_msdus(soc, nbuf, rx_tlv_hdr, pool_id);
 		/* Trigger invalid peer handler wrapper */
 		dp_rx_process_invalid_peer_wrapper(soc, nbuf, mpdu_done);
@@ -639,6 +644,7 @@ dp_rx_null_q_desc_handle(struct dp_soc *soc, qdf_nbuf_t nbuf,
 
 	if (dp_rx_mcast_echo_check(soc, peer, rx_tlv_hdr, nbuf)) {
 		/* this is a looped back MCBC pkt, drop it */
+		DP_STATS_INC_PKT(peer, rx.mec_drop, 1, qdf_nbuf_len(nbuf));
 		qdf_nbuf_free(nbuf);
 		return;
 	}
@@ -648,6 +654,7 @@ dp_rx_null_q_desc_handle(struct dp_soc *soc, qdf_nbuf_t nbuf,
 	 * from any proxysta.
 	 */
 	if (check_qwrap_multicast_loopback(vdev, nbuf)) {
+		DP_STATS_INC_PKT(peer, rx.mec_drop, 1, qdf_nbuf_len(nbuf));
 		qdf_nbuf_free(nbuf);
 		return;
 	}
@@ -709,6 +716,9 @@ dp_rx_null_q_desc_handle(struct dp_soc *soc, qdf_nbuf_t nbuf,
 			QDF_TRACE(QDF_MODULE_ID_DP,
 					QDF_TRACE_LEVEL_INFO,
 					FL("received pkt with same src MAC"));
+			DP_STATS_INC_PKT(peer, rx.mec_drop, 1,
+					 qdf_nbuf_len(nbuf));
+
 			/* Drop & free packet */
 			qdf_nbuf_free(nbuf);
 			return;
@@ -719,9 +729,9 @@ dp_rx_null_q_desc_handle(struct dp_soc *soc, qdf_nbuf_t nbuf,
 				FL("vdev %pK osif_rx %pK"), vdev,
 				vdev->osif_rx);
 			qdf_nbuf_set_next(nbuf, NULL);
-			vdev->osif_rx(vdev->osif_vdev, nbuf);
 			DP_STATS_INC_PKT(peer, rx.to_stack, 1,
 					 qdf_nbuf_len(nbuf));
+			vdev->osif_rx(vdev->osif_vdev, nbuf);
 			if (qdf_unlikely(hal_rx_msdu_end_da_is_mcbc_get(
 						rx_tlv_hdr) &&
 					 (vdev->rx_decap_type ==
@@ -849,7 +859,7 @@ dp_rx_err_deliver(struct dp_soc *soc, qdf_nbuf_t nbuf, uint8_t *rx_tlv_hdr,
 	if (qdf_unlikely(vdev->rx_decap_type == htt_cmn_pkt_type_raw)) {
 		dp_rx_deliver_raw(vdev, nbuf, peer);
 	} else {
-		DP_STATS_INC(vdev->pdev, rx.to_stack.num, 1);
+		DP_STATS_INC(peer, rx.to_stack.num, 1);
 		vdev->osif_rx(vdev->osif_vdev, nbuf);
 	}
 

+ 2 - 0
dp/wifi3.0/dp_types.h

@@ -592,6 +592,8 @@ struct dp_soc_stats {
 		uint32_t rx_frags;
 		/* No of reinjected packets */
 		uint32_t reo_reinject;
+		/* Head pointer Out of sync */
+		uint32_t hp_oos;
 		struct {
 			/* Invalid RBM error count */
 			uint32_t invalid_rbm;