wlan-ap-Telecominfraproject/feeds/ipq95xx/mac80211/patches/qca/720-g-ath12k-Introduce-a-module_param-to-change-the-tx-com.patch
John Crispin 144c5d00f4 ipq95xx/mac80211: update to ATH12.3-CS
Signed-off-by: John Crispin <john@phrozen.org>
2024-02-28 18:56:21 +01:00

73 lines
2.6 KiB
Diff

From 0ab9fe790ac5992c537256e6162bda522ecc3c92 Mon Sep 17 00:00:00 2001
From: Ramanathan Choodamani <quic_rchoodam@quicinc.com>
Date: Tue, 7 Mar 2023 02:21:23 -0800
Subject: [PATCH 1/2] ath12k: Introduce a module_param to
change the completion budget on demand
Add module param support to change the tx completion budget
on demand.
Signed-off-by: Balamurugan Mahalingam <quic_bmahalin@quicinc.com>
Signed-off-by: Ramanathan Choodamani <quic_rchoodam@quicinc.com>
---
drivers/net/wireless/ath/ath12k/dp_tx.c | 6 ++++--
drivers/net/wireless/ath/ath12k/pci.c | 7 +++++--
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/ath/ath12k/dp_tx.c b/drivers/net/wireless/ath/ath12k/dp_tx.c
index 7d33296..4e9b45b 100644
--- a/drivers/net/wireless/ath/ath12k/dp_tx.c
+++ b/drivers/net/wireless/ath/ath12k/dp_tx.c
@@ -980,10 +980,14 @@ int ath12k_dp_tx_completion_handler(struct ath12k_base *ab, int ring_id,
return 0;
}
+ if (valid_entries > budget)
+ valid_entries = budget;
+
ath12k_hal_srng_dst_invalidate_entry(ab, status_ring, valid_entries);
skb_queue_head_init(&free_list_head);
while (budget && (tx_status = ath12k_hal_srng_dst_get_next_cache_entry(ab, status_ring))) {
+ budget--;
if (!ath12k_dp_tx_completion_valid(tx_status))
continue;
@@ -1024,8 +1028,6 @@ int ath12k_dp_tx_completion_handler(struct ath12k_base *ab, int ring_id,
tx_desc);
continue;
}
- budget--;
-
ar = ab->pdevs[mac_id].ar;
if (atomic_dec_and_test(&ar->dp.num_tx_pending))
wake_up(&ar->dp.tx_empty_waitq);
diff --git a/drivers/net/wireless/ath/ath12k/pci.c b/drivers/net/wireless/ath/ath12k/pci.c
index 68f11b4..5badd39 100644
--- a/drivers/net/wireless/ath/ath12k/pci.c
+++ b/drivers/net/wireless/ath/ath12k/pci.c
@@ -47,7 +47,10 @@
/* choose a little lower value for tx completion processing
* to give priority for enqueue */
-#define ATH12K_TX_COMP_NAPI_BUDGET 0x5F
+unsigned int tx_comp_budget = 0x7F;
+EXPORT_SYMBOL(tx_comp_budget);
+module_param_named(tx_comp_budget, tx_comp_budget, uint, 0644);
+MODULE_PARM_DESC(tx_comp_budget, "tx_comp_budget");
char dp_irq_name[ATH12K_MAX_PCI_DOMAINS + 1][ATH12K_EXT_IRQ_GRP_NUM_MAX][DP_IRQ_NAME_LEN] = {};
@@ -530,7 +533,7 @@ static int ath12k_pci_ext_irq_config(struct ath12k_base *ab)
/* Apply a reduced budget for tx completion to prioritize tx
* enqueue operation */
if (ab->hw_params->ring_mask->tx[i])
- budget = ATH12K_TX_COMP_NAPI_BUDGET;
+ budget = tx_comp_budget;
netif_napi_add(&irq_grp->napi_ndev, &irq_grp->napi,
ath12k_pci_ext_grp_napi_poll, budget);
--
2.7.4