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: I411f5ce67b04a70b194b0e8a7f8014b9c2c9bef7
CRs-Fixed: 2373936
This commit is contained in:
hangtian 2019-01-25 11:50:39 +08:00 • committed by nshrivas
commit 2b9856fdde
6 changed files with 73 additions and 18 deletions

4
Kbuild
View file

@ -2079,8 +2079,8 @@ cppflags-$(CONFIG_WLAN_SYSFS) += -DWLAN_SYSFS
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
#Set RX_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

@ -89,7 +89,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
@ -388,6 +388,35 @@ static void cds_cpu_before_offline_cb(void *context, uint32_t cpu)
{
cds_cpu_hotplug_notify(cpu, false);
}
#ifdef RX_PERFORMANCE
/**
* cds_set_ol_rx_thread_scheduler - set ol_rx_thread scheduler
* @psched_context: Pointer to a previously allocated buffer big
*
* Return: None
*/
static void cds_set_ol_rx_thread_scheduler(p_cds_sched_context psched_context)
{
struct sched_param param;
if (!psched_context) {
cds_err("Null params being passed");
return;
}
if (!psched_context->ol_rx_thread) {
cds_alert("CDS OL RX Thread is NULL");
return;
}
param.sched_priority = 99;
sched_setscheduler(psched_context->ol_rx_thread, SCHED_RR, &param);
}
#else
static void cds_set_ol_rx_thread_scheduler(p_cds_sched_context psched_context)
{
}
#endif /* RX_PERFORMANCE */
#endif /* QCA_CONFIG_SMP */
/**
@ -410,12 +439,6 @@ QDF_STATUS cds_sched_open(void *p_cds_context,
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)) {
@ -462,9 +485,7 @@ QDF_STATUS cds_sched_open(void *p_cds_context,
goto OL_RX_THREAD_START_FAILURE;
}
#ifdef THREAD_PERFORMANCE
sched_setscheduler(pSchedContext->ol_rx_thread, SCHED_RR, &param);
#endif
cds_set_ol_rx_thread_scheduler(pSchedContext);
wake_up_process(pSchedContext->ol_rx_thread);
cds_debug("CDS OL RX thread Created");
wait_for_completion_interruptible(&pSchedContext->ol_rx_start_event);

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
@ -642,6 +642,16 @@
*
* </ini>
*/
#ifdef RX_PERFORMANCE
#define CFG_DP_RX_THREAD_CPU_MASK \
CFG_INI_UINT( \
"RX_THREAD_CPU_AFFINITY_MASK", \
0, \
0xFF, \
0x02, \
CFG_VALUE_OR_DEFAULT, \
"CPU mask to affine Rx_thread")
#else
#define CFG_DP_RX_THREAD_CPU_MASK \
CFG_INI_UINT( \
"RX_THREAD_CPU_AFFINITY_MASK", \
@ -650,6 +660,7 @@
0, \
CFG_VALUE_OR_DEFAULT, \
"CPU mask to affine Rx_thread")
#endif
/*
* <ini>

View file

@ -287,9 +287,14 @@ void wlan_hdd_classify_pkt(struct sk_buff *skb);
#ifdef MSM_PLATFORM
void hdd_reset_tcp_delack(struct hdd_context *hdd_ctx);
bool hdd_is_current_high_throughput(struct hdd_context *hdd_ctx);
#define HDD_MSM_CFG(msm_cfg) msm_cfg
#else
static inline void hdd_reset_tcp_delack(struct hdd_context *hdd_ctx) {}
static inline bool hdd_is_current_high_throughput(struct hdd_context *hdd_ctx)
{
return false;
}
#define HDD_MSM_CFG(msm_cfg) 0
#endif

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_is_current_high_throughput(hdd_ctx))
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_is_current_high_throughput(hdd_ctx) &&
hdd_ctx->config->rx_wakelock_timeout &&
sta_ctx->conn_info.uIsAuthenticated)
wake_lock = hdd_is_rx_wake_lock_needed(skb);
if (wake_lock) {
@ -2769,6 +2771,22 @@ void hdd_reset_tcp_delack(struct hdd_context *hdd_ctx)
hdd_ctx->rx_high_ind_cnt = 0;
wlan_hdd_update_tcp_rx_param(hdd_ctx, &rx_tp_data);
}
/**
* hdd_is_current_high_throughput() - Check if vote level is high
* @hdd_ctx: Handle to hdd context
*
* Function used to check if vote level is high
*
* Return: True if vote level is high
*/
bool hdd_is_current_high_throughput(struct hdd_context *hdd_ctx)
{
if (hdd_ctx->cur_vote_level < PLD_BUS_WIDTH_HIGH)
return false;
else
return true;
}
#endif /* MSM_PLATFORM */
#ifdef QCA_LL_LEGACY_TX_FLOW_CONTROL