Browse Source

qcacmn: Update few connectivity stats on tx completion

Update connectivity related tx_host_fw_sent and
tx_ack_count stats on tx completion.

Change-Id: Id0143d934379d8831c58160aa357817c05fcbc71
CRs-Fixed: 2657703
Yeshwanth Sriram Guntuka 5 năm trước cách đây
mục cha
commit
b725ca6210
3 tập tin đã thay đổi với 48 bổ sung0 xóa
  1. 1 0
      dp/wifi3.0/dp_main.c
  2. 44 0
      dp/wifi3.0/dp_tx.c
  3. 3 0
      dp/wifi3.0/dp_types.h

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

@@ -4819,6 +4819,7 @@ static QDF_STATUS dp_vdev_register_wifi3(struct cdp_soc_t *soc,
 	vdev->osif_rx_mon = txrx_ops->rx.mon;
 	vdev->osif_tx_free_ext = txrx_ops->tx.tx_free_ext;
 	vdev->tx_comp = txrx_ops->tx.tx_comp;
+	vdev->stats_cb = txrx_ops->rx.stats_rx;
 #ifdef notyet
 #if ATH_SUPPORT_WAPI
 	vdev->osif_check_wai = txrx_ops->rx.wai_check;

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

@@ -3367,6 +3367,48 @@ dp_tx_comp_process_desc(struct dp_soc *soc,
 	dp_tx_comp_free_buf(soc, desc);
 }
 
+#ifdef DISABLE_DP_STATS
+/**
+ * dp_tx_update_connectivity_stats() - update tx connectivity stats
+ * @soc: core txrx main context
+ * @tx_desc: tx desc
+ * @status: tx status
+ *
+ * Return: none
+ */
+static inline
+void dp_tx_update_connectivity_stats(struct dp_soc *soc,
+				     struct dp_tx_desc_s *tx_desc,
+				     uint8_t status)
+{
+}
+#else
+static inline
+void dp_tx_update_connectivity_stats(struct dp_soc *soc,
+				     struct dp_tx_desc_s *tx_desc,
+				     uint8_t status)
+{
+	void *osif_dev;
+	ol_txrx_stats_rx_fp stats_cbk;
+	uint8_t pkt_type;
+
+	qdf_assert(tx_desc);
+
+	if (!tx_desc->vdev ||
+	    !tx_desc->vdev->osif_vdev ||
+	    !tx_desc->vdev->stats_cb)
+		return;
+
+	osif_dev = tx_desc->vdev->osif_vdev;
+	stats_cbk = tx_desc->vdev->stats_cb;
+
+	stats_cbk(tx_desc->nbuf, osif_dev, PKT_TYPE_TX_HOST_FW_SENT, &pkt_type);
+	if (status == HAL_TX_TQM_RR_FRAME_ACKED)
+		stats_cbk(tx_desc->nbuf, osif_dev, PKT_TYPE_TX_ACK_CNT,
+			  &pkt_type);
+}
+#endif
+
 /**
  * dp_tx_comp_process_tx_status() - Parse and Dump Tx completion status info
  * @tx_desc: software descriptor head pointer
@@ -3435,6 +3477,8 @@ void dp_tx_comp_process_tx_status(struct dp_tx_desc_s *tx_desc,
 
 	soc = vdev->pdev->soc;
 
+	dp_tx_update_connectivity_stats(soc, tx_desc, ts->status);
+
 	/* Update SoC level stats */
 	DP_STATS_INCC(soc, tx.dropped_fw_removed, 1,
 			(ts->status == HAL_TX_TQM_RR_REM_CMD_REM));

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

@@ -2123,6 +2123,9 @@ struct dp_vdev {
 
 	/* vap bss peer mac addr */
 	uint8_t vap_bss_peer_mac_addr[QDF_MAC_ADDR_SIZE];
+
+	/* callback to collect connectivity stats */
+	ol_txrx_stats_rx_fp stats_cb;
 };