diff mbox series

[RFC,5/8] ath11k: Enable threaded NAPI on WCN6750

Message ID 1643261609-13500-6-git-send-email-quic_mpubbise@quicinc.com
State New
Headers show
Series [RFC,1/8] ath11k: Enable low power mode when WLAN is not active | expand

Commit Message

Manikanta Pubbisetty Jan. 27, 2022, 5:33 a.m. UTC
Enable threaded NAPI on WCN6750; 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 WCN6750, enabling threaded NAPI has improved
160Mhz RX throughput by nearly 400Mbps.

Tested-on: WCN6750 hw1.0 AHB WLAN.MSL.1.0.1-00573-QCAMSLSWPLZ-1

Signed-off-by: Manikanta Pubbisetty <quic_mpubbise@quicinc.com>
---
 drivers/net/wireless/ath/ath11k/ahb.c     | 2 ++
 drivers/net/wireless/ath/ath11k/core.c    | 7 +++++++
 drivers/net/wireless/ath/ath11k/hw.h      | 1 +
 drivers/net/wireless/ath/ath11k/pci_cmn.c | 4 +++-
 4 files changed, 13 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/net/wireless/ath/ath11k/ahb.c b/drivers/net/wireless/ath/ath11k/ahb.c
index 4301f62..fd3bb43 100644
--- a/drivers/net/wireless/ath/ath11k/ahb.c
+++ b/drivers/net/wireless/ath/ath11k/ahb.c
@@ -331,6 +331,8 @@  static void ath11k_ahb_ext_irq_enable(struct ath11k_base *ab)
 		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;
 		}
diff --git a/drivers/net/wireless/ath/ath11k/core.c b/drivers/net/wireless/ath/ath11k/core.c
index 643f655..161bddf 100644
--- a/drivers/net/wireless/ath/ath11k/core.c
+++ b/drivers/net/wireless/ath/ath11k/core.c
@@ -99,6 +99,7 @@  static const struct ath11k_hw_params ath11k_hw_params[] = {
 		.supports_rssi_stats = false,
 		.fw_wmi_diag_event = false,
 		.non_wow_suspend = false,
+		.threaded_napi = false,
 	},
 	{
 		.hw_rev = ATH11K_HW_IPQ6018_HW10,
@@ -164,6 +165,7 @@  static const struct ath11k_hw_params ath11k_hw_params[] = {
 		.supports_rssi_stats = false,
 		.fw_wmi_diag_event = false,
 		.non_wow_suspend = false,
+		.threaded_napi = false,
 	},
 	{
 		.name = "qca6390 hw2.0",
@@ -228,6 +230,7 @@  static const struct ath11k_hw_params ath11k_hw_params[] = {
 		.supports_rssi_stats = true,
 		.fw_wmi_diag_event = true,
 		.non_wow_suspend = false,
+		.threaded_napi = false,
 	},
 	{
 		.name = "qcn9074 hw1.0",
@@ -292,6 +295,7 @@  static const struct ath11k_hw_params ath11k_hw_params[] = {
 		.supports_rssi_stats = false,
 		.fw_wmi_diag_event = false,
 		.non_wow_suspend = false,
+		.threaded_napi = false,
 	},
 	{
 		.name = "wcn6855 hw2.0",
@@ -356,6 +360,7 @@  static const struct ath11k_hw_params ath11k_hw_params[] = {
 		.supports_rssi_stats = true,
 		.fw_wmi_diag_event = true,
 		.non_wow_suspend = false,
+		.threaded_napi = false,
 	},
 	{
 		.name = "wcn6855 hw2.1",
@@ -419,6 +424,7 @@  static const struct ath11k_hw_params ath11k_hw_params[] = {
 		.supports_rssi_stats = true,
 		.fw_wmi_diag_event = true,
 		.non_wow_suspend = false,
+		.threaded_napi = false,
 	},
 	{
 		.name = "wcn6750 hw1.0",
@@ -482,6 +488,7 @@  static const struct ath11k_hw_params ath11k_hw_params[] = {
 		.supports_rssi_stats = true,
 		.fw_wmi_diag_event = false,
 		.non_wow_suspend = true,
+		.threaded_napi = true,
 	},
 };
 
diff --git a/drivers/net/wireless/ath/ath11k/hw.h b/drivers/net/wireless/ath/ath11k/hw.h
index ed4b72b..d33b9b7 100644
--- a/drivers/net/wireless/ath/ath11k/hw.h
+++ b/drivers/net/wireless/ath/ath11k/hw.h
@@ -194,6 +194,7 @@  struct ath11k_hw_params {
 	bool fw_wmi_diag_event;
 	bool non_wow_suspend;
 	bool cold_boot_fw_restart;
+	bool threaded_napi;
 };
 
 struct ath11k_hw_ops {
diff --git a/drivers/net/wireless/ath/ath11k/pci_cmn.c b/drivers/net/wireless/ath/ath11k/pci_cmn.c
index 047fcd7..6550f7c 100644
--- a/drivers/net/wireless/ath/ath11k/pci_cmn.c
+++ b/drivers/net/wireless/ath/ath11k/pci_cmn.c
@@ -1,7 +1,7 @@ 
 // SPDX-License-Identifier: BSD-3-Clause-Clear
 /*
  * Copyright (c) 2019-2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2021, Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2022, Qualcomm Innovation Center, Inc. All rights reserved.
  */
 
 #include "core.h"
@@ -425,6 +425,8 @@  void ath11k_pci_ext_irq_enable(struct ath11k_base *ab)
 		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;
 		}