From 8b371301f4573a089310cc5e04fbe62bc146d626 Mon Sep 17 00:00:00 2001 From: Yu Tian Date: Thu, 18 Jun 2020 11:11:46 +0800 Subject: [PATCH] qcacld-3.0: refine pktlog enable logic in KPI test PKTLOG can be enabled from both 802.11 and WEXT, customer integrates pktlog ctrl in script and is toggled frequently. This leads host pktlog status variable and FW status out of sync. Host bus vote logic need disable pktlog when TPUT is high, based on host status. At last, it will not take effect, KPI continues dropped by PKTLOG. Change-Id: Ifad7b53060b6046361621bf927c99b6b66e0c278 CRs-Fixed: 2715362 --- core/hdd/src/wlan_hdd_cfg80211.c | 24 ++++++++++++++---------- core/hdd/src/wlan_hdd_main.c | 19 +++++++++++-------- 2 files changed, 25 insertions(+), 18 deletions(-) diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 490b19edfe..14a0037ba1 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -10064,13 +10064,15 @@ static int __wlan_hdd_cfg80211_wifi_logger_start(struct wiphy *wiphy, return 0; } - if (hdd_ctx->is_pktlog_enabled && - (start_log.verbose_level == WLAN_LOG_LEVEL_ACTIVE)) - return 0; + if (start_log.ring_id == RING_ID_PER_PACKET_STATS) { + if (hdd_ctx->is_pktlog_enabled && + (start_log.verbose_level == WLAN_LOG_LEVEL_ACTIVE)) + return 0; - if ((!hdd_ctx->is_pktlog_enabled) && - (start_log.verbose_level != WLAN_LOG_LEVEL_ACTIVE)) - return 0; + if ((!hdd_ctx->is_pktlog_enabled) && + (start_log.verbose_level != WLAN_LOG_LEVEL_ACTIVE)) + return 0; + } mac_handle = hdd_ctx->mac_handle; status = sme_wifi_start_logger(mac_handle, start_log); @@ -10080,10 +10082,12 @@ static int __wlan_hdd_cfg80211_wifi_logger_start(struct wiphy *wiphy, return -EINVAL; } - if (start_log.verbose_level != WLAN_LOG_LEVEL_ACTIVE) - hdd_ctx->is_pktlog_enabled = true; - else - hdd_ctx->is_pktlog_enabled = false; + if (start_log.ring_id == RING_ID_PER_PACKET_STATS) { + if (start_log.verbose_level == WLAN_LOG_LEVEL_ACTIVE) + hdd_ctx->is_pktlog_enabled = true; + else + hdd_ctx->is_pktlog_enabled = false; + } return 0; } diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index a26cfe9635..e6d758c4ba 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -9136,6 +9136,7 @@ static void hdd_pld_request_bus_bandwidth(struct hdd_context *hdd_ctx, if (hdd_ctx->cur_vote_level != next_vote_level) { hdd_debug("BW Vote level %d, tx_packets: %lld, rx_packets: %lld", next_vote_level, tx_packets, rx_packets); + hdd_ctx->cur_vote_level = next_vote_level; vote_level_change = true; @@ -9194,14 +9195,16 @@ static void hdd_pld_request_bus_bandwidth(struct hdd_context *hdd_ctx, else hdd_disable_rx_ol_for_low_tput(hdd_ctx, false); - if (hdd_ctx->is_pktlog_enabled) { - if (next_vote_level >= PLD_BUS_WIDTH_HIGH) - hdd_pktlog_enable_disable(hdd_ctx, false, - 0, 0); - else - hdd_pktlog_enable_disable(hdd_ctx, true, - 0, 0); - } + /* + * force disable pktlog and only re-enable based + * on ini config + */ + if (next_vote_level >= PLD_BUS_WIDTH_HIGH) + hdd_pktlog_enable_disable(hdd_ctx, false, + 0, 0); + else if (cds_is_packet_log_enabled()) + hdd_pktlog_enable_disable(hdd_ctx, true, + 0, 0); } qdf_dp_trace_apply_tput_policy(dptrace_high_tput_req);