qcacld-3.0: Set RPS CPU mask when t-put is high

The default value of /sys/class/net/xx/queues/rx-x/rps_cpus is 0,
It means that the RX thread and soft IRQ will run on same core.
In 8996AU, the t-put will be impacted by the default value 0 both
in LTE and WLAN interface. Add support to set WLAN RPS CPU mask when
there is high t-put requirement of WLAN to improve the performance.

Change-Id: I10127a763b768a29b25041070f3ea7b3f6769289
CRs-Fixed: 2195721
This commit is contained in:
Tang Yingying 2018-03-30 15:58:27 +08:00 • committed by nshrivas
commit 5a4ccf208e
5 changed files with 35 additions and 8 deletions

View file

@ -47,6 +47,7 @@ struct hdd_context;
#define CFG_ENABLE_RX_THREAD (1 << 0)
#define CFG_ENABLE_RPS (1 << 1)
#define CFG_ENABLE_NAPI (1 << 2)
#define CFG_ENABLE_DYNAMIC_RPS (1 << 3)
#ifdef DHCP_SERVER_OFFLOAD
#define IPADDR_NUM_ENTRIES (4)
@ -9959,7 +9960,8 @@ enum dot11p_mode {
* rx_mode - Control to decide rx mode
*
* @Min: 0
* @Max: (CFG_ENABLE_RX_THREAD | CFG_ENABLE_RPS | CFG_ENABLE_NAPI)
* @Max: (CFG_ENABLE_RX_THREAD | CFG_ENABLE_RPS | CFG_ENABLE_NAPI | \
* CFG_ENABLE_DYNAMIC_RPS)
* @Default: MDM_PLATFORM - 0
* HELIUMPLUS - CFG_ENABLE_NAPI
* Other cases - (CFG_ENABLE_RX_THREAD | CFG_ENABLE_NAPI)
@ -9975,7 +9977,7 @@ enum dot11p_mode {
#define CFG_RX_MODE_NAME "rx_mode"
#define CFG_RX_MODE_MIN (0)
#define CFG_RX_MODE_MAX (CFG_ENABLE_RX_THREAD | CFG_ENABLE_RPS | \
CFG_ENABLE_NAPI)
CFG_ENABLE_NAPI | CFG_ENABLE_DYNAMIC_RPS)
#ifdef MDM_PLATFORM
#define CFG_RX_MODE_DEFAULT (0)
#elif defined(HELIUMPLUS)

View file

@ -1842,6 +1842,7 @@ struct hdd_context {
/* Interface change lock */
struct mutex iface_change_lock;
bool rps;
bool dynamic_rps;
bool enable_rxthread;
bool napi_enable;
bool stop_modules_in_progress;

View file

@ -7500,6 +7500,11 @@ static void hdd_override_all_ps(struct hdd_context *hdd_ctx)
*/
static void hdd_set_rx_mode_value(struct hdd_context *hdd_ctx)
{
/* RPS has higher priority than dynamic RPS when both bits are set */
if (hdd_ctx->config->rx_mode & CFG_ENABLE_RPS &&
hdd_ctx->config->rx_mode & CFG_ENABLE_DYNAMIC_RPS)
hdd_ctx->config->rx_mode &= ~CFG_ENABLE_DYNAMIC_RPS;
if (hdd_ctx->config->rx_mode & CFG_ENABLE_RX_THREAD &&
hdd_ctx->config->rx_mode & CFG_ENABLE_RPS) {
hdd_warn("rx_mode wrong configuration. Make it default");
@ -7514,6 +7519,9 @@ static void hdd_set_rx_mode_value(struct hdd_context *hdd_ctx)
if (hdd_ctx->config->rx_mode & CFG_ENABLE_NAPI)
hdd_ctx->napi_enable = true;
if (hdd_ctx->config->rx_mode & CFG_ENABLE_DYNAMIC_RPS)
hdd_ctx->dynamic_rps = true;
}
/**

View file

@ -7043,6 +7043,20 @@ void hdd_display_periodic_stats(struct hdd_context *hdd_ctx,
}
}
/**
* hdd_clear_rps_cpu_mask - clear RPS CPU mask for interfaces
* @hdd_ctx: pointer to struct hdd_context
*
* Return: none
*/
static void hdd_clear_rps_cpu_mask(struct hdd_context *hdd_ctx)
{
struct hdd_adapter *adapter;
hdd_for_each_adapter(hdd_ctx, adapter)
hdd_send_rps_disable_ind(adapter);
}
/**
* hdd_pld_request_bus_bandwidth() - Function to control bus bandwidth
* @hdd_ctx - handle to hdd context
@ -7086,13 +7100,17 @@ static void hdd_pld_request_bus_bandwidth(struct hdd_context *hdd_ctx,
hdd_ctx->cur_vote_level = next_vote_level;
vote_level_change = true;
pld_request_bus_bandwidth(hdd_ctx->parent_dev, next_vote_level);
if (next_vote_level == PLD_BUS_WIDTH_LOW) {
if ((next_vote_level == PLD_BUS_WIDTH_LOW) ||
(next_vote_level == PLD_BUS_WIDTH_NONE)) {
if (hdd_ctx->hbw_requested) {
pld_remove_pm_qos(hdd_ctx->parent_dev);
hdd_ctx->hbw_requested = false;
}
if (cds_sched_handle_throughput_req(false))
hdd_warn("low bandwidth set rx affinity fail");
if (hdd_ctx->dynamic_rps)
hdd_clear_rps_cpu_mask(hdd_ctx);
} else {
if (!hdd_ctx->hbw_requested) {
pld_request_pm_qos(hdd_ctx->parent_dev, 1);
@ -7101,6 +7119,9 @@ static void hdd_pld_request_bus_bandwidth(struct hdd_context *hdd_ctx,
if (cds_sched_handle_throughput_req(true))
hdd_warn("high bandwidth set rx affinity fail");
if (hdd_ctx->dynamic_rps)
hdd_set_rps_cpu_mask(hdd_ctx);
}
hdd_napi_apply_throughput_policy(hdd_ctx, tx_packets, rx_packets);
}

View file

@ -2464,7 +2464,6 @@ err:
*/
void hdd_send_rps_disable_ind(struct hdd_adapter *adapter)
{
uint8_t cpu_map_list_len = 0;
struct hdd_context *hdd_ctxt = NULL;
struct wlan_rps_data rps_data;
struct cds_config_info *cds_cfg;
@ -2487,10 +2486,6 @@ void hdd_send_rps_disable_ind(struct hdd_adapter *adapter)
hdd_info("Set cpu_map_list 0");
qdf_mem_zero(&rps_data.cpu_map_list, sizeof(rps_data.cpu_map_list));
cpu_map_list_len = 0;
rps_data.num_queues =
(cpu_map_list_len < rps_data.num_queues) ?
cpu_map_list_len : rps_data.num_queues;
strlcpy(rps_data.ifname, adapter->dev->name, sizeof(rps_data.ifname));
wlan_hdd_send_svc_nlink_msg(hdd_ctxt->radio_index,