diff --git a/Kbuild b/Kbuild index b3fab262231f..622a66f29dd3 100644 --- a/Kbuild +++ b/Kbuild @@ -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) diff --git a/configs/genoa.sdio.debug_defconfig b/configs/genoa.sdio.debug_defconfig index 9784ac542cf9..bc5038ece82f 100644 --- a/configs/genoa.sdio.debug_defconfig +++ b/configs/genoa.sdio.debug_defconfig @@ -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 diff --git a/configs/genoa.sdio.perf_defconfig b/configs/genoa.sdio.perf_defconfig index e8b73d71d9e2..7faff21bd551 100644 --- a/configs/genoa.sdio.perf_defconfig +++ b/configs/genoa.sdio.perf_defconfig @@ -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 diff --git a/configs/genoa.usb.debug_defconfig b/configs/genoa.usb.debug_defconfig index 15fe2c7d213d..c8475b64a923 100644 --- a/configs/genoa.usb.debug_defconfig +++ b/configs/genoa.usb.debug_defconfig @@ -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 diff --git a/configs/genoa.usb.perf_defconfig b/configs/genoa.usb.perf_defconfig index 1b54255933b8..c0cbeca8730a 100644 --- a/configs/genoa.usb.perf_defconfig +++ b/configs/genoa.usb.perf_defconfig @@ -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 diff --git a/core/dp/txrx/ol_tx_hl.c b/core/dp/txrx/ol_tx_hl.c index 1f1e5d5b68f8..ec4201d9b6b1 100644 --- a/core/dp/txrx/ol_tx_hl.c +++ b/core/dp/txrx/ol_tx_hl.c @@ -56,6 +56,17 @@ #include #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) {