diff options
| author | Paul Zhang <paulz@codeaurora.org> | 2018-04-17 10:41:22 +0800 |
|---|---|---|
| committer | nshrivas <nshrivas@codeaurora.org> | 2018-04-17 02:48:16 -0700 |
| commit | 467564eabb4e5628bc1d683cd4c94bf05477b611 (patch) | |
| tree | bdbc983f63083f1ecf260cf9adbbe5013be5a469 | |
| parent | c2b67717ba9cad829d37ccca279442ffaa3bf727 (diff) | |
qcacld-3.0: Config number of TX sw retry per AC
Video/audio wireless application needs to tune parameters
per AC based. Config the number of TX sw retry per AC via
driver INI configuration file. It helps to improve the
video/audio performance in noisy environment.
Change-Id: Icffb5174b265b6453021b0d0a8ad3e12b695847a
CRs-Fixed: 2212954
| -rw-r--r-- | core/hdd/inc/wlan_hdd_cfg.h | 100 | ||||
| -rw-r--r-- | core/hdd/src/wlan_hdd_cfg.c | 37 | ||||
| -rw-r--r-- | core/mac/inc/sir_api.h | 16 | ||||
| -rw-r--r-- | core/sme/inc/csr_api.h | 4 | ||||
| -rw-r--r-- | core/sme/inc/csr_internal.h | 4 | ||||
| -rw-r--r-- | core/sme/src/csr/csr_api_roam.c | 16 | ||||
| -rw-r--r-- | core/wma/inc/wma_api.h | 11 | ||||
| -rw-r--r-- | core/wma/inc/wma_if.h | 8 | ||||
| -rw-r--r-- | core/wma/src/wma_dev_if.c | 18 | ||||
| -rw-r--r-- | core/wma/src/wma_features.c | 76 |
10 files changed, 290 insertions, 0 deletions
diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h index 0d78f685597a..a9caac8a30d2 100644 --- a/core/hdd/inc/wlan_hdd_cfg.h +++ b/core/hdd/inc/wlan_hdd_cfg.h @@ -9375,6 +9375,102 @@ enum hdd_link_speed_rpt_type { #define CFG_RX_AGGREGATION_SIZE_DEFAULT (64) /* + * <ini> + * gTxAggSwRetryBE - Configure Tx aggregation sw retry for BE + * @Min: 0 + * @Max: 64 + * @Default: 0 + * + * gTxAggSwRetryBE gives an option to configure Tx aggregation sw + * retry for BE. This can be useful in debugging throughput issues. + * + * Related: None + * + * Supported Feature: STA + * + * Usage: External + * + * </ini> + */ + +#define CFG_TX_AGGR_SW_RETRY_BE "gTxAggSwRetryBE" +#define CFG_TX_AGGR_SW_RETRY_BE_MIN (0) +#define CFG_TX_AGGR_SW_RETRY_BE_MAX (64) +#define CFG_TX_AGGR_SW_RETRY_BE_DEFAULT (0) + +/* + * <ini> + * gTxAggSwRetryBK - Configure Tx aggregation sw retry for BK + * @Min: 0 + * @Max: 64 + * @Default: 0 + * + * gTxAggSwRetryBK gives an option to configure Tx aggregation sw + * retry for BK. This can be useful in debugging throughput issues. + * + * Related: None + * + * Supported Feature: STA + * + * Usage: External + * + * </ini> + */ + +#define CFG_TX_AGGR_SW_RETRY_BK "gTxAggSwRetryBK" +#define CFG_TX_AGGR_SW_RETRY_BK_MIN (0) +#define CFG_TX_AGGR_SW_RETRY_BK_MAX (64) +#define CFG_TX_AGGR_SW_RETRY_BK_DEFAULT (0) + +/* + * <ini> + * gTxAggSwRetryVI - Configure Tx aggregation sw retry for VI + * @Min: 0 + * @Max: 64 + * @Default: 0 + * + * gTxAggSwRetryVI gives an option to configure Tx aggregation sw + * retry for VI. This can be useful in debugging throughput issues. + * + * Related: None + * + * Supported Feature: STA + * + * Usage: External + * + * </ini> + */ + +#define CFG_TX_AGGR_SW_RETRY_VI "gTxAggSwRetryVI" +#define CFG_TX_AGGR_SW_RETRY_VI_MIN (0) +#define CFG_TX_AGGR_SW_RETRY_VI_MAX (64) +#define CFG_TX_AGGR_SW_RETRY_VI_DEFAULT (0) + +/* + * <ini> + * gTxAggSwRetryVO - Configure Tx aggregation sw retry for VO + * @Min: 0 + * @Max: 64 + * @Default: 0 + * + * gTxAggSwRetryVO gives an option to configure Tx aggregation sw + * retry for VO. This can be useful in debugging throughput issues. + * + * Related: None + * + * Supported Feature: STA + * + * Usage: External + * + * </ini> + */ + +#define CFG_TX_AGGR_SW_RETRY_VO "gTxAggSwRetryVO" +#define CFG_TX_AGGR_SW_RETRY_VO_MIN (0) +#define CFG_TX_AGGR_SW_RETRY_VO_MAX (64) +#define CFG_TX_AGGR_SW_RETRY_VO_DEFAULT (0) + +/* * fine timing measurement capability information * * <----- fine_time_meas_cap (in bits) -----> @@ -15321,6 +15417,10 @@ struct hdd_config { uint32_t tx_aggregation_size_vi; uint32_t tx_aggregation_size_vo; uint32_t rx_aggregation_size; + uint32_t tx_aggr_sw_retry_threshold_be; + uint32_t tx_aggr_sw_retry_threshold_bk; + uint32_t tx_aggr_sw_retry_threshold_vi; + uint32_t tx_aggr_sw_retry_threshold_vo; bool sta_prefer_80MHz_over_160MHz; uint8_t sap_max_inactivity_override; bool fw_timeout_crash; diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c index aa23591b7735..7db4b5e7beba 100644 --- a/core/hdd/src/wlan_hdd_cfg.c +++ b/core/hdd/src/wlan_hdd_cfg.c @@ -4553,6 +4553,35 @@ struct reg_table_entry g_registry_table[] = { CFG_RX_AGGREGATION_SIZE_DEFAULT, CFG_RX_AGGREGATION_SIZE_MIN, CFG_RX_AGGREGATION_SIZE_MAX), + + REG_VARIABLE(CFG_TX_AGGR_SW_RETRY_BE, WLAN_PARAM_Integer, + struct hdd_config, tx_aggr_sw_retry_threshold_be, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_TX_AGGR_SW_RETRY_BE_DEFAULT, + CFG_TX_AGGR_SW_RETRY_BE_MIN, + CFG_TX_AGGR_SW_RETRY_BE_MAX), + + REG_VARIABLE(CFG_TX_AGGR_SW_RETRY_BK, WLAN_PARAM_Integer, + struct hdd_config, tx_aggr_sw_retry_threshold_bk, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_TX_AGGR_SW_RETRY_BK_DEFAULT, + CFG_TX_AGGR_SW_RETRY_BK_MIN, + CFG_TX_AGGR_SW_RETRY_BK_MAX), + + REG_VARIABLE(CFG_TX_AGGR_SW_RETRY_VI, WLAN_PARAM_Integer, + struct hdd_config, tx_aggr_sw_retry_threshold_vi, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_TX_AGGR_SW_RETRY_VI_DEFAULT, + CFG_TX_AGGR_SW_RETRY_VI_MIN, + CFG_TX_AGGR_SW_RETRY_VI_MAX), + + REG_VARIABLE(CFG_TX_AGGR_SW_RETRY_VO, WLAN_PARAM_Integer, + struct hdd_config, tx_aggr_sw_retry_threshold_vo, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_TX_AGGR_SW_RETRY_VO_DEFAULT, + CFG_TX_AGGR_SW_RETRY_VO_MIN, + CFG_TX_AGGR_SW_RETRY_VO_MAX), + REG_VARIABLE(CFG_SAP_MAX_INACTIVITY_OVERRIDE_NAME, WLAN_PARAM_Integer, struct hdd_config, sap_max_inactivity_override, VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, @@ -10119,6 +10148,14 @@ QDF_STATUS hdd_set_sme_config(hdd_context_t *pHddCtx) pHddCtx->config->tx_aggregation_size_vo; smeConfig->csrConfig.rx_aggregation_size = pHddCtx->config->rx_aggregation_size; + smeConfig->csrConfig.tx_aggr_sw_retry_threshold_be = + pHddCtx->config->tx_aggr_sw_retry_threshold_be; + smeConfig->csrConfig.tx_aggr_sw_retry_threshold_bk = + pHddCtx->config->tx_aggr_sw_retry_threshold_bk; + smeConfig->csrConfig.tx_aggr_sw_retry_threshold_vi = + pHddCtx->config->tx_aggr_sw_retry_threshold_vi; + smeConfig->csrConfig.tx_aggr_sw_retry_threshold_vo = + pHddCtx->config->tx_aggr_sw_retry_threshold_vo; smeConfig->csrConfig.enable_bcast_probe_rsp = pHddCtx->config->enable_bcast_probe_rsp; smeConfig->csrConfig.is_fils_enabled = diff --git a/core/mac/inc/sir_api.h b/core/mac/inc/sir_api.h index 9e7d14976655..74dbb6bbc1c8 100644 --- a/core/mac/inc/sir_api.h +++ b/core/mac/inc/sir_api.h @@ -7896,6 +7896,22 @@ struct sir_set_tx_rx_aggregation_size { }; /** + * struct sir_set_tx_aggr_sw_retry_threshold - set sw retry threshold + * @vdev_id: vdev id of the session + * @tx_aggr_sw_retry_threshold_be: sw retry threshold for BE + * @tx_aggr_sw_retry_threshold_bk: sw retry threshold for BK + * @tx_aggr_sw_retry_threshold_vi: sw retry threshold for VI + * @tx_aggr_sw_retry_threshold_vo: sw retry threshold for VO + */ +struct sir_set_tx_aggr_sw_retry_threshold { + uint8_t vdev_id; + uint32_t tx_aggr_sw_retry_threshold_be; + uint32_t tx_aggr_sw_retry_threshold_bk; + uint32_t tx_aggr_sw_retry_threshold_vi; + uint32_t tx_aggr_sw_retry_threshold_vo; +}; + +/** * struct sir_p2p_lo_start - p2p listen offload start * @vdev_id: vdev identifier * @ctl_flags: control flag diff --git a/core/sme/inc/csr_api.h b/core/sme/inc/csr_api.h index 392402b93773..8061876d3feb 100644 --- a/core/sme/inc/csr_api.h +++ b/core/sme/inc/csr_api.h @@ -1391,6 +1391,10 @@ typedef struct tagCsrConfigParam { uint32_t tx_aggregation_size_vi; uint32_t tx_aggregation_size_vo; uint32_t rx_aggregation_size; + uint32_t tx_aggr_sw_retry_threshold_be; + uint32_t tx_aggr_sw_retry_threshold_bk; + uint32_t tx_aggr_sw_retry_threshold_vi; + uint32_t tx_aggr_sw_retry_threshold_vo; struct wmi_per_roam_config per_roam_config; bool enable_bcast_probe_rsp; bool is_fils_enabled; diff --git a/core/sme/inc/csr_internal.h b/core/sme/inc/csr_internal.h index c283c851eda1..130dd0192a14 100644 --- a/core/sme/inc/csr_internal.h +++ b/core/sme/inc/csr_internal.h @@ -669,6 +669,10 @@ typedef struct tagCsrConfig { uint32_t tx_aggregation_size_vi; uint32_t tx_aggregation_size_vo; uint32_t rx_aggregation_size; + uint32_t tx_aggr_sw_retry_threshold_be; + uint32_t tx_aggr_sw_retry_threshold_bk; + uint32_t tx_aggr_sw_retry_threshold_vi; + uint32_t tx_aggr_sw_retry_threshold_vo; struct wmi_per_roam_config per_roam_config; bool enable_bcast_probe_rsp; bool is_fils_enabled; diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index c7431e0f503c..08df0470d90c 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -2992,6 +2992,14 @@ QDF_STATUS csr_change_default_config_param(tpAniSirGlobal pMac, pParam->tx_aggregation_size_vo; pMac->roam.configParam.rx_aggregation_size = pParam->rx_aggregation_size; + pMac->roam.configParam.tx_aggr_sw_retry_threshold_be = + pParam->tx_aggr_sw_retry_threshold_be; + pMac->roam.configParam.tx_aggr_sw_retry_threshold_bk = + pParam->tx_aggr_sw_retry_threshold_bk; + pMac->roam.configParam.tx_aggr_sw_retry_threshold_vi = + pParam->tx_aggr_sw_retry_threshold_vi; + pMac->roam.configParam.tx_aggr_sw_retry_threshold_vo = + pParam->tx_aggr_sw_retry_threshold_vo; pMac->roam.configParam.enable_bcast_probe_rsp = pParam->enable_bcast_probe_rsp; pMac->roam.configParam.is_fils_enabled = @@ -16900,6 +16908,14 @@ QDF_STATUS csr_process_add_sta_session_command(tpAniSirGlobal pMac, pMac->roam.configParam.pkt_err_disconn_th; add_sta_self_req->oce_feature_bitmap = pMac->roam.configParam.oce_feature_bitmap; + add_sta_self_req->tx_aggr_sw_retry_threshold_be = + pMac->roam.configParam.tx_aggr_sw_retry_threshold_be; + add_sta_self_req->tx_aggr_sw_retry_threshold_bk = + pMac->roam.configParam.tx_aggr_sw_retry_threshold_bk; + add_sta_self_req->tx_aggr_sw_retry_threshold_vi = + pMac->roam.configParam.tx_aggr_sw_retry_threshold_vi; + add_sta_self_req->tx_aggr_sw_retry_threshold_vo = + pMac->roam.configParam.tx_aggr_sw_retry_threshold_vo; msg.type = WMA_ADD_STA_SELF_REQ; msg.reserved = 0; msg.bodyptr = add_sta_self_req; diff --git a/core/wma/inc/wma_api.h b/core/wma/inc/wma_api.h index 5d74bfc60e1b..9f60f7bdf5f5 100644 --- a/core/wma/inc/wma_api.h +++ b/core/wma/inc/wma_api.h @@ -402,6 +402,17 @@ QDF_STATUS wma_set_tx_rx_aggregation_size QDF_STATUS wma_set_tx_rx_aggregation_size_per_ac (struct sir_set_tx_rx_aggregation_size *tx_rx_aggregation_size); /** + * wma_set_sw_retry_threshold() - set sw retry threshold per AC for tx + * @tx_rx_aggregation_size: value needs to set to firmware + * + * This function sends WMI command to set the sw retry threshold per AC + * for Tx. + * + * Return: QDF_STATUS. + */ +QDF_STATUS wma_set_sw_retry_threshold + (struct sir_set_tx_aggr_sw_retry_threshold *tx_rx_aggregation_size); +/** * wma_get_sar_limit() - get SAR limits from the target * @handle: wma handle * @callback: Callback function to invoke with the results diff --git a/core/wma/inc/wma_if.h b/core/wma/inc/wma_if.h index 284021d7c412..f37f55421f32 100644 --- a/core/wma/inc/wma_if.h +++ b/core/wma/inc/wma_if.h @@ -1159,6 +1159,10 @@ typedef struct sMaxTxPowerPerBandParams { * @enable_bcast_probe_rsp: enable broadcast probe response * @fils_max_chan_guard_time: FILS max channel guard time * @pkt_err_disconn_th: packet drop threshold + * @tx_aggr_sw_retry_threshold_be: sw retry threshold for be + * @tx_aggr_sw_retry_threshold_bk: sw retry threshold for bk + * @tx_aggr_sw_retry_threshold_vi: sw retry threshold for vi + * @tx_aggr_sw_retry_threshold_vo: sw retry threshold for vo */ struct add_sta_self_params { tSirMacAddr self_mac_addr; @@ -1179,6 +1183,10 @@ struct add_sta_self_params { uint8_t fils_max_chan_guard_time; uint16_t pkt_err_disconn_th; uint8_t oce_feature_bitmap; + uint32_t tx_aggr_sw_retry_threshold_be; + uint32_t tx_aggr_sw_retry_threshold_bk; + uint32_t tx_aggr_sw_retry_threshold_vi; + uint32_t tx_aggr_sw_retry_threshold_vo; }; /** diff --git a/core/wma/src/wma_dev_if.c b/core/wma/src/wma_dev_if.c index d159ac969056..cbda5b9c9cc6 100644 --- a/core/wma/src/wma_dev_if.c +++ b/core/wma/src/wma_dev_if.c @@ -2073,6 +2073,7 @@ ol_txrx_vdev_handle wma_vdev_attach(tp_wma_handle wma_handle, struct vdev_create_params params = { 0 }; u_int8_t vdev_id; struct sir_set_tx_rx_aggregation_size tx_rx_aggregation_size; + struct sir_set_tx_aggr_sw_retry_threshold tx_aggr_sw_retry_threshold; WMA_LOGD("mac %pM, vdev_id %hu, type %d, sub_type %d, nss 2g %d, 5g %d", self_sta_req->self_mac_addr, self_sta_req->session_id, @@ -2180,6 +2181,17 @@ ol_txrx_vdev_handle wma_vdev_attach(tp_wma_handle wma_handle, tx_rx_aggregation_size.tx_aggregation_size_vo = self_sta_req->tx_aggregation_size_vo; + tx_aggr_sw_retry_threshold.tx_aggr_sw_retry_threshold_be = + self_sta_req->tx_aggr_sw_retry_threshold_be; + tx_aggr_sw_retry_threshold.tx_aggr_sw_retry_threshold_bk = + self_sta_req->tx_aggr_sw_retry_threshold_bk; + tx_aggr_sw_retry_threshold.tx_aggr_sw_retry_threshold_vi = + self_sta_req->tx_aggr_sw_retry_threshold_vi; + tx_aggr_sw_retry_threshold.tx_aggr_sw_retry_threshold_vo = + self_sta_req->tx_aggr_sw_retry_threshold_vo; + tx_aggr_sw_retry_threshold.vdev_id = self_sta_req->session_id; + + switch (self_sta_req->type) { case WMI_VDEV_TYPE_STA: status = wma_set_tx_rx_aggregation_size_per_ac( @@ -2205,6 +2217,12 @@ ol_txrx_vdev_handle wma_vdev_attach(tp_wma_handle wma_handle, wma_set_sta_sa_query_param(wma_handle, self_sta_req->session_id); } + + status = wma_set_sw_retry_threshold( + &tx_aggr_sw_retry_threshold); + if (status != QDF_STATUS_SUCCESS) + WMA_LOGE("failed to set retry threshold(err=%d)", + status); break; } diff --git a/core/wma/src/wma_features.c b/core/wma/src/wma_features.c index cc6b67b6239a..8a32315c1d73 100644 --- a/core/wma/src/wma_features.c +++ b/core/wma/src/wma_features.c @@ -10238,6 +10238,82 @@ QDF_STATUS wma_set_tx_rx_aggregation_size_per_ac( return QDF_STATUS_SUCCESS; } +QDF_STATUS wma_set_sw_retry_threshold( + struct sir_set_tx_aggr_sw_retry_threshold *tx_sw_retry_threshold) +{ + tp_wma_handle wma_handle; + wmi_vdev_set_custom_sw_retry_th_cmd_fixed_param *cmd; + int32_t len; + wmi_buf_t buf; + u_int8_t *buf_ptr; + int ret; + int queue_num; + uint32_t tx_aggr_retry[WMI_AC_MAX]; + + wma_handle = cds_get_context(QDF_MODULE_ID_WMA); + + if (!tx_sw_retry_threshold) { + WMA_LOGE("%s: invalid pointer", __func__); + return QDF_STATUS_E_INVAL; + } + + if (!wma_handle) { + WMA_LOGE("%s: WMA context is invald!", __func__); + return QDF_STATUS_E_INVAL; + } + + tx_aggr_retry[0] = + tx_sw_retry_threshold->tx_aggr_sw_retry_threshold_be; + tx_aggr_retry[1] = + tx_sw_retry_threshold->tx_aggr_sw_retry_threshold_bk; + tx_aggr_retry[2] = + tx_sw_retry_threshold->tx_aggr_sw_retry_threshold_vi; + tx_aggr_retry[3] = + tx_sw_retry_threshold->tx_aggr_sw_retry_threshold_vo; + + for (queue_num = 0; queue_num < WMI_AC_MAX; queue_num++) { + if (tx_aggr_retry[queue_num] == 0) + continue; + + len = sizeof(*cmd); + buf = wmi_buf_alloc(wma_handle->wmi_handle, len); + + if (!buf) { + WMA_LOGE("%s: Failed allocate wmi buffer", __func__); + return QDF_STATUS_E_NOMEM; + } + + buf_ptr = (u_int8_t *)wmi_buf_data(buf); + cmd = + (wmi_vdev_set_custom_sw_retry_th_cmd_fixed_param *)buf_ptr; + + WMITLV_SET_HDR(&cmd->tlv_header, + WMITLV_TAG_STRUC_wmi_vdev_set_custom_sw_retry_th_cmd_fixed_param, + WMITLV_GET_STRUCT_TLVLEN( + wmi_vdev_set_custom_sw_retry_th_cmd_fixed_param)); + + cmd->vdev_id = tx_sw_retry_threshold->vdev_id; + cmd->ac_type = queue_num; + cmd->sw_retry_type = WMI_VDEV_CUSTOM_SW_RETRY_TYPE_AGGR; + cmd->sw_retry_th = tx_aggr_retry[queue_num]; + + WMA_LOGD("queue: %d type: %d threadhold: %d vdev: %d", + queue_num, cmd->sw_retry_type, + cmd->sw_retry_th, cmd->vdev_id); + + ret = wmi_unified_cmd_send(wma_handle->wmi_handle, buf, len, + WMI_VDEV_SET_CUSTOM_SW_RETRY_TH_CMDID); + if (ret) { + WMA_LOGE("%s: Failed to send retry threshold command", + __func__); + wmi_buf_free(buf); + return QDF_STATUS_E_FAILURE; + } + } + + return QDF_STATUS_SUCCESS; +} + /** * wma_p2p_lo_start() - P2P listen offload start * @params: p2p listen offload parameters |
