qcacld-3.0: Bind ol_rx_thread to perf CPU
When RX_PERFORMANCE is set, bind ol_rx_thread to perf CPU.
Do not update tdls stats and acquire rx_wakelock while
throughput is high, to avoid station drop packets caused
by slow process of ol_rx_data_cb(hdd_rx_packet_cbk).
Change-Id: I4e2a8d7f98907c205cc6988d8af309e7a5515b89
CRs-Fixed: 2373936
diff --git a/Kbuild b/Kbuild
index 97e03a4..24cc5fe 100644
--- a/Kbuild
+++ b/Kbuild
@@ -2073,7 +2073,7 @@
cppflags-$(CONFIG_FEATURE_BECN_STATS) += -DWLAN_FEATURE_BEACON_RECEPTION_STATS
#Set kernel thread scheduler
-cppflags-$(CONFIG_THREAD_PERFORMANCE) += -DTHREAD_PERFORMANCE
+cppflags-$(CONFIG_RX_PERFORMANCE) += -DRX_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 d02b4b6..9af7c5f 100644
--- a/configs/default_defconfig
+++ b/configs/default_defconfig
@@ -88,7 +88,7 @@
ifeq ($(CONFIG_ARCH_QCS405), y)
CONFIG_WLAN_SYNC_TSF_PLUS := y
CONFIG_WLAN_SYNC_TSF_PLUS_NOIRQ := y
- CONFIG_THREAD_PERFORMANCE := y
+ CONFIG_RX_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 808ae42..8a6ed81 100644
--- a/core/cds/src/cds_sched.c
+++ b/core/cds/src/cds_sched.c
@@ -35,7 +35,7 @@
#include <linux/spinlock.h>
#include <linux/kthread.h>
#include <linux/cpu.h>
-#ifdef THREAD_PERFORMANCE
+#ifdef RX_PERFORMANCE
#include <linux/sched/types.h>
#endif
@@ -410,7 +410,7 @@
p_cds_sched_context pSchedContext,
uint32_t SchedCtxSize)
{
-#ifdef THREAD_PERFORMANCE
+#ifdef RX_PERFORMANCE
struct sched_param param;
param.sched_priority = 99;
@@ -462,7 +462,7 @@
goto OL_RX_THREAD_START_FAILURE;
}
-#ifdef THREAD_PERFORMANCE
+#ifdef RX_PERFORMANCE
sched_setscheduler(pSchedContext->ol_rx_thread, SCHED_RR, ¶m);
#endif
wake_up_process(pSchedContext->ol_rx_thread);
@@ -733,6 +733,10 @@
p_cds_sched_context pSchedContext = (p_cds_sched_context) arg;
bool shutdown = false;
int status;
+#ifdef RX_PERFORMANCE
+ int i;
+ unsigned long pref_cpu = 0;
+#endif
#ifdef RX_THREAD_PRIORITY
struct sched_param scheduler_params = {0};
@@ -747,6 +751,21 @@
set_wake_up_idle(true);
#endif
+#ifdef RX_PERFORMANCE
+ /*
+ * Find the available cpu core other than cpu 0 and
+ * bind the thread
+ */
+ for_each_online_cpu(i) {
+ if (i == 0)
+ continue;
+ pref_cpu = i;
+ break;
+ }
+ if (pref_cpu != 0 && (!cds_set_cpus_allowed_ptr(current, pref_cpu)))
+ affine_cpu = pref_cpu;
+#endif
+
complete(&pSchedContext->ol_rx_start_event);
while (!shutdown) {
diff --git a/core/hdd/inc/hdd_dp_cfg.h b/core/hdd/inc/hdd_dp_cfg.h
index f0bd14b..be812d5 100644
--- a/core/hdd/inc/hdd_dp_cfg.h
+++ b/core/hdd/inc/hdd_dp_cfg.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2019 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
diff --git a/core/hdd/src/wlan_hdd_tx_rx.c b/core/hdd/src/wlan_hdd_tx_rx.c
index c948ab6..0250082 100644
--- a/core/hdd/src/wlan_hdd_tx_rx.c
+++ b/core/hdd/src/wlan_hdd_tx_rx.c
@@ -2083,8 +2083,9 @@
dest_mac_addr = (struct qdf_mac_addr *)(skb->data);
mac_addr = (struct qdf_mac_addr *)(skb->data+QDF_MAC_ADDR_SIZE);
- ucfg_tdls_update_rx_pkt_cnt(adapter->vdev, mac_addr,
- dest_mac_addr);
+ if (hdd_ctx->cur_vote_level < PLD_BUS_WIDTH_HIGH)
+ ucfg_tdls_update_rx_pkt_cnt(adapter->vdev, mac_addr,
+ dest_mac_addr);
skb->dev = adapter->dev;
skb->protocol = eth_type_trans(skb, skb->dev);
@@ -2106,8 +2107,9 @@
}
/* hold configurable wakelock for unicast traffic */
- if (hdd_ctx->config->rx_wakelock_timeout &&
- sta_ctx->conn_info.uIsAuthenticated)
+ if (hdd_ctx->cur_vote_level < PLD_BUS_WIDTH_HIGH &&
+ hdd_ctx->config->rx_wakelock_timeout &&
+ sta_ctx->conn_info.uIsAuthenticated)
wake_lock = hdd_is_rx_wake_lock_needed(skb);
if (wake_lock) {