Jelajahi Sumber

qcacld-3.0: Check consistency in throughput before setting delack

Integration from cld-2.0 to cld-3.0.

Currently the throughput is measured every 100 ms. Delack is set to 20
if throughput for this interval is greater then threshold (~57 Mbps).
In the case of congestion control, tcp may take longer duration for
rampup. In this change, throughput is checked for consistency for
about three seconds and then tcp delack is set to 20.

CRs-Fixed: 1028085
Change-Id: I1a4e9be3407ac426a314e1192d0e1d315e1899e0
Ravi Joshi 8 tahun lalu
induk
melakukan
b89e7f7e3e

+ 7 - 0
core/hdd/inc/wlan_hdd_cfg.h

@@ -2435,6 +2435,12 @@ typedef enum {
 #define CFG_TCP_DELACK_THRESHOLD_LOW_MIN           (0)
 #define CFG_TCP_DELACK_THRESHOLD_LOW_MAX           (10000)
 
+#define CFG_TCP_DELACK_TIMER_COUNT                 "gTcpDelAckTimerCount"
+#define CFG_TCP_DELACK_TIMER_COUNT_DEFAULT         (30)
+#define CFG_TCP_DELACK_TIMER_COUNT_MIN             (1)
+#define CFG_TCP_DELACK_TIMER_COUNT_MAX             (1000)
+
+
 /* TCP_TX_HIGH_TPUT_THRESHOLD specifies the threshold of packets transmitted
  * over a period of 100 ms beyond which TCP can be considered to have a high
  * TX throughput requirement. The driver uses this condition to tweak TCP TX
@@ -3948,6 +3954,7 @@ struct hdd_config {
 	uint32_t tcpDelackThresholdHigh;
 	uint32_t tcpDelackThresholdLow;
 	uint32_t tcp_tx_high_tput_thres;
+	uint32_t tcp_delack_timer_count;
 #endif /* MSM_PLATFORM */
 
 	/* FW debug log parameters */

+ 1 - 0
core/hdd/inc/wlan_hdd_main.h

@@ -1471,6 +1471,7 @@ struct hdd_context_s {
 	 * at runtime and intersecting it with target capab before updating.
 	 */
 	uint32_t fine_time_meas_cap_target;
+	uint32_t rx_high_ind_cnt;
 	/* completion variable to indicate set antenna mode complete*/
 	struct completion set_antenna_mode_cmpl;
 	/* Current number of TX X RX chains being used */

+ 6 - 0
core/hdd/inc/wlan_hdd_tx_rx.h

@@ -116,6 +116,12 @@ int hdd_set_mon_rx_cb(struct net_device *dev);
 void hdd_send_rps_ind(hdd_adapter_t *adapter);
 void wlan_hdd_classify_pkt(struct sk_buff *skb);
 
+#ifdef MSM_PLATFORM
+void hdd_reset_tcp_delack(hdd_context_t *hdd_ctx);
+#else
+static inline void hdd_reset_tcp_delack(hdd_context_t *hdd_ctx) {}
+#endif
+
 #ifdef FEATURE_WLAN_DIAG_SUPPORT
 void hdd_event_eapol_log(struct sk_buff *skb, enum qdf_proto_dir dir);
 #else

+ 19 - 9
core/hdd/src/wlan_hdd_cfg.c

@@ -3015,13 +3015,19 @@ REG_TABLE_ENTRY g_registry_table[] = {
 		     CFG_TCP_DELACK_THRESHOLD_LOW_MIN,
 		     CFG_TCP_DELACK_THRESHOLD_LOW_MAX),
 
-	REG_VARIABLE(CFG_TCP_TX_HIGH_TPUT_THRESHOLD_NAME, WLAN_PARAM_Integer,
-		struct hdd_config, tcp_tx_high_tput_thres,
-		VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		CFG_TCP_TX_HIGH_TPUT_THRESHOLD_DEFAULT,
-		CFG_TCP_TX_HIGH_TPUT_THRESHOLD_MIN,
-		CFG_TCP_TX_HIGH_TPUT_THRESHOLD_MAX),
+	REG_VARIABLE(CFG_TCP_DELACK_TIMER_COUNT, WLAN_PARAM_Integer,
+		     struct hdd_config, tcp_delack_timer_count,
+		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
+		     CFG_TCP_DELACK_TIMER_COUNT_DEFAULT,
+		     CFG_TCP_DELACK_TIMER_COUNT_MIN,
+		     CFG_TCP_DELACK_TIMER_COUNT_MAX),
 
+	REG_VARIABLE(CFG_TCP_TX_HIGH_TPUT_THRESHOLD_NAME, WLAN_PARAM_Integer,
+		     struct hdd_config, tcp_tx_high_tput_thres,
+		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
+		     CFG_TCP_TX_HIGH_TPUT_THRESHOLD_DEFAULT,
+		     CFG_TCP_TX_HIGH_TPUT_THRESHOLD_MIN,
+		     CFG_TCP_TX_HIGH_TPUT_THRESHOLD_MAX),
 #endif
 
 	REG_VARIABLE(CFG_ENABLE_FW_LOG_TYPE, WLAN_PARAM_Integer,
@@ -5331,9 +5337,13 @@ void hdd_cfg_print(hdd_context_t *pHddCtx)
 		  "Name = [gTcpDelAckThresholdLow] Value = [%u] ",
 		  pHddCtx->config->tcpDelackThresholdLow);
 	QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO_HIGH,
-		"Name = [%s] Value = [%u] ",
-		CFG_TCP_TX_HIGH_TPUT_THRESHOLD_NAME,
-		pHddCtx->config->tcp_tx_high_tput_thres);
+		  "Name = [%s] Value = [%u] ",
+		  CFG_TCP_DELACK_TIMER_COUNT,
+		  pHddCtx->config->tcp_delack_timer_count);
+	QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO_HIGH,
+		  "Name = [%s] Value = [%u] ",
+		  CFG_TCP_TX_HIGH_TPUT_THRESHOLD_NAME,
+		  pHddCtx->config->tcp_tx_high_tput_thres);
 
 #endif
 

+ 11 - 3
core/hdd/src/wlan_hdd_main.c

@@ -4596,6 +4596,7 @@ void hdd_wlan_exit(hdd_context_t *hdd_ctx)
 	if (QDF_TIMER_STATE_RUNNING ==
 	    qdf_mc_timer_get_current_state(&hdd_ctx->bus_bw_timer)) {
 		qdf_mc_timer_stop(&hdd_ctx->bus_bw_timer);
+		hdd_reset_tcp_delack(hdd_ctx);
 	}
 
 	if (!QDF_IS_STATUS_SUCCESS
@@ -5058,6 +5059,7 @@ void hdd_pld_request_bus_bandwidth(hdd_context_t *hdd_ctx,
 	enum pld_bus_width_type next_vote_level = PLD_BUS_WIDTH_NONE;
 	enum wlan_tp_level next_rx_level = WLAN_SVC_TP_NONE;
 	enum wlan_tp_level next_tx_level = WLAN_SVC_TP_NONE;
+	uint32_t delack_timer_cnt = hdd_ctx->config->tcp_delack_timer_count;
 
 	if (total > hdd_ctx->config->busBandwidthHighThreshold)
 		next_vote_level = PLD_BUS_WIDTH_HIGH;
@@ -5099,10 +5101,14 @@ void hdd_pld_request_bus_bandwidth(hdd_context_t *hdd_ctx,
 	temp_rx = (rx_packets + hdd_ctx->prev_rx) / 2;
 
 	hdd_ctx->prev_rx = rx_packets;
-	if (temp_rx > hdd_ctx->config->tcpDelackThresholdHigh)
+	if (temp_rx > hdd_ctx->config->tcpDelackThresholdHigh &&
+	    (hdd_ctx->cur_rx_level != WLAN_SVC_TP_HIGH &&
+	    ++hdd_ctx->rx_high_ind_cnt == delack_timer_cnt)) {
 		next_rx_level = WLAN_SVC_TP_HIGH;
-	else
+	} else {
 		next_rx_level = WLAN_SVC_TP_LOW;
+		hdd_ctx->rx_high_ind_cnt = 0;
+	}
 
 	hdd_ctx->hdd_txrx_hist[hdd_ctx->hdd_txrx_hist_idx].next_rx_level =
 								next_rx_level;
@@ -8400,8 +8406,10 @@ void hdd_stop_bus_bw_compute_timer(hdd_adapter_t *adapter)
 		}
 	}
 
-	if (can_stop == true)
+	if (can_stop == true) {
 		qdf_mc_timer_stop(&hdd_ctx->bus_bw_timer);
+		hdd_reset_tcp_delack(hdd_ctx);
+	}
 }
 #endif
 

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

@@ -60,6 +60,7 @@
 #include "ol_txrx.h"
 
 #include "wlan_hdd_nan_datapath.h"
+#include "pld_common.h"
 
 const uint8_t hdd_wmm_ac_to_highest_up[] = {
 	SME_QOS_WMM_UP_RESV,
@@ -1396,4 +1397,21 @@ err:
 	hdd_ctxt->enableRxThread = true;
 }
 
+#ifdef MSM_PLATFORM
+/**
+ * hdd_reset_tcp_delack() - Reset tcp delack value to default
+ * @hdd_ctx: Handle to hdd context
+ *
+ * Function used to reset TCP delack value to its default value
+ *
+ * Return: None
+ */
+void hdd_reset_tcp_delack(hdd_context_t *hdd_ctx)
+{
+	enum pld_bus_width_type next_level = PLD_BUS_WIDTH_LOW;
 
+	hdd_ctx->rx_high_ind_cnt = 0;
+	wlan_hdd_send_svc_nlink_msg(hdd_ctx->radio_index, WLAN_SVC_WLAN_TP_IND,
+				    &next_level, sizeof(next_level));
+}
+#endif /* MSM_PLATFORM */