* [RESEND PATCH 0/2] genirq/ath12k: fallback to threaded NAPI when IRQ affinity is unavailable
@ 2026-05-19 1:16 Hangtian Zhu
2026-05-19 1:16 ` [RESEND PATCH 1/2] genirq: export irq_can_set_affinity() for module drivers Hangtian Zhu
2026-05-19 1:16 ` [RESEND PATCH 2/2] wifi: ath12k: enable threaded NAPI when DP IRQ affinity is unavailable Hangtian Zhu
0 siblings, 2 replies; 6+ messages in thread
From: Hangtian Zhu @ 2026-05-19 1:16 UTC (permalink / raw)
To: tglx, jjohnson; +Cc: linux-wireless, ath12k, linux-kernel
This series improves ath12k datapath behavior on platforms where the
effective IRQ path for WLAN MSI interrupts does not support affinity
setting.
In such setups, DP processing cannot be distributed as intended and can
become CPU-constrained. The ath12k change switches to threaded NAPI when
runtime IRQ capability indicates affinity is unavailable.
Patch 1 exports irq_can_set_affinity() for module drivers so they can
reuse the IRQ core helper instead of open-coding equivalent checks.
Patch 2 uses irq_can_set_affinity() in ath12k PCI to enable threaded NAPI
for DP interrupt groups only when affinity cannot be set.
On RB3Gen2 with QCC2072, EHT160 UDP downlink throughput improved from
802 Mbps to 2.58 Gbps after enabling threaded NAPI.
Tested-on: QCC2072 hw1.0 PCI WLAN.COL.1.0.c2-00074-QCACOLSWPL_V1_TO_SILICONZ-1
Thanks,
Hangtian Zhu
Hangtian Zhu (2):
genirq: export irq_can_set_affinity() for module drivers
wifi: ath12k: enable threaded NAPI when DP IRQ affinity is unavailable
drivers/net/wireless/ath/ath12k/pci.c | 11 ++++++++++-
kernel/irq/manage.c | 1 +
2 files changed, 11 insertions(+), 1 deletion(-)
base-commit: db17e958184be9fe2b6242b7c5b7b261c0ce7110
--
2.25.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [RESEND PATCH 1/2] genirq: export irq_can_set_affinity() for module drivers
2026-05-19 1:16 [RESEND PATCH 0/2] genirq/ath12k: fallback to threaded NAPI when IRQ affinity is unavailable Hangtian Zhu
@ 2026-05-19 1:16 ` Hangtian Zhu
2026-05-19 14:30 ` Thomas Gleixner
2026-05-19 1:16 ` [RESEND PATCH 2/2] wifi: ath12k: enable threaded NAPI when DP IRQ affinity is unavailable Hangtian Zhu
1 sibling, 1 reply; 6+ messages in thread
From: Hangtian Zhu @ 2026-05-19 1:16 UTC (permalink / raw)
To: tglx, jjohnson; +Cc: linux-wireless, ath12k, linux-kernel
Export irq_can_set_affinity() for loadable drivers that need a runtime
check for IRQ affinity capability.
In hierarchical IRQ setups where the effective irqchip path lacks
.irq_set_affinity(), drivers may need to switch to a fallback policy.
Without this export, module drivers cannot use the core helper and have
to open-code equivalent checks.
Signed-off-by: Hangtian Zhu <hangtian.zhu@oss.qualcomm.com>
---
kernel/irq/manage.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index 2e8072437826..c3aa33ef4be9 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -171,6 +171,7 @@ int irq_can_set_affinity(unsigned int irq)
{
return __irq_can_set_affinity(irq_to_desc(irq));
}
+EXPORT_SYMBOL_GPL(irq_can_set_affinity);
/**
* irq_can_set_affinity_usr - Check if affinity of a irq can be set from user space
--
2.25.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [RESEND PATCH 2/2] wifi: ath12k: enable threaded NAPI when DP IRQ affinity is unavailable
2026-05-19 1:16 [RESEND PATCH 0/2] genirq/ath12k: fallback to threaded NAPI when IRQ affinity is unavailable Hangtian Zhu
2026-05-19 1:16 ` [RESEND PATCH 1/2] genirq: export irq_can_set_affinity() for module drivers Hangtian Zhu
@ 2026-05-19 1:16 ` Hangtian Zhu
1 sibling, 0 replies; 6+ messages in thread
From: Hangtian Zhu @ 2026-05-19 1:16 UTC (permalink / raw)
To: tglx, jjohnson; +Cc: linux-wireless, ath12k, linux-kernel
Determine threaded NAPI policy from runtime IRQ capability of the DP MSI
IRQ.
If irq_can_set_affinity() reports that affinity cannot be set, enable
threaded NAPI for DP interrupt groups so datapath processing is not
constrained by a single-CPU softirq context.
On RB3Gen2, where IRQ affinity is unavailable in the effective IRQ path,
EHT160 UDP downlink throughput improved from 802 Mbps to 2.58 Gbps after
enabling threaded NAPI.
Tested-on: QCC2072 hw1.0 PCI WLAN.COL.1.0.c2-00074-QCACOLSWPL_V1_TO_SILICONZ-1
Signed-off-by: Hangtian Zhu <hangtian.zhu@oss.qualcomm.com>
---
drivers/net/wireless/ath/ath12k/pci.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/ath/ath12k/pci.c b/drivers/net/wireless/ath/ath12k/pci.c
index 375277ca2b89..065449806ea9 100644
--- a/drivers/net/wireless/ath/ath12k/pci.c
+++ b/drivers/net/wireless/ath/ath12k/pci.c
@@ -5,6 +5,7 @@
*/
#include <linux/module.h>
+#include <linux/interrupt.h>
#include <linux/msi.h>
#include <linux/pci.h>
#include <linux/time.h>
@@ -537,6 +538,8 @@ static int ath12k_pci_ext_irq_config(struct ath12k_base *ab)
int i, j, n, ret, num_vectors = 0;
u32 user_base_data = 0, base_vector = 0, base_idx;
struct ath12k_ext_irq_grp *irq_grp;
+ bool threaded_napi = false;
+ int irq;
base_idx = ATH12K_PCI_IRQ_CE0_OFFSET + CE_COUNT_MAX;
ret = ath12k_pci_get_user_msi_assignment(ab, "DP",
@@ -546,6 +549,10 @@ static int ath12k_pci_ext_irq_config(struct ath12k_base *ab)
if (ret < 0)
return ret;
+ irq = ath12k_pci_get_msi_irq(ab->dev, base_vector);
+ if (irq >= 0)
+ threaded_napi = !irq_can_set_affinity(irq);
+
for (i = 0; i < ATH12K_EXT_IRQ_GRP_NUM_MAX; i++) {
irq_grp = &ab->ext_irq_grp[i];
u32 num_irq = 0;
@@ -560,6 +567,8 @@ static int ath12k_pci_ext_irq_config(struct ath12k_base *ab)
netif_napi_add(irq_grp->napi_ndev, &irq_grp->napi,
ath12k_pci_ext_grp_napi_poll);
+ if (threaded_napi)
+ netif_threaded_enable(irq_grp->napi_ndev);
if (ab->hw_params->ring_mask->tx[i] ||
ab->hw_params->ring_mask->rx[i] ||
@@ -578,7 +587,7 @@ static int ath12k_pci_ext_irq_config(struct ath12k_base *ab)
for (j = 0; j < irq_grp->num_irq; j++) {
int irq_idx = irq_grp->irqs[j];
int vector = (i % num_vectors) + base_vector;
- int irq = ath12k_pci_get_msi_irq(ab->dev, vector);
+ irq = ath12k_pci_get_msi_irq(ab->dev, vector);
ab->irq_num[irq_idx] = irq;
--
2.25.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [RESEND PATCH 1/2] genirq: export irq_can_set_affinity() for module drivers
2026-05-19 1:16 ` [RESEND PATCH 1/2] genirq: export irq_can_set_affinity() for module drivers Hangtian Zhu
@ 2026-05-19 14:30 ` Thomas Gleixner
2026-05-20 2:42 ` Hangtian Zhu
0 siblings, 1 reply; 6+ messages in thread
From: Thomas Gleixner @ 2026-05-19 14:30 UTC (permalink / raw)
To: Hangtian Zhu, jjohnson; +Cc: linux-wireless, ath12k, linux-kernel
eviewed-by: Thomas Gleixner <tglx@kernel.org>
On Tue, May 19 2026 at 09:16, Hangtian Zhu wrote:
> Export irq_can_set_affinity() for loadable drivers that need a runtime
> check for IRQ affinity capability.
>
> In hierarchical IRQ setups where the effective irqchip path lacks
> .irq_set_affinity(), drivers may need to switch to a fallback policy.
> Without this export, module drivers cannot use the core helper and have
> to open-code equivalent checks.
>
> Signed-off-by: Hangtian Zhu <hangtian.zhu@oss.qualcomm.com>
Assuming this goes through the wireless tree:
Acked-by: Thomas Gleixner <tglx@kernel.org>
If not, please let me know and I pick it up.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [RESEND PATCH 1/2] genirq: export irq_can_set_affinity() for module drivers
2026-05-19 14:30 ` Thomas Gleixner
@ 2026-05-20 2:42 ` Hangtian Zhu
2026-05-20 16:00 ` Jeff Johnson
0 siblings, 1 reply; 6+ messages in thread
From: Hangtian Zhu @ 2026-05-20 2:42 UTC (permalink / raw)
To: Thomas Gleixner, jjohnson; +Cc: linux-wireless, ath12k, linux-kernel
On 5/19/2026 22:30, Thomas Gleixner wrote:
> eviewed-by: Thomas Gleixner <tglx@kernel.org>
> On Tue, May 19 2026 at 09:16, Hangtian Zhu wrote:
>> Export irq_can_set_affinity() for loadable drivers that need a runtime
>> check for IRQ affinity capability.
>>
>> In hierarchical IRQ setups where the effective irqchip path lacks
>> .irq_set_affinity(), drivers may need to switch to a fallback policy.
>> Without this export, module drivers cannot use the core helper and have
>> to open-code equivalent checks.
>>
>> Signed-off-by: Hangtian Zhu <hangtian.zhu@oss.qualcomm.com>
> Assuming this goes through the wireless tree:
yes, it's wireless tree.
> Acked-by: Thomas Gleixner <tglx@kernel.org>
>
> If not, please let me know and I pick it up.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [RESEND PATCH 1/2] genirq: export irq_can_set_affinity() for module drivers
2026-05-20 2:42 ` Hangtian Zhu
@ 2026-05-20 16:00 ` Jeff Johnson
0 siblings, 0 replies; 6+ messages in thread
From: Jeff Johnson @ 2026-05-20 16:00 UTC (permalink / raw)
To: Hangtian Zhu, Thomas Gleixner, jjohnson
Cc: linux-wireless, ath12k, linux-kernel
On 5/19/2026 7:42 PM, Hangtian Zhu wrote:
>
>
> On 5/19/2026 22:30, Thomas Gleixner wrote:
>> eviewed-by: Thomas Gleixner <tglx@kernel.org>
>> On Tue, May 19 2026 at 09:16, Hangtian Zhu wrote:
>>> Export irq_can_set_affinity() for loadable drivers that need a runtime
>>> check for IRQ affinity capability.
>>>
>>> In hierarchical IRQ setups where the effective irqchip path lacks
>>> .irq_set_affinity(), drivers may need to switch to a fallback policy.
>>> Without this export, module drivers cannot use the core helper and have
>>> to open-code equivalent checks.
>>>
>>> Signed-off-by: Hangtian Zhu <hangtian.zhu@oss.qualcomm.com>
>> Assuming this goes through the wireless tree:
> yes, it's wireless tree.
>> Acked-by: Thomas Gleixner <tglx@kernel.org>
>>
>> If not, please let me know and I pick it up.
>
Technically, it will first go into my ath tree, but yes, I'll pick it up.
Thanks for the Ack!
/jeff
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-05-20 16:00 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-19 1:16 [RESEND PATCH 0/2] genirq/ath12k: fallback to threaded NAPI when IRQ affinity is unavailable Hangtian Zhu
2026-05-19 1:16 ` [RESEND PATCH 1/2] genirq: export irq_can_set_affinity() for module drivers Hangtian Zhu
2026-05-19 14:30 ` Thomas Gleixner
2026-05-20 2:42 ` Hangtian Zhu
2026-05-20 16:00 ` Jeff Johnson
2026-05-19 1:16 ` [RESEND PATCH 2/2] wifi: ath12k: enable threaded NAPI when DP IRQ affinity is unavailable Hangtian Zhu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox