From ab131773f7d44b7dcaa1d52f8a1bb265ffa61a26 Mon Sep 17 00:00:00 2001 From: Yun Park Date: Tue, 26 Sep 2017 16:39:17 -0700 Subject: [PATCH] qcacmn: Enable RPS dynamically for SAP mode SAP Rx TPUT is bounded by host network stack, which is running in the context of IPA work-queue, when IPA offload data path enabled. However RPS shouldn't enabled for legacy Rx data path, where NAPI is enabled. So, we dynamically enable RPS for SAP interface when the vdev comes up and IPA was enabled only. Send RPS enable indication to CNSS daemon to enable RPS only when SAP interface comes up and disable RPS when SAP interface is closed. Change-Id: Ia669b2c3ae814d0577f5226d8acbf026740ad760 CRs-Fixed: 2129520 --- inc/wlan_policy_mgr_api.h | 2 ++ src/wlan_policy_mgr_get_set_utils.c | 14 ++++++++++++++ src/wlan_policy_mgr_init_deinit.c | 2 ++ 3 files changed, 18 insertions(+) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index 7f8fcfd34b80..580c94fff49c 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -816,9 +816,11 @@ struct policy_mgr_cdp_cbacks { * struct policy_mgr_dp_cbacks - CDP Callbacks to be invoked * from policy manager * @hdd_disable_lro_in_concurrency: Callback to disable LRO + * @hdd_set_rx_mode_rps_cb: Callback to set RPS */ struct policy_mgr_dp_cbacks { void (*hdd_disable_lro_in_concurrency)(bool); + void (*hdd_set_rx_mode_rps_cb)(bool); }; /** diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index 4d970b5b7703..42195ab01b87 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -1168,6 +1168,13 @@ void policy_mgr_incr_active_session(struct wlan_objmgr_psoc *psoc, pm_ctx->dp_cbacks.hdd_disable_lro_in_concurrency(true); }; + /* Enable RPS if SAP interface has come up */ + if (policy_mgr_mode_specific_connection_count(psoc, PM_SAP_MODE, NULL) + == 1) { + if (pm_ctx->dp_cbacks.hdd_set_rx_mode_rps_cb != NULL) + pm_ctx->dp_cbacks.hdd_set_rx_mode_rps_cb(true); + } + policy_mgr_dump_current_concurrency(psoc); qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); @@ -1228,6 +1235,13 @@ QDF_STATUS policy_mgr_decr_active_session(struct wlan_objmgr_psoc *psoc, pm_ctx->dp_cbacks.hdd_disable_lro_in_concurrency(false); }; + /* Disable RPS if SAP interface has come up */ + if (policy_mgr_mode_specific_connection_count(psoc, PM_SAP_MODE, NULL) + == 0) { + if (pm_ctx->dp_cbacks.hdd_set_rx_mode_rps_cb != NULL) + pm_ctx->dp_cbacks.hdd_set_rx_mode_rps_cb(false); + } + policy_mgr_dump_current_concurrency(psoc); return qdf_status; diff --git a/src/wlan_policy_mgr_init_deinit.c b/src/wlan_policy_mgr_init_deinit.c index d556c3ed9aeb..08513de35abd 100644 --- a/src/wlan_policy_mgr_init_deinit.c +++ b/src/wlan_policy_mgr_init_deinit.c @@ -632,6 +632,8 @@ QDF_STATUS policy_mgr_register_dp_cb(struct wlan_objmgr_psoc *psoc, pm_ctx->dp_cbacks.hdd_disable_lro_in_concurrency = dp_cbacks->hdd_disable_lro_in_concurrency; + pm_ctx->dp_cbacks.hdd_set_rx_mode_rps_cb = + dp_cbacks->hdd_set_rx_mode_rps_cb; return QDF_STATUS_SUCCESS; }