qcacld-3.0: Make tx resource hi/low threshold configurable

Make tx resource hi/low threshold configurable through
config files and update hi threashold from 7.5% to 8%.

Change-Id: I2e52b7910caedf6e0af24242b79e1e9d42c6b85b
CRs-Fixed: 2548100
This commit is contained in:
Nirav Shah 2019-10-24 15:10:46 +05:30 • committed by nshrivas
commit 2b3843e027
6 changed files with 31 additions and 46 deletions

8
Kbuild
View file

@ -2889,6 +2889,14 @@ ifdef CONFIG_CFG_TGT_AST_SKID_LIMIT
ccflags-y += -DCFG_TGT_AST_SKID_LIMIT=$(CONFIG_CFG_TGT_AST_SKID_LIMIT)
endif
ifdef CONFIG_TX_RESOURCE_HIGH_TH_IN_PER
ccflags-y += -DTX_RESOURCE_HIGH_TH_IN_PER=$(CONFIG_TX_RESOURCE_HIGH_TH_IN_PER)
endif
ifdef CONFIG_TX_RESOURCE_LOW_TH_IN_PER
ccflags-y += -DTX_RESOURCE_LOW_TH_IN_PER=$(CONFIG_TX_RESOURCE_LOW_TH_IN_PER)
endif
CONFIG_WLAN_MAX_PSOCS ?= 1
ccflags-y += -DWLAN_MAX_PSOCS=$(CONFIG_WLAN_MAX_PSOCS)

View file

@ -13,6 +13,8 @@ CONFIG_PLD_SDIO_CNSS2 := y
# Data Path specific features
CONFIG_ATH_11AC_TXCOMPACT := n
CONFIG_QCA_HL_NETDEV_FLOW_CONTROL := y
CONFIG_TX_RESOURCE_HIGH_TH_IN_PER := 8
CONFIG_TX_RESOURCE_LOW_TH_IN_PER := 2
CONFIG_FEATURE_HL_GROUP_CREDIT_FLOW_CONTROL := y
CONFIG_FEATURE_HL_DBS_GROUP_CREDIT_SHARING := y
CONFIG_CREDIT_REP_THROUGH_CREDIT_UPDATE := y

View file

@ -13,6 +13,8 @@ CONFIG_PLD_SDIO_CNSS2 := y
# Data Path specific features
CONFIG_ATH_11AC_TXCOMPACT := n
CONFIG_QCA_HL_NETDEV_FLOW_CONTROL := y
CONFIG_TX_RESOURCE_HIGH_TH_IN_PER := 8
CONFIG_TX_RESOURCE_LOW_TH_IN_PER := 2
CONFIG_FEATURE_HL_GROUP_CREDIT_FLOW_CONTROL := y
CONFIG_FEATURE_HL_DBS_GROUP_CREDIT_SHARING := y
CONFIG_CREDIT_REP_THROUGH_CREDIT_UPDATE := y

View file

@ -10,6 +10,8 @@ CONFIG_PLD_USB_CNSS := y
# Data Path specific features
CONFIG_ATH_11AC_TXCOMPACT := n
CONFIG_QCA_HL_NETDEV_FLOW_CONTROL := y
CONFIG_TX_RESOURCE_HIGH_TH_IN_PER := 8
CONFIG_TX_RESOURCE_LOW_TH_IN_PER := 2
CONFIG_FEATURE_HL_GROUP_CREDIT_FLOW_CONTROL := y
CONFIG_FEATURE_HL_DBS_GROUP_CREDIT_SHARING := y
CONFIG_CREDIT_REP_THROUGH_CREDIT_UPDATE := y

View file

@ -10,6 +10,8 @@ CONFIG_PLD_USB_CNSS := y
# Data Path specific features
CONFIG_ATH_11AC_TXCOMPACT := n
CONFIG_QCA_HL_NETDEV_FLOW_CONTROL := y
CONFIG_TX_RESOURCE_HIGH_TH_IN_PER := 8
CONFIG_TX_RESOURCE_LOW_TH_IN_PER := 2
CONFIG_FEATURE_HL_GROUP_CREDIT_FLOW_CONTROL := y
CONFIG_FEATURE_HL_DBS_GROUP_CREDIT_SHARING := y
CONFIG_CREDIT_REP_THROUGH_CREDIT_UPDATE := y

View file

@ -56,6 +56,17 @@
#include <wlan_reg_services_api.h>
#include "qdf_hrtimer.h"
/* High/Low tx resource count in percentage */
/* Set default high threashold to 15% */
#ifndef TX_RESOURCE_HIGH_TH_IN_PER
#define TX_RESOURCE_HIGH_TH_IN_PER 15
#endif
/* Set default low threshold to 5% */
#ifndef TX_RESOURCE_LOW_TH_IN_PER
#define TX_RESOURCE_LOW_TH_IN_PER 5
#endif
#ifdef QCA_HL_NETDEV_FLOW_CONTROL
static u16 ol_txrx_tx_desc_alloc_table[TXRX_FC_MAX] = {
[TXRX_FC_5GH_80M_2x2] = 2000,
@ -228,56 +239,14 @@ struct ol_tx_desc_t *ol_tx_hl_desc_alloc(struct ol_txrx_pdev_t *pdev,
}
#endif
#ifdef QCA_HL_NETDEV_FLOW_CONTROL
/**
* ol_txrx_rsrc_threshold_lo() - set threshold low - when to start tx desc
* margin replenishment
* @desc_pool_size: tx desc pool size
*
* Return: threshold low
*/
static inline uint16_t
ol_txrx_rsrc_threshold_lo(int desc_pool_size)
{
int threshold_low;
/*
* 5% margin of unallocated desc is too much for per
* vdev mechanism.
* Define the value separately.
*/
threshold_low = TXRX_HL_TX_FLOW_CTRL_MGMT_RESERVED;
return threshold_low;
}
/**
* ol_txrx_rsrc_threshold_hi() - set threshold high - where to stop
* during tx desc margin replenishment
* @desc_pool_size: tx desc pool size
*
* Return: threshold high
*/
static inline uint16_t
ol_txrx_rsrc_threshold_hi(int desc_pool_size)
{
int threshold_high;
/* when freeing up descriptors,
* keep going until there's a 7.5% margin
*/
threshold_high = ((15 * desc_pool_size) / 100) / 2;
return threshold_high;
}
#else
static inline uint16_t
ol_txrx_rsrc_threshold_lo(int desc_pool_size)
{
int threshold_low;
/* always maintain a 5% margin of unallocated descriptors */
threshold_low = (5 * desc_pool_size) / 100;
threshold_low = ((TX_RESOURCE_LOW_TH_IN_PER) *
desc_pool_size) / 100;
return threshold_low;
}
@ -289,11 +258,11 @@ ol_txrx_rsrc_threshold_hi(int desc_pool_size)
/* when freeing up descriptors, keep going until
* there's a 15% margin
*/
threshold_high = (15 * desc_pool_size) / 100;
threshold_high = ((TX_RESOURCE_HIGH_TH_IN_PER) *
desc_pool_size) / 100;
return threshold_high;
}
#endif
void ol_tx_init_pdev(ol_txrx_pdev_handle pdev)
{