qcacld-3.0: Set cds_ol_rx_thread schedule policy to SCHED_RR
On QCS405 platform, it's observed that cds_ol_rx_pkt_freeq is empty
while receiving UDP packets, driver try to allocate cds_ol_rx_pkt in
ol_rx_data_process but failed. This leads to lots of frames got dropped.
Raise cds_ol_rx_thread scheduler policy to SCHED_RR to compete with
CE tasklet scheduler speed. With this change, found cds_ol_rx_pkt_freeq
is not going to be empty while receiving UDP packets.
Change-Id: I4bee3d69c2754ec6be10a2b623b4ebe8b2c0859b
CRs-Fixed: 2373936
diff --git a/Kbuild b/Kbuild
index 8519c93..97e03a4 100644
--- a/Kbuild
+++ b/Kbuild
@@ -2072,6 +2072,9 @@
cppflags-$(CONFIG_FEATURE_WLAN_RMC) += -DFEATURE_WLAN_RMC
cppflags-$(CONFIG_FEATURE_BECN_STATS) += -DWLAN_FEATURE_BEACON_RECEPTION_STATS
+#Set kernel thread scheduler
+cppflags-$(CONFIG_THREAD_PERFORMANCE) += -DTHREAD_PERFORMANCE
+
#Enable OL debug and wmi unified functions
cppflags-$(CONFIG_ATH_PERF_PWR_OFFLOAD) += -DATH_PERF_PWR_OFFLOAD
diff --git a/configs/default_defconfig b/configs/default_defconfig
index 7000c21..d985510 100644
--- a/configs/default_defconfig
+++ b/configs/default_defconfig
@@ -88,6 +88,7 @@
ifeq ($(CONFIG_ARCH_QCS405), y)
CONFIG_WLAN_SYNC_TSF_PLUS := y
CONFIG_WLAN_SYNC_TSF_PLUS_NOIRQ := y
+ CONFIG_THREAD_PERFORMANCE := y
endif
#Flag to enable Legacy Fast Roaming2(LFR2)
diff --git a/core/cds/src/cds_sched.c b/core/cds/src/cds_sched.c
index b84ee46..808ae42 100644
--- a/core/cds/src/cds_sched.c
+++ b/core/cds/src/cds_sched.c
@@ -35,6 +35,9 @@
#include <linux/spinlock.h>
#include <linux/kthread.h>
#include <linux/cpu.h>
+#ifdef THREAD_PERFORMANCE
+#include <linux/sched/types.h>
+#endif
/* Milli seconds to delay SSR thread when an Entry point is Active */
#define SSR_WAIT_SLEEP_TIME 200
@@ -407,6 +410,12 @@
p_cds_sched_context pSchedContext,
uint32_t SchedCtxSize)
{
+#ifdef THREAD_PERFORMANCE
+ struct sched_param param;
+
+ param.sched_priority = 99;
+#endif
+
cds_debug("Opening the CDS Scheduler");
/* Sanity checks */
if ((p_cds_context == NULL) || (pSchedContext == NULL)) {
@@ -453,6 +462,9 @@
goto OL_RX_THREAD_START_FAILURE;
}
+#ifdef THREAD_PERFORMANCE
+ sched_setscheduler(pSchedContext->ol_rx_thread, SCHED_RR, ¶m);
+#endif
wake_up_process(pSchedContext->ol_rx_thread);
cds_debug("CDS OL RX thread Created");
wait_for_completion_interruptible(&pSchedContext->ol_rx_start_event);