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
This commit is contained in:
hangtian 2019-01-19 15:50:00 +08:00 committed by nshrivas
parent 122d45cb94
commit 0ec24dc0ab
5 changed files with 31 additions and 10 deletions

2
Kbuild
View File

@ -2073,7 +2073,7 @@ 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
cppflags-$(CONFIG_RX_PERFORMANCE) += -DRX_PERFORMANCE
#Enable OL debug and wmi unified functions
cppflags-$(CONFIG_ATH_PERF_PWR_OFFLOAD) += -DATH_PERF_PWR_OFFLOAD

View File

@ -88,7 +88,7 @@ endif
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)

View File

@ -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 @@ QDF_STATUS cds_sched_open(void *p_cds_context,
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 @@ QDF_STATUS cds_sched_open(void *p_cds_context,
goto OL_RX_THREAD_START_FAILURE;
}
#ifdef THREAD_PERFORMANCE
#ifdef RX_PERFORMANCE
sched_setscheduler(pSchedContext->ol_rx_thread, SCHED_RR, &param);
#endif
wake_up_process(pSchedContext->ol_rx_thread);
@ -733,6 +733,10 @@ static int cds_ol_rx_thread(void *arg)
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 @@ static int cds_ol_rx_thread(void *arg)
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) {

View File

@ -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

View File

@ -2083,8 +2083,9 @@ QDF_STATUS hdd_rx_packet_cbk(void *adapter_context,
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 @@ QDF_STATUS hdd_rx_packet_cbk(void *adapter_context,
}
/* 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) {