From a25f75a84123f81239291e5f59dcfb9ee35412d4 Mon Sep 17 00:00:00 2001 From: Paul Zhang Date: Fri, 12 Apr 2019 17:11:14 +0800 Subject: [PATCH] qcacld-3.0: Add INI to config tx retry threshold Add gTxAggSwRetry for tx aggregation case, and Add gTxNonAggSwRetry for non tx aggregation case. Change-Id: I92265fb4e279eaf63c45f0134f997df02bca8737 CRs-Fixed: 2436305 --- components/mlme/core/src/wlan_mlme_main.c | 4 ++ components/mlme/dispatcher/inc/cfg_qos.h | 55 ++++++++++++++++++- .../dispatcher/inc/wlan_mlme_public_struct.h | 4 ++ core/mac/inc/sir_api.h | 4 ++ core/sme/src/csr/csr_api_roam.c | 4 ++ core/wma/inc/wma_api.h | 16 +++++- core/wma/inc/wma_if.h | 4 ++ core/wma/src/wma_dev_if.c | 26 ++++++++- core/wma/src/wma_features.c | 29 +++++++++- 9 files changed, 137 insertions(+), 9 deletions(-) diff --git a/components/mlme/core/src/wlan_mlme_main.c b/components/mlme/core/src/wlan_mlme_main.c index fe078ffbf2..6a94ded4ad 100644 --- a/components/mlme/core/src/wlan_mlme_main.c +++ b/components/mlme/core/src/wlan_mlme_main.c @@ -796,6 +796,8 @@ static void mlme_init_qos_cfg(struct wlan_objmgr_psoc *psoc, cfg_get(psoc, CFG_TX_AGGR_SW_RETRY_VI); qos_aggr_params->tx_aggr_sw_retry_threshold_vo = cfg_get(psoc, CFG_TX_AGGR_SW_RETRY_VO); + qos_aggr_params->tx_aggr_sw_retry_threshold = + cfg_get(psoc, CFG_TX_AGGR_SW_RETRY); qos_aggr_params->tx_non_aggr_sw_retry_threshold_be = cfg_get(psoc, CFG_TX_NON_AGGR_SW_RETRY_BE); qos_aggr_params->tx_non_aggr_sw_retry_threshold_bk = @@ -804,6 +806,8 @@ static void mlme_init_qos_cfg(struct wlan_objmgr_psoc *psoc, cfg_get(psoc, CFG_TX_NON_AGGR_SW_RETRY_VI); qos_aggr_params->tx_non_aggr_sw_retry_threshold_vo = cfg_get(psoc, CFG_TX_NON_AGGR_SW_RETRY_VO); + qos_aggr_params->tx_non_aggr_sw_retry_threshold = + cfg_get(psoc, CFG_TX_NON_AGGR_SW_RETRY); qos_aggr_params->sap_max_inactivity_override = cfg_get(psoc, CFG_SAP_MAX_INACTIVITY_OVERRIDE); qos_aggr_params->sap_uapsd_enabled = diff --git a/components/mlme/dispatcher/inc/cfg_qos.h b/components/mlme/dispatcher/inc/cfg_qos.h index 9069c33b49..db28b214dd 100644 --- a/components/mlme/dispatcher/inc/cfg_qos.h +++ b/components/mlme/dispatcher/inc/cfg_qos.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-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 @@ -397,7 +397,56 @@ 0, \ CFG_VALUE_OR_DEFAULT, \ "Tx non aggregation retry value for VO") - +/* + * + * gTxAggSwRetry - Configure Tx aggregation sw retry + * @Min: 0 + * @Max: 64 + * @Default: 0 + * + * gTxAggSwRetry gives an option to configure Tx aggregation sw + * retry. This can be useful in debugging throughput issues. + * + * Related: None + * + * Supported Feature: STA + * + * Usage: External + * + * + */ +#define CFG_TX_AGGR_SW_RETRY CFG_INI_UINT( \ + "gTxAggSwRetry", \ + 0, \ + 64, \ + 0, \ + CFG_VALUE_OR_DEFAULT, \ + "Tx aggregation retry value") +/* + * + * gTxNonAggSwRetry - Configure Tx non aggregation sw retry + * @Min: 0 + * @Max: 64 + * @Default: 0 + * + * gTxNonAggSwRetry gives an option to configure Tx non aggregation sw + * retry. This can be useful in debugging throughput issues. + * + * Related: None + * + * Supported Feature: STA + * + * Usage: External + * + * + */ +#define CFG_TX_NON_AGGR_SW_RETRY CFG_INI_UINT( \ + "gTxNonAggSwRetry", \ + 0, \ + 64, \ + 0, \ + CFG_VALUE_OR_DEFAULT, \ + "Tx non aggregation retry value") /* * * gSapMaxInactivityOverride - Configure @@ -459,10 +508,12 @@ CFG(CFG_TX_AGGR_SW_RETRY_BK) \ CFG(CFG_TX_AGGR_SW_RETRY_VI) \ CFG(CFG_TX_AGGR_SW_RETRY_VO) \ + CFG(CFG_TX_AGGR_SW_RETRY) \ CFG(CFG_TX_NON_AGGR_SW_RETRY_BE) \ CFG(CFG_TX_NON_AGGR_SW_RETRY_BK) \ CFG(CFG_TX_NON_AGGR_SW_RETRY_VI) \ CFG(CFG_TX_NON_AGGR_SW_RETRY_VO) \ + CFG(CFG_TX_NON_AGGR_SW_RETRY) \ CFG(CFG_SAP_QOS_UAPSD) #endif /* __CFG_MLME_QOS_H */ diff --git a/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h b/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h index c4961e7991..e1b2b92092 100644 --- a/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h +++ b/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h @@ -789,10 +789,12 @@ struct wlan_mlme_vht_caps { * @tx_aggr_sw_retry_threshold_bk: aggr sw retry threshold for BK * @tx_aggr_sw_retry_threshold_vi: aggr sw retry threshold for VI * @tx_aggr_sw_retry_threshold_vo: aggr sw retry threshold for VO + * @tx_aggr_sw_retry_threshold: aggr sw retry threshold * @tx_non_aggr_sw_retry_threshold_be: non aggr sw retry threshold for BE * @tx_non_aggr_sw_retry_threshold_bk: non aggr sw retry threshold for BK * @tx_non_aggr_sw_retry_threshold_vi: non aggr sw retry threshold for VI * @tx_non_aggr_sw_retry_threshold_vo: non aggr sw retry threshold for VO + * @tx_non_aggr_sw_retry_threshold: non aggr sw retry threshold * @sap_max_inactivity_override: Override updating ap_sta_inactivity from * hostapd.conf * @sap_uapsd_enabled: Flag to enable/disable UAPSD for SAP @@ -808,10 +810,12 @@ struct wlan_mlme_qos { uint32_t tx_aggr_sw_retry_threshold_bk; uint32_t tx_aggr_sw_retry_threshold_vi; uint32_t tx_aggr_sw_retry_threshold_vo; + uint32_t tx_aggr_sw_retry_threshold; uint32_t tx_non_aggr_sw_retry_threshold_be; uint32_t tx_non_aggr_sw_retry_threshold_bk; uint32_t tx_non_aggr_sw_retry_threshold_vi; uint32_t tx_non_aggr_sw_retry_threshold_vo; + uint32_t tx_non_aggr_sw_retry_threshold; bool sap_max_inactivity_override; bool sap_uapsd_enabled; }; diff --git a/core/mac/inc/sir_api.h b/core/mac/inc/sir_api.h index 8e55470ad0..c379b5957d 100644 --- a/core/mac/inc/sir_api.h +++ b/core/mac/inc/sir_api.h @@ -5232,10 +5232,12 @@ struct sir_set_tx_rx_aggregation_size { * @tx_aggr_sw_retry_threshold_bk: aggr sw retry threshold for BK * @tx_aggr_sw_retry_threshold_vi: aggr sw retry threshold for VI * @tx_aggr_sw_retry_threshold_vo: aggr sw retry threshold for VO + * @tx_aggr_sw_retry_threshold: aggr sw retry threshold * @tx_non_aggr_sw_retry_threshold_be: non aggr sw retry threshold for BE * @tx_non_aggr_sw_retry_threshold_bk: non aggr sw retry threshold for BK * @tx_non_aggr_sw_retry_threshold_vi: non aggr sw retry threshold for VI * @tx_non_aggr_sw_retry_threshold_vo: non aggr sw retry threshold for VO + * @tx_non_aggr_sw_retry_threshold: non aggr sw retry threshold */ struct sir_set_tx_sw_retry_threshold { uint8_t vdev_id; @@ -5243,10 +5245,12 @@ struct sir_set_tx_sw_retry_threshold { uint32_t tx_aggr_sw_retry_threshold_bk; uint32_t tx_aggr_sw_retry_threshold_vi; uint32_t tx_aggr_sw_retry_threshold_vo; + uint32_t tx_aggr_sw_retry_threshold; uint32_t tx_non_aggr_sw_retry_threshold_be; uint32_t tx_non_aggr_sw_retry_threshold_bk; uint32_t tx_non_aggr_sw_retry_threshold_vi; uint32_t tx_non_aggr_sw_retry_threshold_vo; + uint32_t tx_non_aggr_sw_retry_threshold; }; /** diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index 7889fd869c..34a5bd083e 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -16786,6 +16786,8 @@ QDF_STATUS csr_issue_add_sta_for_session_req(struct mac_context *mac, qos_aggr->tx_aggr_sw_retry_threshold_vi; add_sta_self_req->tx_aggr_sw_retry_threshold_vo = qos_aggr->tx_aggr_sw_retry_threshold_vo; + add_sta_self_req->tx_aggr_sw_retry_threshold = + qos_aggr->tx_aggr_sw_retry_threshold; add_sta_self_req->tx_non_aggr_sw_retry_threshold_be = qos_aggr->tx_non_aggr_sw_retry_threshold_be; add_sta_self_req->tx_non_aggr_sw_retry_threshold_bk = @@ -16794,6 +16796,8 @@ QDF_STATUS csr_issue_add_sta_for_session_req(struct mac_context *mac, qos_aggr->tx_non_aggr_sw_retry_threshold_vi; add_sta_self_req->tx_non_aggr_sw_retry_threshold_vo = qos_aggr->tx_non_aggr_sw_retry_threshold_vo; + add_sta_self_req->tx_non_aggr_sw_retry_threshold = + qos_aggr->tx_non_aggr_sw_retry_threshold; add_sta_self_req->enable_bcast_probe_rsp = mac->mlme_cfg->oce.enable_bcast_probe_rsp; diff --git a/core/wma/inc/wma_api.h b/core/wma/inc/wma_api.h index 8c55a1f333..a4e5316579 100644 --- a/core/wma/inc/wma_api.h +++ b/core/wma/inc/wma_api.h @@ -283,7 +283,7 @@ 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 + * wma_set_sw_retry_threshold_per_ac() - set sw retry threshold per AC for tx * @handle: wma handle * @tx_sw_retry_threshold: value needs to set to firmware * @@ -292,9 +292,21 @@ QDF_STATUS wma_set_tx_rx_aggregation_size_per_ac * * Return: QDF_STATUS. */ -QDF_STATUS wma_set_sw_retry_threshold +QDF_STATUS wma_set_sw_retry_threshold_per_ac (WMA_HANDLE handle, struct sir_set_tx_sw_retry_threshold *tx_sw_retry_threshold); +/** + * wma_set_sw_retry_threshold() - set sw retry threshold for tx + * @vdev_id: vdev + * @retry: retry number + * @param: for aggregation or non-aggregation + * + * This function sends WMI command to set the sw retry threshold for Tx. + * + * Return: QDF_STATUS. + */ +QDF_STATUS wma_set_sw_retry_threshold(uint8_t vdev_id, uint32_t retry, + uint32_t param); /** * wma_get_sar_limit() - get SAR limits from the target * @handle: wma handle diff --git a/core/wma/inc/wma_if.h b/core/wma/inc/wma_if.h index 7203a79938..6eb349cf10 100644 --- a/core/wma/inc/wma_if.h +++ b/core/wma/inc/wma_if.h @@ -889,10 +889,12 @@ typedef struct sMaxTxPowerPerBandParams { * @tx_aggr_sw_retry_threshold_bk: aggr sw retry threshold for bk * @tx_aggr_sw_retry_threshold_vi: aggr sw retry threshold for vi * @tx_aggr_sw_retry_threshold_vo: aggr sw retry threshold for vo + * @tx_aggr_sw_retry_threshold: aggr sw retry threshold * @tx_non_aggr_sw_retry_threshold_be: non aggr sw retry threshold for be * @tx_non_aggr_sw_retry_threshold_bk: non aggr sw retry threshold for bk * @tx_non_aggr_sw_retry_threshold_vi: non aggr sw retry threshold for vi * @tx_non_aggr_sw_retry_threshold_vo: non aggr sw retry threshold for vo + * @tx_non_aggr_sw_retry_threshold: non aggr sw retry threshold */ struct add_sta_self_params { tSirMacAddr self_mac_addr; @@ -917,10 +919,12 @@ struct add_sta_self_params { uint32_t tx_aggr_sw_retry_threshold_bk; uint32_t tx_aggr_sw_retry_threshold_vi; uint32_t tx_aggr_sw_retry_threshold_vo; + uint32_t tx_aggr_sw_retry_threshold; uint32_t tx_non_aggr_sw_retry_threshold_be; uint32_t tx_non_aggr_sw_retry_threshold_bk; uint32_t tx_non_aggr_sw_retry_threshold_vi; uint32_t tx_non_aggr_sw_retry_threshold_vo; + uint32_t tx_non_aggr_sw_retry_threshold; }; /** diff --git a/core/wma/src/wma_dev_if.c b/core/wma/src/wma_dev_if.c index 7cc1adb61b..aac115ccaf 100644 --- a/core/wma/src/wma_dev_if.c +++ b/core/wma/src/wma_dev_if.c @@ -2866,6 +2866,7 @@ struct cdp_vdev *wma_vdev_attach(tp_wma_handle wma_handle, void *soc = cds_get_context(QDF_MODULE_ID_SOC); struct wlan_objmgr_peer *obj_peer; struct wlan_objmgr_vdev *vdev; + uint32_t retry; qdf_mem_zero(&tx_rx_aggregation_size, sizeof(tx_rx_aggregation_size)); WMA_LOGD("mac %pM, vdev_id %hu, type %d, sub_type %d, nss 2g %d, 5g %d", @@ -2975,6 +2976,8 @@ struct cdp_vdev *wma_vdev_attach(tp_wma_handle wma_handle, self_sta_req->tx_aggr_sw_retry_threshold_vi; tx_sw_retry_threshold.tx_aggr_sw_retry_threshold_vo = self_sta_req->tx_aggr_sw_retry_threshold_vo; + tx_sw_retry_threshold.tx_aggr_sw_retry_threshold = + self_sta_req->tx_aggr_sw_retry_threshold; tx_sw_retry_threshold.tx_non_aggr_sw_retry_threshold_be = self_sta_req->tx_non_aggr_sw_retry_threshold_be; @@ -2984,6 +2987,8 @@ struct cdp_vdev *wma_vdev_attach(tp_wma_handle wma_handle, self_sta_req->tx_non_aggr_sw_retry_threshold_vi; tx_sw_retry_threshold.tx_non_aggr_sw_retry_threshold_vo = self_sta_req->tx_non_aggr_sw_retry_threshold_vo; + tx_sw_retry_threshold.tx_non_aggr_sw_retry_threshold = + self_sta_req->tx_non_aggr_sw_retry_threshold; tx_sw_retry_threshold.vdev_id = self_sta_req->session_id; @@ -3007,8 +3012,25 @@ struct cdp_vdev *wma_vdev_attach(tp_wma_handle wma_handle, wma_set_sta_sa_query_param(wma_handle, vdev_id); } - ret = wma_set_sw_retry_threshold(wma_handle, - &tx_sw_retry_threshold); + vdev_id = tx_sw_retry_threshold.vdev_id; + retry = tx_sw_retry_threshold.tx_aggr_sw_retry_threshold; + if (retry) { + ret = wma_set_sw_retry_threshold(vdev_id, retry, + WMI_PDEV_PARAM_AGG_SW_RETRY_TH); + if (QDF_IS_STATUS_ERROR(ret)) + WMA_LOGE("failed set agg retry threshold"); + } + + retry = tx_sw_retry_threshold.tx_non_aggr_sw_retry_threshold; + if (retry) { + ret = wma_set_sw_retry_threshold(vdev_id, retry, + WMI_PDEV_PARAM_NON_AGG_SW_RETRY_TH); + if (QDF_IS_STATUS_ERROR(ret)) + WMA_LOGE("failed set non-agg retry threshold"); + } + + ret = wma_set_sw_retry_threshold_per_ac(wma_handle, + &tx_sw_retry_threshold); if (QDF_IS_STATUS_ERROR(ret)) WMA_LOGE("failed to set retry threshold(err=%d)", ret); break; diff --git a/core/wma/src/wma_features.c b/core/wma/src/wma_features.c index 8f00786865..85f8f72985 100644 --- a/core/wma/src/wma_features.c +++ b/core/wma/src/wma_features.c @@ -45,9 +45,9 @@ #include "wma_types.h" #include "lim_api.h" #include "lim_session_utils.h" - +#include "cfg_ucfg_api.h" #include "cds_utils.h" - +#include "cfg_qos.h" #if !defined(REMOVE_PKT_LOG) #include "pktlog_ac.h" #endif /* REMOVE_PKT_LOG */ @@ -4679,7 +4679,7 @@ static QDF_STATUS wma_set_sw_retry_by_qos( return QDF_STATUS_SUCCESS; } -QDF_STATUS wma_set_sw_retry_threshold( +QDF_STATUS wma_set_sw_retry_threshold_per_ac( WMA_HANDLE handle, struct sir_set_tx_sw_retry_threshold *tx_sw_retry_threshold) { @@ -4743,6 +4743,29 @@ QDF_STATUS wma_set_sw_retry_threshold( return QDF_STATUS_SUCCESS; } +QDF_STATUS wma_set_sw_retry_threshold(uint8_t vdev_id, uint32_t retry, + uint32_t param_id) +{ + uint32_t max, min; + uint32_t ret; + + if (param_id == WMI_PDEV_PARAM_AGG_SW_RETRY_TH) { + max = cfg_max(CFG_TX_AGGR_SW_RETRY); + min = cfg_min(CFG_TX_AGGR_SW_RETRY); + } else { + max = cfg_max(CFG_TX_NON_AGGR_SW_RETRY); + min = cfg_min(CFG_TX_NON_AGGR_SW_RETRY); + } + + retry = (retry > max) ? max : retry; + retry = (retry < min) ? min : retry; + + ret = wma_cli_set_command(vdev_id, param_id, retry, PDEV_CMD); + if (ret) + return QDF_STATUS_E_IO; + + return QDF_STATUS_SUCCESS; +} #ifndef QCA_SUPPORT_CP_STATS /** * wma_get_wakelock_stats() - Populates wake lock stats