Browse Source

qcacmn: avoid vdev stats aggregate for every ppdu stats event

Avoid vdev aggregate stats for every ppdu stats event as it is
consuming high CPU in veriwave max clients testcase. Instead
aggregate the stats when ifconfig athX command is issued. Add
CDP API to aggregate and update stats called when needed

Change-Id: I801d5f8fab0c275942b77a9975293f95bd4026b0
CRs-Fixed: 2220704
Chaithanya Garrepalli 7 years ago
parent
commit
2faa46fbfb
5 changed files with 54 additions and 11 deletions
  1. 6 5
      dp/inc/cdp_txrx_cmn.h
  2. 2 2
      dp/inc/cdp_txrx_ops.h
  3. 0 1
      dp/wifi3.0/dp_htt.c
  4. 46 2
      dp/wifi3.0/dp_main.c
  5. 0 1
      dp/wifi3.0/dp_rx_mon_status.c

+ 6 - 5
dp/inc/cdp_txrx_cmn.h

@@ -1498,17 +1498,18 @@ void cdp_vdev_tx_unlock(ol_txrx_soc_handle soc,
 /**
  * cdp_ath_getstats() - get updated athstats
  * @soc: opaque soc handle
- * @pdev: data path pdev handle
- * @net_device_stats: interface stats
- * @rtnl_link_stats64: device statistics structure
+ * @dev: dp interface handle
+ * @stats: cdp network device stats structure
+ * @type: device type pdev/vdev
  *
  * Return: void
  */
 static inline void cdp_ath_getstats(ol_txrx_soc_handle soc,
-		struct cdp_pdev *pdev, struct cdp_dev_stats *stats)
+		void *dev, struct cdp_dev_stats *stats,
+		uint8_t type)
 {
 	if (soc && soc->ops && soc->ops->cmn_drv_ops->txrx_ath_getstats)
-		soc->ops->cmn_drv_ops->txrx_ath_getstats(pdev, stats);
+		soc->ops->cmn_drv_ops->txrx_ath_getstats(dev, stats, type);
 }
 
 /**

+ 2 - 2
dp/inc/cdp_txrx_ops.h

@@ -138,8 +138,8 @@ struct cdp_cmn_ops {
 
 	void (*txrx_vdev_tx_unlock)(struct cdp_vdev *vdev);
 
-	void (*txrx_ath_getstats)(struct cdp_pdev *pdev,
-			struct cdp_dev_stats *stats);
+	void (*txrx_ath_getstats)(void *pdev,
+			struct cdp_dev_stats *stats, uint8_t type);
 
 	void (*txrx_set_gid_flag)(struct cdp_pdev *pdev, u_int8_t *mem_status,
 			u_int8_t *user_position);

+ 0 - 1
dp/wifi3.0/dp_htt.c

@@ -154,7 +154,6 @@ static void dp_tx_stats_update(struct dp_soc *soc, struct dp_peer *peer,
 				&peer->stats, ppdu->peer_id,
 				UPDATE_PEER_STATS);
 
-		dp_aggregate_vdev_stats(peer->vdev);
 	}
 }
 #endif

+ 46 - 2
dp/wifi3.0/dp_main.c

@@ -4936,6 +4936,22 @@ static inline void dp_aggregate_pdev_stats(struct dp_pdev *pdev)
 
 }
 
+/**
+ * dp_vdev_getstats() - get vdev packet level stats
+ * @vdev_handle: Datapath VDEV handle
+ * @stats: cdp network device stats structure
+ *
+ * Return: void
+ */
+static void dp_vdev_getstats(void *vdev_handle,
+		struct cdp_dev_stats *stats)
+{
+	struct dp_vdev *vdev = (struct dp_vdev *)vdev_handle;
+
+	dp_aggregate_vdev_stats(vdev);
+}
+
+
 /**
  * dp_pdev_getstats() - get pdev packet level stats
  * @pdev_handle: Datapath PDEV handle
@@ -4943,7 +4959,7 @@ static inline void dp_aggregate_pdev_stats(struct dp_pdev *pdev)
  *
  * Return: void
  */
-static void dp_pdev_getstats(struct cdp_pdev *pdev_handle,
+static void dp_pdev_getstats(void *pdev_handle,
 		struct cdp_dev_stats *stats)
 {
 	struct dp_pdev *pdev = (struct dp_pdev *)pdev_handle;
@@ -4965,6 +4981,34 @@ static void dp_pdev_getstats(struct cdp_pdev *pdev_handle,
 		pdev->stats.rx.bcast.bytes;
 }
 
+/**
+ * dp_get_device_stats() - get interface level packet stats
+ * @handle: device handle
+ * @stats: cdp network device stats structure
+ * @type: device type pdev/vdev
+ *
+ * Return: void
+ */
+static void dp_get_device_stats(void *handle,
+		struct cdp_dev_stats *stats, uint8_t type)
+{
+	switch (type) {
+	case UPDATE_VDEV_STATS:
+		dp_vdev_getstats(handle, stats);
+		break;
+	case UPDATE_PDEV_STATS:
+		dp_pdev_getstats(handle, stats);
+		break;
+	default:
+		QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
+			"apstats cannot be updated for this input "
+			"type %d\n", type);
+		break;
+	}
+
+}
+
+
 /**
  * dp_print_pdev_tx_stats(): Print Pdev level TX stats
  * @pdev: DP_PDEV Handle
@@ -6869,7 +6913,7 @@ static struct cdp_cmn_ops dp_ops_cmn = {
 	.txrx_get_vdev_mac_addr = dp_get_vdev_mac_addr_wifi3,
 	.txrx_get_vdev_from_vdev_id = dp_get_vdev_from_vdev_id_wifi3,
 	.txrx_get_ctrl_pdev_from_vdev = dp_get_ctrl_pdev_from_vdev_wifi3,
-	.txrx_ath_getstats = dp_pdev_getstats,
+	.txrx_ath_getstats = dp_get_device_stats,
 	.addba_requestprocess = dp_addba_requestprocess_wifi3,
 	.addba_responsesetup = dp_addba_responsesetup_wifi3,
 	.delba_process = dp_delba_process_wifi3,

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

@@ -198,7 +198,6 @@ static void dp_rx_stats_update(struct dp_soc *soc, struct dp_peer *peer,
 				&peer->stats, ppdu->peer_id,
 				UPDATE_PEER_STATS);
 
-		dp_aggregate_vdev_stats(peer->vdev);
 	}
 }
 #endif