From 9a7f302b187dd845611ef4ee35b305bd078e59d6 Mon Sep 17 00:00:00 2001 From: Manikanta Pubbisetty Date: Fri, 15 Apr 2022 11:29:25 +0200 Subject: [PATCH] ath11k: Enable threaded NAPI on some radios Enable threaded NAPI on IPQ8074 and QCN9074. Unlike traditional NAPI poll which runs in softirq context and on the core which scheduled the NAPI, threaded NAPI makes use of kernel threads which are under direct control of the scheduler and helps in balancing the NAPI processing load across multiple CPUs, this helps in improving throughput. In the case of IPQ8074 it increased the throughput at 80MHz by about 200Mbps. Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.5.0.1-01201-QCAHKSWPL_SILICONZ-1 Signed-off-by: Manikanta Pubbisetty Signed-off-by: Robert Marko --- drivers/net/wireless/ath/ath11k/ahb.c | 2 ++ drivers/net/wireless/ath/ath11k/core.c | 6 ++++++ drivers/net/wireless/ath/ath11k/hw.h | 1 + drivers/net/wireless/ath/ath11k/pcic.c | 2 ++ 4 files changed, 11 insertions(+) --- a/drivers/net/wireless/ath/ath11k/ahb.c +++ b/drivers/net/wireless/ath/ath11k/ahb.c @@ -304,6 +304,8 @@ static void ath11k_ahb_ext_irq_enable(st struct ath11k_ext_irq_grp *irq_grp = &ab->ext_irq_grp[i]; if (!irq_grp->napi_enabled) { + if (ab->hw_params.threaded_napi) + dev_set_threaded(&irq_grp->napi_ndev, true); napi_enable(&irq_grp->napi); irq_grp->napi_enabled = true; } --- a/drivers/net/wireless/ath/ath11k/core.c +++ b/drivers/net/wireless/ath/ath11k/core.c @@ -101,6 +101,7 @@ static const struct ath11k_hw_params ath .current_cc_support = false, .dbr_debug_support = true, .global_reset = false, + .threaded_napi = true, }, { .hw_rev = ATH11K_HW_IPQ6018_HW10, @@ -167,6 +168,7 @@ static const struct ath11k_hw_params ath .current_cc_support = false, .dbr_debug_support = true, .global_reset = false, + .threaded_napi = false, }, { .name = "qca6390 hw2.0", @@ -232,6 +234,7 @@ static const struct ath11k_hw_params ath .current_cc_support = true, .dbr_debug_support = false, .global_reset = true, + .threaded_napi = false, }, { .name = "qcn9074 hw1.0", @@ -297,6 +300,7 @@ static const struct ath11k_hw_params ath .current_cc_support = false, .dbr_debug_support = true, .global_reset = false, + .threaded_napi = true, }, { .name = "wcn6855 hw2.0", @@ -362,6 +366,7 @@ static const struct ath11k_hw_params ath .current_cc_support = true, .dbr_debug_support = false, .global_reset = true, + .threaded_napi = false, }, { .name = "wcn6855 hw2.1", @@ -426,6 +431,7 @@ static const struct ath11k_hw_params ath .current_cc_support = true, .dbr_debug_support = false, .global_reset = true, + .threaded_napi = false, }, }; --- a/drivers/net/wireless/ath/ath11k/hw.h +++ b/drivers/net/wireless/ath/ath11k/hw.h @@ -195,6 +195,7 @@ struct ath11k_hw_params { bool current_cc_support; bool dbr_debug_support; bool global_reset; + bool threaded_napi; }; struct ath11k_hw_ops { --- a/drivers/net/wireless/ath/ath11k/pcic.c +++ b/drivers/net/wireless/ath/ath11k/pcic.c @@ -441,6 +441,8 @@ void ath11k_pcic_ext_irq_enable(struct a struct ath11k_ext_irq_grp *irq_grp = &ab->ext_irq_grp[i]; if (!irq_grp->napi_enabled) { + if (ab->hw_params.threaded_napi) + dev_set_threaded(&irq_grp->napi_ndev, true); napi_enable(&irq_grp->napi); irq_grp->napi_enabled = true; }