Browse Source

qcacmn: Add missing stats for Host Lithium Stats

Add Invalid Peer stats on rx side
Add aggregation stats missing on Tx
API to update Rx Errors

Change-Id: Ib757ee7b89d9b9113e1a41b5a520faabb9ff28bb
CRs-Fixed: 1114641
Ishank Jain 8 years ago
parent
commit
e73c403a0b
6 changed files with 55 additions and 11 deletions
  1. 0 2
      dp/inc/cdp_txrx_cmn_struct.h
  2. 37 4
      dp/wifi3.0/dp_main.c
  3. 2 0
      dp/wifi3.0/dp_rx.c
  4. 7 0
      dp/wifi3.0/dp_rx_err.c
  5. 5 5
      dp/wifi3.0/dp_tx.c
  6. 4 0
      dp/wifi3.0/dp_types.h

+ 0 - 2
dp/inc/cdp_txrx_cmn_struct.h

@@ -704,8 +704,6 @@ struct cdp_peer_stats {
 struct cdp_pdev_stats {
 	/* packets dropped on rx */
 	struct {
-		/* packets dropped because of no peer */
-		struct cdp_pkt_info no_peer;
 		/* packets dropped because nsdu_done bit not set */
 		struct cdp_pkt_info msdu_not_done;
 	} dropped;

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

@@ -2506,10 +2506,6 @@ dp_print_pdev_rx_stats(struct dp_pdev *pdev)
 	DP_TRACE(NONE, "Buffers Added To Freelist = %d",
 			pdev->stats.buf_freelist);
 	DP_TRACE(NONE, "Dropped:\n");
-	DP_TRACE(NONE, "Total Packets With No Peer = %d",
-			pdev->stats.dropped.no_peer.num);
-	DP_TRACE(NONE, "Bytes Sent With No Peer = %d",
-			pdev->stats.dropped.no_peer.bytes);
 	DP_TRACE(NONE, "Total Packets With Msdu Not Done = %d",
 			pdev->stats.dropped.msdu_not_done.num);
 	DP_TRACE(NONE, "Bytes Sent With Msdu Not Done = %d",
@@ -2538,6 +2534,10 @@ dp_print_soc_tx_stats(struct dp_soc *soc)
 	DP_TRACE(NONE, "SOC Tx Stats:\n");
 	DP_TRACE(NONE, "Tx Descriptors In Use = %d",
 			soc->stats.tx.desc_in_use);
+	DP_TRACE(NONE, "Total Packets With No Peer = %d",
+			soc->stats.tx.tx_invalid_peer.num);
+	DP_TRACE(NONE, "Bytes Sent With No Peer = %d",
+			soc->stats.tx.tx_invalid_peer.bytes);
 }
 
 
@@ -2563,6 +2563,8 @@ dp_print_soc_rx_stats(struct dp_soc *soc)
 			soc->stats.rx.err.invalid_vdev);
 	DP_TRACE(NONE, "Invalid Pdev = %d",
 			soc->stats.rx.err.invalid_pdev);
+	DP_TRACE(NONE, "Invalid Peer = %d",
+			soc->stats.rx.err.rx_invalid_peer.num);
 	DP_TRACE(NONE, "HAL Ring Access Fail = %d",
 			soc->stats.rx.err.hal_ring_access_fail);
 	for (i = 0; i < MAX_RXDMA_ERRORS; i++) {
@@ -2714,6 +2716,23 @@ dp_print_tx_rates(struct dp_vdev *vdev)
 			mcs[4]);
 	DP_TRACE(NONE, "Packet Type 11AX MCS Invalid = %d",
 			pdev->stats.tx.pkt_type[DOT11_AX].mcs_count[MAX_MCS]);
+	DP_TRACE(NONE, "SGI:"
+			" 0.8us %d,"
+			" 0.4us %d,"
+			" 1.6us %d,"
+			" 3.2us %d,",
+			pdev->stats.tx.sgi_count[0],
+			pdev->stats.tx.sgi_count[1],
+			pdev->stats.tx.sgi_count[2],
+			pdev->stats.tx.sgi_count[3]);
+	DP_TRACE(NONE, "BW Counts: 20MHZ %d, 40MHZ %d, 80MHZ %d, 160MHZ %d",
+			pdev->stats.tx.bw[0], pdev->stats.tx.bw[1],
+			pdev->stats.tx.bw[2], pdev->stats.tx.bw[3]);
+	DP_TRACE(NONE, "Aggregation:\n");
+	DP_TRACE(NONE, "Number of Msdu's Part of Amsdu: %d",
+			pdev->stats.tx.amsdu_cnt);
+	DP_TRACE(NONE, "Number of Msdu's With No Msdu Level Aggregation: %d",
+			pdev->stats.tx.non_amsdu_cnt);
 }
 
 /**
@@ -2816,6 +2835,11 @@ static inline void dp_print_peer_stats(struct dp_peer *peer)
 	DP_TRACE(NONE, "BW Counts: 20MHZ %d, 40MHZ %d, 80MHZ %d, 160MHZ %d",
 			peer->stats.tx.bw[0], peer->stats.tx.bw[1],
 			peer->stats.tx.bw[2], peer->stats.tx.bw[3]);
+	DP_TRACE(NONE, "Aggregation:\n");
+	DP_TRACE(NONE, "Number of Msdu's Part of Amsdu: %d",
+			peer->stats.tx.amsdu_cnt);
+	DP_TRACE(NONE, "Number of Msdu's With No Msdu Level Aggregation: %d",
+			peer->stats.tx.non_amsdu_cnt);
 
 	DP_TRACE(NONE, "Node Rx Stats:\n");
 	DP_TRACE(NONE, "Packets Sent To Stack %d",
@@ -2892,6 +2916,15 @@ static inline void dp_print_peer_stats(struct dp_peer *peer)
 	}
 	DP_TRACE(NONE, "NSS(0-7):%s",
 			nss);
+	DP_TRACE(NONE, "Aggregation:\n");
+	DP_TRACE(NONE, "Number of Msdu's Part of Ampdu = %d",
+			peer->stats.rx.ampdu_cnt);
+	DP_TRACE(NONE, "Number of Msdu's With No Mpdu Level Aggregation : %d",
+			peer->stats.rx.non_ampdu_cnt);
+	DP_TRACE(NONE, "Number of Msdu's Part of Amsdu: %d",
+			peer->stats.rx.amsdu_cnt);
+	DP_TRACE(NONE, "Number of Msdu's With No Msdu Level Aggregation: %d",
+			peer->stats.rx.non_amsdu_cnt);
 }
 
 /**

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

@@ -790,6 +790,8 @@ done:
 			if (!peer && !vdev) {
 
 				dp_rx_process_invalid_peer(soc, nbuf);
+				DP_STATS_INC_PKT(soc, rx.err.rx_invalid_peer, 1,
+						qdf_nbuf_len(nbuf));
 				/* Drop & free packet */
 				qdf_nbuf_free(nbuf);
 

+ 7 - 0
dp/wifi3.0/dp_rx_err.c

@@ -486,6 +486,7 @@ dp_rx_err_process(struct dp_soc *soc, void *hal_ring, uint32_t quota)
 			/* TODO */
 			/* Call appropriate handler */
 
+			DP_STATS_INC(soc, rx.err.invalid_rbm, 1);
 			QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
 			FL("Invalid RBM %d"), rbm);
 			continue;
@@ -642,6 +643,9 @@ dp_rx_wbm_err_process(struct dp_soc *soc, void *hal_ring, uint32_t quota)
 				uint8_t reo_error_code =
 				   HAL_RX_WBM_REO_ERROR_CODE_GET(ring_desc);
 
+				DP_STATS_INC(soc, rx.err.reo_error[
+						reo_error_code], 1);
+
 				switch (reo_error_code) {
 				/*
 				 * Handling for packets which have NULL REO
@@ -678,6 +682,9 @@ dp_rx_wbm_err_process(struct dp_soc *soc, void *hal_ring, uint32_t quota)
 				uint8_t rxdma_error_code =
 				   HAL_RX_WBM_RXDMA_ERROR_CODE_GET(ring_desc);
 
+				DP_STATS_INC(soc, rx.err.rxdma_error[
+						rxdma_error_code], 1);
+
 				switch (rxdma_error_code) {
 
 				/* TODO */

+ 5 - 5
dp/wifi3.0/dp_tx.c

@@ -962,7 +962,7 @@ qdf_nbuf_t dp_tx_send_msdu_multiple(struct dp_vdev *vdev, qdf_nbuf_t nbuf,
 		DP_STATS_INC(vdev, tx_i.dropped.ring_full, 1);
 		DP_STATS_INC_PKT(vdev,
 				tx_i.dropped.dropped_pkt, 1,
-				qdf_nbuf_len(tx_desc->nbuf));
+				qdf_nbuf_len(nbuf));
 		return nbuf;
 	}
 
@@ -987,7 +987,7 @@ qdf_nbuf_t dp_tx_send_msdu_multiple(struct dp_vdev *vdev, qdf_nbuf_t nbuf,
 			DP_STATS_INC(vdev, tx_i.dropped.desc_na, 1);
 			DP_STATS_INC_PKT(vdev,
 					tx_i.dropped.dropped_pkt, 1,
-					qdf_nbuf_len(tx_desc->nbuf));
+					qdf_nbuf_len(nbuf));
 
 			goto done;
 		}
@@ -1006,7 +1006,7 @@ qdf_nbuf_t dp_tx_send_msdu_multiple(struct dp_vdev *vdev, qdf_nbuf_t nbuf,
 			DP_STATS_INC(vdev, tx_i.dropped.enqueue_fail, 1);
 			DP_STATS_INC_PKT(pdev,
 					tx_i.dropped.dropped_pkt, 1,
-					qdf_nbuf_len(tx_desc->nbuf));
+					qdf_nbuf_len(nbuf));
 			dp_tx_desc_release(tx_desc, tx_q->desc_pool_id);
 			goto done;
 		}
@@ -1277,7 +1277,7 @@ qdf_nbuf_t dp_tx_send(void *vap_dev, qdf_nbuf_t nbuf)
 	 * (TID override disabled)
 	 */
 	msdu_info.tid = HTT_TX_EXT_TID_INVALID;
-	DP_STATS_INC_PKT(vdev->pdev, tx_i.rcvd, 1, qdf_nbuf_len(nbuf));
+	DP_STATS_INC_PKT(vdev, tx_i.rcvd, 1, qdf_nbuf_len(nbuf));
 
 	if (qdf_unlikely(vdev->mesh_vdev))
 		dp_tx_extract_mesh_meta_data(vdev, nbuf, &msdu_info);
@@ -1622,7 +1622,7 @@ static inline void dp_tx_comp_process_tx_status(struct dp_tx_desc_s *tx_desc,
 	if (!peer) {
 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_INFO,
 				"invalid peer");
-		DP_STATS_INC_PKT(vdev->pdev, dropped.no_peer, 1, length);
+		DP_STATS_INC_PKT(soc, tx.tx_invalid_peer, 1, length);
 		goto out;
 	}
 

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

@@ -635,6 +635,8 @@ struct dp_soc {
 	struct {
 		/* SOC level TX stats */
 		struct {
+			/* packets dropped on tx because of no peer */
+			struct cdp_pkt_info tx_invalid_peer;
 			/* descriptors in each tcl ring */
 			uint32_t tcl_ring_full[MAX_TCL_RING];
 			/* Descriptors in use at soc */
@@ -650,6 +652,8 @@ struct dp_soc {
 				uint32_t invalid_vdev;
 				/* Invalid PDEV error count */
 				uint32_t invalid_pdev;
+				/* Invalid PEER Error count */
+				struct cdp_pkt_info rx_invalid_peer;
 				/* HAL ring access Fail error count */
 				uint32_t hal_ring_access_fail;
 				/* RX DMA error count */