Browse Source

qcacld-3.0: Fix DPTRACE live mode timing logic

DPTRACE timing logic uses the bandwidth request timer (~100ms) to make
calculations. Fix the current code to invoke qdf_throttle_live_mode
every 100ms, instead of when the throughput changes.

Change-Id: Ic64c28ef30ac7d7f764216a615ff1d9903436105
CRs-Fixed: 2273874
Mohit Khanna 6 years ago
parent
commit
f7562c330e
2 changed files with 15 additions and 13 deletions
  1. 6 6
      core/hdd/inc/wlan_hdd_cfg.h
  2. 9 7
      core/hdd/src/wlan_hdd_main.c

+ 6 - 6
core/hdd/inc/wlan_hdd_cfg.h

@@ -9721,14 +9721,14 @@ enum dot11p_mode {
  * Use this default in case the value cannot be determined from cfg string
  * gDptraceConfig
  */
-#define DP_TRACE_CONFIG_DEFAULT_THRESH		(4)
+#define DP_TRACE_CONFIG_DEFAULT_THRESH		(6)
 
 /*
  * Number of intervals of BW timer to wait before enabling/disabling DP Trace.
  * Since throughput threshold to disable live logging for DP Trace is very low,
  * we calculate throughput based on # packets received in a second.
- * For example assuming bandwidth timer interval is 100ms, and if more than 4
- * packets are received in 10 * 100 ms interval, we want to disable DP Trace
+ * For example assuming bandwidth timer interval is 100ms, and if more than 6
+ * prints are received in 10 * 100 ms interval, we want to disable DP Trace
  * live logging. DP_TRACE_CONFIG_DEFAULT_THRESH_TIME_LIMIT is the default
  * value, to be used in case the real value cannot be derived from
  * bw timer interval
@@ -9759,12 +9759,12 @@ enum dot11p_mode {
  *          (decimal 62 = 0x3e)
  * e.g., to disable live mode, use the following param in the ini file.
  * gDptraceConfig = 0
- * e.g., to enable dptrace live mode and set the thresh as 4,
+ * e.g., to enable dptrace live mode and set the thresh as 6,
  * use the following param in the ini file.
- * gDptraceConfig = 1, 4
+ * gDptraceConfig = 1, 6
  */
 #define CFG_ENABLE_DP_TRACE_CONFIG		"gDptraceConfig"
-#define CFG_ENABLE_DP_TRACE_CONFIG_DEFAULT	"1, 4, 1, 126"
+#define CFG_ENABLE_DP_TRACE_CONFIG_DEFAULT	"1, 6, 2, 126"
 #endif
 
 /*

+ 9 - 7
core/hdd/src/wlan_hdd_main.c

@@ -7364,7 +7364,7 @@ static void hdd_pld_request_bus_bandwidth(struct hdd_context *hdd_ctx,
 	bool rx_level_change = false;
 	bool tx_level_change = false;
 	bool rxthread_high_tput_req = false;
-
+	bool dptrace_high_tput_req;
 	if (total_pkts > hdd_ctx->config->busBandwidthHighThreshold)
 		next_vote_level = PLD_BUS_WIDTH_HIGH;
 	else if (total_pkts > hdd_ctx->config->busBandwidthMediumThreshold)
@@ -7374,6 +7374,9 @@ static void hdd_pld_request_bus_bandwidth(struct hdd_context *hdd_ctx,
 	else
 		next_vote_level = PLD_BUS_WIDTH_NONE;
 
+	dptrace_high_tput_req =
+			next_vote_level > PLD_BUS_WIDTH_NONE ? true : false;
+
 	if (hdd_ctx->cur_vote_level != next_vote_level) {
 		hdd_debug("trigger level %d, tx_packets: %lld, rx_packets: %lld",
 			 next_vote_level, tx_packets, rx_packets);
@@ -7406,10 +7409,10 @@ static void hdd_pld_request_bus_bandwidth(struct hdd_context *hdd_ctx,
 			hdd_disable_rx_ol_for_low_tput(hdd_ctx, true);
 		else
 			hdd_disable_rx_ol_for_low_tput(hdd_ctx, false);
-
-		qdf_dp_trace_apply_tput_policy(next_vote_level);
 	}
 
+	qdf_dp_trace_apply_tput_policy(dptrace_high_tput_req);
+
 	/*
 	 * Includes tcp+udp, if perf core is required for tcp, then
 	 * perf core is also required for udp.
@@ -10923,7 +10926,6 @@ static void wlan_init_bug_report_lock(void)
 #ifdef CONFIG_DP_TRACE
 void hdd_dp_trace_init(struct hdd_config *config)
 {
-
 	bool live_mode = DP_TRACE_CONFIG_DEFAULT_LIVE_MODE;
 	uint8_t thresh = DP_TRACE_CONFIG_DEFAULT_THRESH;
 	uint16_t thresh_time_limit = DP_TRACE_CONFIG_DEFAULT_THRESH_TIME_LIMIT;
@@ -10965,9 +10967,9 @@ void hdd_dp_trace_init(struct hdd_config *config)
 		live_mode = config_params[0];
 		/* fall through */
 	default:
-		hdd_debug("live_mode %u thresh %u time_limit %u verbosity %u bitmap 0x%x",
-			live_mode, thresh, thresh_time_limit,
-			verbosity, proto_bitmap);
+		hdd_info("live_mode %u thresh %u time_limit %u verbosity %u bitmap 0x%x",
+			 live_mode, thresh, thresh_time_limit,
+			 verbosity, proto_bitmap);
 	};
 
 	qdf_dp_trace_init(live_mode, thresh, thresh_time_limit,