From 6272fb68a86336ffb15ffbe555735830179a639b Mon Sep 17 00:00:00 2001 From: Mohit Khanna Date: Thu, 13 Apr 2017 09:34:36 -0700 Subject: [PATCH] qcacld-3.0: Add ini support for tcp_adv_win_scale WLAN driver changes this system paramerter (via cnss-daemon) when the RX throughput requirement changes LOW->HIGH or HIGH->LOW. This depends on the whether the number of RX packets received in last 100ms interval is greater than 500 or not. The 100ms and 500 thresh params are configurable via WLAN ini file WCNSS_qcom_cfg.ini. Add ini support to enable/disable changing of this system parameter by WLAN driver. Since tcp_adv_win_scale is a system parameter, some customers may not want the WLAN driver to change it and may want to set their own default values. "gTcpAdvWinScaleEnable=0" when added to the ini file will prevent the driver from making any changes to the system parameter "/proc/sys/net/ipv4/tcp_adv_win_scale". The default value of the ini file param gTcpAdvWinScaleEnable is "1". CRs-Fixed: 2033338 Change-Id: I19288bba11841cf176118abaf08ccaabaf2f79b9 --- core/hdd/inc/wlan_hdd_cfg.h | 20 ++++++++++++++++++++ core/hdd/src/wlan_hdd_cfg.c | 10 ++++++++++ core/hdd/src/wlan_hdd_main.c | 4 +++- 3 files changed, 33 insertions(+), 1 deletion(-) diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h index 2a45634ac826..19f1ec682dfa 100644 --- a/core/hdd/inc/wlan_hdd_cfg.h +++ b/core/hdd/inc/wlan_hdd_cfg.h @@ -8012,6 +8012,25 @@ enum hdd_link_speed_rpt_type { #define CFG_BUS_BANDWIDTH_COMPUTE_INTERVAL_DEFAULT (100) #define CFG_BUS_BANDWIDTH_COMPUTE_INTERVAL_MIN (0) #define CFG_BUS_BANDWIDTH_COMPUTE_INTERVAL_MAX (10000) +/* + * + * gTcpAdvWinScaleEnable - Control to enable TCP adv window scaling + * @Min: -0 + * @Max: 1 + * @Default: 1 + * + * This ini is used to enable dynamic configuration of TCP adv window scaling system parameter. + * + * Supported Feature: Tcp Advance Window Scaling + * + * Usage: Internal + * + * + */ +#define CFG_ENABLE_TCP_ADV_WIN_SCALE "gTcpAdvWinScaleEnable" +#define CFG_ENABLE_TCP_ADV_WIN_SCALE_DEFAULT (1) +#define CFG_ENABLE_TCP_ADV_WIN_SCALE_MIN (0) +#define CFG_ENABLE_TCP_ADV_WIN_SCALE_MAX (1) /* * @@ -14040,6 +14059,7 @@ struct hdd_config { uint32_t busBandwidthLowThreshold; uint32_t busBandwidthComputeInterval; uint32_t enable_tcp_delack; + uint32_t enable_tcp_adv_win_scale; uint32_t tcpDelackThresholdHigh; uint32_t tcpDelackThresholdLow; uint32_t tcp_tx_high_tput_thres; diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c index c79da6d2e0dd..96bbd5580e85 100644 --- a/core/hdd/src/wlan_hdd_cfg.c +++ b/core/hdd/src/wlan_hdd_cfg.c @@ -3210,6 +3210,13 @@ struct reg_table_entry g_registry_table[] = { CFG_BUS_BANDWIDTH_COMPUTE_INTERVAL_MIN, CFG_BUS_BANDWIDTH_COMPUTE_INTERVAL_MAX), + REG_VARIABLE(CFG_ENABLE_TCP_ADV_WIN_SCALE, WLAN_PARAM_Integer, + struct hdd_config, enable_tcp_adv_win_scale, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_ENABLE_TCP_ADV_WIN_SCALE_DEFAULT, + CFG_ENABLE_TCP_ADV_WIN_SCALE_MIN, + CFG_ENABLE_TCP_ADV_WIN_SCALE_MAX), + REG_VARIABLE(CFG_ENABLE_TCP_DELACK, WLAN_PARAM_Integer, struct hdd_config, enable_tcp_delack, VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, @@ -6571,6 +6578,9 @@ void hdd_cfg_print(struct hdd_context *hdd_ctx) hdd_ctx->config->busBandwidthLowThreshold); hdd_debug("Name = [gbusBandwidthComputeInterval] Value = [%u] ", hdd_ctx->config->busBandwidthComputeInterval); + hdd_debug("Name = [%s] Value = [%u] ", + CFG_ENABLE_TCP_ADV_WIN_SCALE, + hdd_ctx->config->enable_tcp_adv_win_scale); hdd_debug("Name = [%s] Value = [%u] ", CFG_ENABLE_TCP_DELACK, hdd_ctx->config->enable_tcp_delack); diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 9568bac393a2..ade06d2cef33 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -6508,7 +6508,9 @@ static void hdd_pld_request_bus_bandwidth(struct hdd_context *hdd_ctx, if (hdd_ctx->config->enable_tcp_delack) rx_tp_data.rx_tp_flags |= TCP_DEL_ACK_IND; - rx_tp_data.rx_tp_flags |= TCP_ADV_WIN_SCL; + if (hdd_ctx->config->enable_tcp_adv_win_scale) + rx_tp_data.rx_tp_flags |= TCP_ADV_WIN_SCL; + rx_tp_data.level = next_rx_level; wlan_hdd_send_svc_nlink_msg(hdd_ctx->radio_index, WLAN_SVC_WLAN_TP_IND, &rx_tp_data,