ソースを参照

qcacld-3.0: Support to dump DP RX Thread stats

Add DP RX Thread Stats support. Stats can be retrieved using iwpriv
dumpStats command.
Remove print from hdd_gro_rx_dp_thread function. This condition is
expected when gro is disabled on low throughput. Print is not needed.

CRs-Fixed: 2346997
Change-Id: I3619844b66e845184a4b8c77763bf9f2d2ea0a38
Mohit Khanna 6 年 前
コミット
c9649650d2

+ 5 - 1
core/dp/txrx3.0/dp_rx_thread.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014-2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2014-2019 The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -98,6 +98,10 @@ static void dp_rx_tm_thread_dump_stats(struct dp_rx_thread *rx_thread)
 				     sizeof(nbuf_queued_string) - off,
 				     "reo[%u]:%u ", reo_ring_num, temp);
 	}
+
+	if (!total_queued)
+		return;
+
 	dp_info("thread:%u - qlen:%u queued:(total:%u %s) dequeued:%u stack:%u max_len:%u invalid(peer:%u vdev:%u others:%u)",
 		rx_thread->id,
 		qdf_nbuf_queue_head_qlen(&rx_thread->nbuf_queue),

+ 14 - 11
core/dp/txrx3.0/dp_txrx.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017-2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2019 The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -201,29 +201,31 @@ ret:
 /**
  * dp_txrx_ext_dump_stats() - dump txrx external module stats
  * @soc: ol_txrx_soc_handle object
- *
+ * @stats_id: id  for the module whose stats are needed
  *
  * Return: QDF_STATUS_SUCCESS on success, error qdf status on failure
  */
-static inline QDF_STATUS dp_txrx_ext_dump_stats(ol_txrx_soc_handle soc)
+static inline QDF_STATUS dp_txrx_ext_dump_stats(ol_txrx_soc_handle soc,
+						uint8_t stats_id)
 {
 	struct dp_txrx_handle *dp_ext_hdl;
-	QDF_STATUS qdf_status = QDF_STATUS_SUCCESS;
+	QDF_STATUS qdf_status;
 
 	if (!soc) {
-		qdf_status = QDF_STATUS_E_INVAL;
 		dp_err("invalid input params soc %pK", soc);
-		goto ret;
+		return QDF_STATUS_E_INVAL;
 	}
 
 	dp_ext_hdl = cdp_soc_get_dp_txrx_handle(soc);
 	if (!dp_ext_hdl) {
-		qdf_status = QDF_STATUS_E_FAULT;
-		goto ret;
+		return QDF_STATUS_E_FAULT;
 	}
 
-	qdf_status = dp_rx_tm_dump_stats(&dp_ext_hdl->rx_tm_hdl);
-ret:
+	if (stats_id == CDP_DP_RX_THREAD_STATS)
+		qdf_status = dp_rx_tm_dump_stats(&dp_ext_hdl->rx_tm_hdl);
+	else
+		qdf_status = QDF_STATUS_E_INVAL;
+
 	return qdf_status;
 }
 
@@ -285,7 +287,8 @@ QDF_STATUS dp_rx_enqueue_pkt(ol_txrx_soc_handle soc, qdf_nbuf_t nbuf_list)
 	return QDF_STATUS_SUCCESS;
 }
 
-static inline QDF_STATUS dp_txrx_ext_dump_stats(ol_txrx_soc_handle soc)
+static inline QDF_STATUS dp_txrx_ext_dump_stats(ol_txrx_soc_handle soc,
+						uint8_t stats_id)
 {
 	return QDF_STATUS_SUCCESS;
 }

+ 1 - 1
core/hdd/src/wlan_hdd_main.c

@@ -7635,7 +7635,7 @@ static void hdd_display_periodic_stats(struct hdd_context *hdd_ctx,
 		periodic_stats_disp_time * 1000) {
 		if (data_in_time_period) {
 			wlan_hdd_display_txrx_stats(hdd_ctx);
-			dp_txrx_ext_dump_stats(soc);
+			dp_txrx_ext_dump_stats(soc, CDP_DP_RX_THREAD_STATS);
 			cdp_display_stats(soc,
 					  CDP_RX_RING_STATS,
 					  QDF_STATS_VERBOSITY_LEVEL_LOW);

+ 0 - 1
core/hdd/src/wlan_hdd_tx_rx.c

@@ -1625,7 +1625,6 @@ QDF_STATUS hdd_gro_rx_dp_thread(struct hdd_adapter *adapter,
 			QDF_NBUF_CB_RX_FLUSH_IND(skb) = 1;
 			adapter->hdd_stats.tx_rx_stats.rx_gro_force_flushes++;
 		} else {
-			hdd_err_rl("GRO disabled - return");
 			status = QDF_STATUS_E_FAILURE;
 			return status;
 		}

+ 18 - 14
core/hdd/src/wlan_hdd_wext.c

@@ -111,6 +111,7 @@
 #include "cfg_mlme_threshold.h"
 #include "wlan_pmo_cfg.h"
 #include "wlan_pmo_ucfg_api.h"
+#include "dp_txrx.h"
 #include "wlan_fwol_ucfg_api.h"
 
 /* Private ioctls and their sub-ioctls */
@@ -3222,6 +3223,9 @@ void hdd_wlan_list_fw_profile(uint16_t *length,
 
 	*length = len + 1;
 }
+
+#define HDD_DUMP_STAT_HELP(STAT_ID) \
+	hdd_nofl_info("%u -- %s", STAT_ID, (# STAT_ID))
 /**
  * hdd_display_stats_help() - print statistics help
  *
@@ -3232,14 +3236,16 @@ static void hdd_display_stats_help(void)
 	hdd_nofl_info("iwpriv wlan0 dumpStats [option] - dump statistics");
 	hdd_nofl_info("iwpriv wlan0 clearStats [option] - clear statistics");
 	hdd_nofl_info("options:");
-	hdd_nofl_info("  1 -- TXRX PATH statistics");
-	hdd_nofl_info("  2 -- TXRX HIST statistics");
-	hdd_nofl_info("  3 -- TSO statistics");
-	hdd_nofl_info("  4 -- Network queue statistics");
-	hdd_nofl_info("  5 -- Flow control statistics");
-	hdd_nofl_info("  6 -- Per Layer statistics");
-	hdd_nofl_info("  7 -- Copy engine interrupt statistics");
-	hdd_nofl_info("  9 -- NAPI statistics");
+	HDD_DUMP_STAT_HELP(CDP_TXRX_PATH_STATS);
+	HDD_DUMP_STAT_HELP(CDP_TXRX_HIST_STATS);
+	HDD_DUMP_STAT_HELP(CDP_TXRX_TSO_STATS);
+	HDD_DUMP_STAT_HELP(CDP_HDD_NETIF_OPER_HISTORY);
+	HDD_DUMP_STAT_HELP(CDP_DUMP_TX_FLOW_POOL_INFO);
+	HDD_DUMP_STAT_HELP(CDP_TXRX_DESC_STATS);
+	HDD_DUMP_STAT_HELP(CDP_HIF_STATS);
+	HDD_DUMP_STAT_HELP(CDP_NAPI_STATS);
+	HDD_DUMP_STAT_HELP(CDP_DP_NAPI_STATS);
+	HDD_DUMP_STAT_HELP(CDP_DP_RX_THREAD_STATS);
 }
 
 /**
@@ -3261,33 +3267,31 @@ int hdd_wlan_dump_stats(struct hdd_adapter *adapter, int value)
 	case CDP_TXRX_HIST_STATS:
 		wlan_hdd_display_tx_rx_histogram(hdd_ctx);
 		break;
-
 	case CDP_HDD_NETIF_OPER_HISTORY:
 		wlan_hdd_display_netif_queue_history
 					(hdd_ctx,
 					 QDF_STATS_VERBOSITY_LEVEL_HIGH);
 		break;
-
 	case CDP_HIF_STATS:
 		hdd_display_hif_stats();
 		break;
-
 	case CDP_LRO_STATS:
 		hdd_lro_display_stats(hdd_ctx);
 		break;
-
 	case CDP_NAPI_STATS:
 		if (hdd_display_napi_stats()) {
 			hdd_err("error displaying napi stats");
 			ret = EFAULT;
 		}
 		break;
-
+	case CDP_DP_RX_THREAD_STATS:
+		dp_txrx_ext_dump_stats(cds_get_context(QDF_MODULE_ID_SOC),
+				       CDP_DP_RX_THREAD_STATS);
+		break;
 	case CDP_DISCONNECT_STATS:
 		sme_display_disconnect_stats(hdd_ctx->mac_handle,
 					     adapter->session_id);
 		break;
-
 	default:
 		status = cdp_display_stats(cds_get_context(QDF_MODULE_ID_SOC),
 					   value,