diff --git a/Kbuild b/Kbuild index a2a5e909182b..20acd16a24e3 100644 --- a/Kbuild +++ b/Kbuild @@ -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 diff --git a/configs/default_defconfig b/configs/default_defconfig index 6ed4e9e8bde2..423aa6488303 100644 --- a/configs/default_defconfig +++ b/configs/default_defconfig @@ -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) diff --git a/core/cds/src/cds_sched.c b/core/cds/src/cds_sched.c index 808ae4260016..86c5675899c7 100644 --- a/core/cds/src/cds_sched.c +++ b/core/cds/src/cds_sched.c @@ -35,7 +35,7 @@ #include #include #include -#ifdef THREAD_PERFORMANCE +#ifdef RX_PERFORMANCE #include #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, ¶m); +} +#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, ¶m); -#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); diff --git a/core/hdd/inc/hdd_dp_cfg.h b/core/hdd/inc/hdd_dp_cfg.h index f0bd14b46c82..1dbd7b7139e4 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 @@ -642,6 +642,16 @@ * * */ +#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 /* * diff --git a/core/hdd/inc/wlan_hdd_tx_rx.h b/core/hdd/inc/wlan_hdd_tx_rx.h index 691a8452a80c..b2ca501d431d 100644 --- a/core/hdd/inc/wlan_hdd_tx_rx.h +++ b/core/hdd/inc/wlan_hdd_tx_rx.h @@ -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 diff --git a/core/hdd/src/wlan_hdd_tx_rx.c b/core/hdd/src/wlan_hdd_tx_rx.c index c948ab6fce55..60227cb7862f 100644 --- a/core/hdd/src/wlan_hdd_tx_rx.c +++ b/core/hdd/src/wlan_hdd_tx_rx.c @@ -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