From 24aa27ea0651674075c2adaff37cf5dd16cb4b67 Mon Sep 17 00:00:00 2001 From: Himanshu Agarwal Date: Tue, 23 May 2017 11:07:50 +0530 Subject: [PATCH] qcacld-3.0: Add ini support to change ce service max yield time Add ini support to change ce service max yield time, so that we can tune the napi SWI context of execution based on the system needs and add a variable in napi stats to record max time taken in NAPI poll. Change-Id: Id2b47bcecb777b98e0b1192135ae140b681d387d CRs-Fixed: 2055074 --- core/hdd/inc/wlan_hdd_cfg.h | 22 ++++++++++++++++++++++ core/hdd/src/wlan_hdd_cfg.c | 10 ++++++++++ core/hdd/src/wlan_hdd_driver_ops.c | 2 ++ core/hdd/src/wlan_hdd_napi.c | 5 +++-- 4 files changed, 37 insertions(+), 2 deletions(-) diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h index 0d93fb6522ef..f195519b337a 100644 --- a/core/hdd/inc/wlan_hdd_cfg.h +++ b/core/hdd/inc/wlan_hdd_cfg.h @@ -9963,6 +9963,27 @@ enum dot11p_mode { #define CFG_RX_MODE_DEFAULT (CFG_ENABLE_RX_THREAD | CFG_ENABLE_NAPI) #endif +/* + * + * ce_service_max_yield_time - Control to set ce service max yield time (in ms) + * + * @Min: 1 + * @Max: 10 + * @Default: 10 + * + * This ini is used to set ce service max yield time (in ms) + * + * Supported Feature: NAPI + * + * Usage: Internal + * + * + */ +#define CFG_CE_SERVICE_MAX_YIELD_TIME_NAME "ce_service_max_yield_time" +#define CFG_CE_SERVICE_MAX_YIELD_TIME_MIN (1) +#define CFG_CE_SERVICE_MAX_YIELD_TIME_MAX (10) +#define CFG_CE_SERVICE_MAX_YIELD_TIME_DEFAULT (10) + /* List of RPS CPU maps for different rx queues registered by WLAN driver * Ref - Kernel/Documentation/networking/scaling.txt * RPS CPU map for a particular RX queue, selects CPU(s) for bottom half @@ -14788,6 +14809,7 @@ struct hdd_config { #endif uint8_t dot11p_mode; uint8_t rx_mode; + uint8_t ce_service_max_yield_time; uint8_t cpu_map_list[CFG_RPS_RX_QUEUE_CPU_MAP_LIST_LEN]; #ifdef FEATURE_WLAN_EXTSCAN bool extscan_enabled; diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c index 3054cf92caf6..1146e24b712c 100644 --- a/core/hdd/src/wlan_hdd_cfg.c +++ b/core/hdd/src/wlan_hdd_cfg.c @@ -4144,6 +4144,13 @@ struct reg_table_entry g_registry_table[] = { CFG_RX_MODE_MIN, CFG_RX_MODE_MAX), + REG_VARIABLE(CFG_CE_SERVICE_MAX_YIELD_TIME_NAME, WLAN_PARAM_Integer, + struct hdd_config, ce_service_max_yield_time, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_CE_SERVICE_MAX_YIELD_TIME_DEFAULT, + CFG_CE_SERVICE_MAX_YIELD_TIME_MIN, + CFG_CE_SERVICE_MAX_YIELD_TIME_MAX), + REG_VARIABLE_STRING(CFG_RPS_RX_QUEUE_CPU_MAP_LIST_NAME, WLAN_PARAM_String, struct hdd_config, cpu_map_list, @@ -6848,6 +6855,9 @@ void hdd_cfg_print(struct hdd_context *hdd_ctx) hdd_ctx->config->max_scan_count); hdd_debug("Name = [%s] value = [%d]", CFG_RX_MODE_NAME, hdd_ctx->config->rx_mode); + hdd_debug("Name = [%s] value = [%d]", + CFG_CE_SERVICE_MAX_YIELD_TIME_NAME, + hdd_ctx->config->ce_service_max_yield_time); hdd_debug("Name = [%s] Value = [%u]", CFG_CE_CLASSIFY_ENABLE_NAME, hdd_ctx->config->ce_classify_enabled); diff --git a/core/hdd/src/wlan_hdd_driver_ops.c b/core/hdd/src/wlan_hdd_driver_ops.c index 4b17b087383a..9c1bfaea6a46 100644 --- a/core/hdd/src/wlan_hdd_driver_ops.c +++ b/core/hdd/src/wlan_hdd_driver_ops.c @@ -260,6 +260,8 @@ int hdd_hif_open(struct device *dev, void *bdev, const struct hif_bus_id *bid, } } + hif_set_ce_service_max_yield_time(hif_ctx, + hdd_ctx->config->ce_service_max_yield_time); pmo_ucfg_psoc_set_hif_handle(hdd_ctx->hdd_psoc, hif_ctx); return 0; diff --git a/core/hdd/src/wlan_hdd_napi.c b/core/hdd/src/wlan_hdd_napi.c index 3fb6c54e05a3..a8d6bc84713b 100644 --- a/core/hdd/src/wlan_hdd_napi.c +++ b/core/hdd/src/wlan_hdd_napi.c @@ -473,7 +473,7 @@ int hdd_display_napi_stats(void) hdd_err("%s unable to retrieve napi structure", __func__); return -EFAULT; } - hdd_debug("[NAPI %u][BL %d]: scheds polls comps done t-lim p-lim corr napi-buckets(%d)", + hdd_debug("[NAPI %u][BL %d]: scheds polls comps done t-lim p-lim corr max_time napi-buckets(%d)", napid->napi_mode, hif_napi_cpu_blacklist(napid, BLACKLIST_QUERY), QCA_NAPI_NUM_BUCKETS); @@ -496,7 +496,7 @@ int hdd_display_napi_stats(void) } if (napis->napi_schedules != 0) - hdd_debug("NAPI[%2d]CPU[%d]: %7d %7d %7d %7d %5d %5d %5d %s", + hdd_debug("NAPI[%2d]CPU[%d]: %7d %7d %7d %7d %5d %5d %5d %9llu %s", i, j, napis->napi_schedules, napis->napi_polls, @@ -505,6 +505,7 @@ int hdd_display_napi_stats(void) napis->time_limit_reached, napis->rxpkt_thresh_reached, napis->cpu_corrected, + napis->napi_max_poll_time, buf); } }