qcacld-3.0: Move rx_thread to perf core for udp
rx_thread can sustain the TCP DL KPIs with silver core. So let system decide scheduling of rx_thread for TCP. Move rx_thread to perf cluster only for UDP traffic exceeding the threshold. This is achieved by having monitoring non rx_offload traffic. This takes care of platform(such as ROME) which doesnot support rx_offload and also cases when we don't support rx_offload(SAP, concurrency etc..) This rx_thread affinity can be overridden by INI configured rx_thread CPU mask. Change-Id: I0e47221a2491c67c8da4b331756a3b5a18a82e37 CRs-Fixed: 2185186
This commit is contained in:

committed by
nshrivas

parent
b6b4ff1809
commit
3a21bea166
@@ -9987,7 +9987,7 @@ enum dot11p_mode {
|
|||||||
*
|
*
|
||||||
* </ini>
|
* </ini>
|
||||||
*/
|
*/
|
||||||
#define CFG_RX_THREAD_CPU_MASK_NAME "NAPI_CPU_AFFINITY_MASK"
|
#define CFG_RX_THREAD_CPU_MASK_NAME "RX_THREAD_CPU_AFFINITY_MASK"
|
||||||
#define CFG_RX_THREAD_CPU_MASK_MIN (0)
|
#define CFG_RX_THREAD_CPU_MASK_MIN (0)
|
||||||
#define CFG_RX_THREAD_CPU_MASK_MAX (0xFF)
|
#define CFG_RX_THREAD_CPU_MASK_MAX (0xFF)
|
||||||
#define CFG_RX_THREAD_CPU_MASK_DEFAULT (0)
|
#define CFG_RX_THREAD_CPU_MASK_DEFAULT (0)
|
||||||
|
@@ -1712,7 +1712,8 @@ struct hdd_context {
|
|||||||
int cur_vote_level;
|
int cur_vote_level;
|
||||||
spinlock_t bus_bw_lock;
|
spinlock_t bus_bw_lock;
|
||||||
int cur_rx_level;
|
int cur_rx_level;
|
||||||
uint64_t prev_rx;
|
uint64_t prev_no_rx_offload_pkts;
|
||||||
|
uint64_t prev_rx_offload_pkts;
|
||||||
int cur_tx_level;
|
int cur_tx_level;
|
||||||
uint64_t prev_tx;
|
uint64_t prev_tx;
|
||||||
#endif
|
#endif
|
||||||
@@ -1815,6 +1816,8 @@ struct hdd_context {
|
|||||||
*/
|
*/
|
||||||
uint32_t fine_time_meas_cap_target;
|
uint32_t fine_time_meas_cap_target;
|
||||||
uint32_t rx_high_ind_cnt;
|
uint32_t rx_high_ind_cnt;
|
||||||
|
/* For Rx thread non GRO/LRO packet accounting */
|
||||||
|
uint64_t no_rx_offload_pkt_cnt;
|
||||||
/* completion variable to indicate set antenna mode complete*/
|
/* completion variable to indicate set antenna mode complete*/
|
||||||
struct completion set_antenna_mode_cmpl;
|
struct completion set_antenna_mode_cmpl;
|
||||||
/* Current number of TX X RX chains being used */
|
/* Current number of TX X RX chains being used */
|
||||||
|
@@ -7264,8 +7264,9 @@ static void hdd_pld_request_bus_bandwidth(struct hdd_context *hdd_ctx,
|
|||||||
const uint64_t rx_packets)
|
const uint64_t rx_packets)
|
||||||
{
|
{
|
||||||
u64 total_pkts = tx_packets + rx_packets;
|
u64 total_pkts = tx_packets + rx_packets;
|
||||||
uint64_t temp_rx = 0;
|
uint64_t temp_tx = 0, avg_rx = 0;
|
||||||
uint64_t temp_tx = 0;
|
uint64_t no_rx_offload_pkts = 0, avg_no_rx_offload_pkts = 0;
|
||||||
|
uint64_t rx_offload_pkts = 0, avg_rx_offload_pkts = 0;
|
||||||
enum pld_bus_width_type next_vote_level = PLD_BUS_WIDTH_NONE;
|
enum pld_bus_width_type next_vote_level = PLD_BUS_WIDTH_NONE;
|
||||||
static enum wlan_tp_level next_rx_level = WLAN_SVC_TP_NONE;
|
static enum wlan_tp_level next_rx_level = WLAN_SVC_TP_NONE;
|
||||||
enum wlan_tp_level next_tx_level = WLAN_SVC_TP_NONE;
|
enum wlan_tp_level next_tx_level = WLAN_SVC_TP_NONE;
|
||||||
@@ -7274,6 +7275,7 @@ static void hdd_pld_request_bus_bandwidth(struct hdd_context *hdd_ctx,
|
|||||||
bool vote_level_change = false;
|
bool vote_level_change = false;
|
||||||
bool rx_level_change = false;
|
bool rx_level_change = false;
|
||||||
bool tx_level_change = false;
|
bool tx_level_change = false;
|
||||||
|
bool rxthread_high_tput_req = false;
|
||||||
|
|
||||||
if (total_pkts > hdd_ctx->config->busBandwidthHighThreshold)
|
if (total_pkts > hdd_ctx->config->busBandwidthHighThreshold)
|
||||||
next_vote_level = PLD_BUS_WIDTH_HIGH;
|
next_vote_level = PLD_BUS_WIDTH_HIGH;
|
||||||
@@ -7296,9 +7298,6 @@ static void hdd_pld_request_bus_bandwidth(struct hdd_context *hdd_ctx,
|
|||||||
pld_remove_pm_qos(hdd_ctx->parent_dev);
|
pld_remove_pm_qos(hdd_ctx->parent_dev);
|
||||||
hdd_ctx->hbw_requested = false;
|
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)
|
if (hdd_ctx->dynamic_rps)
|
||||||
hdd_clear_rps_cpu_mask(hdd_ctx);
|
hdd_clear_rps_cpu_mask(hdd_ctx);
|
||||||
} else {
|
} else {
|
||||||
@@ -7306,33 +7305,60 @@ static void hdd_pld_request_bus_bandwidth(struct hdd_context *hdd_ctx,
|
|||||||
pld_request_pm_qos(hdd_ctx->parent_dev, 1);
|
pld_request_pm_qos(hdd_ctx->parent_dev, 1);
|
||||||
hdd_ctx->hbw_requested = true;
|
hdd_ctx->hbw_requested = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cds_sched_handle_throughput_req(true))
|
|
||||||
hdd_warn("high bandwidth set rx affinity fail");
|
|
||||||
|
|
||||||
if (hdd_ctx->dynamic_rps)
|
if (hdd_ctx->dynamic_rps)
|
||||||
hdd_set_rps_cpu_mask(hdd_ctx);
|
hdd_set_rps_cpu_mask(hdd_ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hdd_ctx->config->napi_cpu_affinity_mask)
|
if (hdd_ctx->config->napi_cpu_affinity_mask)
|
||||||
hdd_napi_apply_throughput_policy(hdd_ctx,
|
hdd_napi_apply_throughput_policy(hdd_ctx,
|
||||||
tx_packets,
|
tx_packets,
|
||||||
rx_packets);
|
rx_packets);
|
||||||
|
|
||||||
|
if (rx_packets < hdd_ctx->config->busBandwidthLowThreshold)
|
||||||
|
hdd_disable_rx_ol_for_low_tput(hdd_ctx, true);
|
||||||
|
else
|
||||||
|
hdd_disable_rx_ol_for_low_tput(hdd_ctx, false);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
qdf_dp_trace_throttle_live_mode(
|
qdf_dp_trace_throttle_live_mode(
|
||||||
(next_vote_level > PLD_BUS_WIDTH_NONE) ? true : false);
|
(next_vote_level > PLD_BUS_WIDTH_NONE) ? true : false);
|
||||||
|
|
||||||
/* fine-tuning parameters for RX Flows */
|
/*
|
||||||
temp_rx = (rx_packets + hdd_ctx->prev_rx) / 2;
|
* Includes tcp+udp, if perf core is required for tcp, then
|
||||||
|
* perf core is also required for udp.
|
||||||
|
*/
|
||||||
|
no_rx_offload_pkts = hdd_ctx->no_rx_offload_pkt_cnt;
|
||||||
|
hdd_ctx->no_rx_offload_pkt_cnt = 0;
|
||||||
|
rx_offload_pkts = rx_packets - no_rx_offload_pkts;
|
||||||
|
|
||||||
hdd_ctx->prev_rx = rx_packets;
|
avg_no_rx_offload_pkts = (no_rx_offload_pkts +
|
||||||
|
hdd_ctx->prev_no_rx_offload_pkts) / 2;
|
||||||
|
hdd_ctx->prev_no_rx_offload_pkts = no_rx_offload_pkts;
|
||||||
|
|
||||||
if (temp_rx < hdd_ctx->config->busBandwidthLowThreshold)
|
avg_rx_offload_pkts = (rx_offload_pkts +
|
||||||
hdd_disable_rx_ol_for_low_tput(hdd_ctx, true);
|
hdd_ctx->prev_rx_offload_pkts) / 2;
|
||||||
|
hdd_ctx->prev_rx_offload_pkts = rx_offload_pkts;
|
||||||
|
|
||||||
|
avg_rx = avg_no_rx_offload_pkts + avg_rx_offload_pkts;
|
||||||
|
/*
|
||||||
|
* Takes care to set Rx_thread affinity for below case
|
||||||
|
* 1)LRO/GRO not supported ROME case
|
||||||
|
* 2)when rx_ol is disabled in cases like concurrency etc
|
||||||
|
* 3)For UDP cases
|
||||||
|
*/
|
||||||
|
if (avg_no_rx_offload_pkts >
|
||||||
|
hdd_ctx->config->busBandwidthHighThreshold)
|
||||||
|
rxthread_high_tput_req = true;
|
||||||
else
|
else
|
||||||
hdd_disable_rx_ol_for_low_tput(hdd_ctx, false);
|
rxthread_high_tput_req = false;
|
||||||
|
|
||||||
if (temp_rx > hdd_ctx->config->tcpDelackThresholdHigh) {
|
if (cds_sched_handle_throughput_req(rxthread_high_tput_req))
|
||||||
|
hdd_warn("Rx thread high_tput(%d) affinity request failed",
|
||||||
|
rxthread_high_tput_req);
|
||||||
|
|
||||||
|
/* fine-tuning parameters for RX Flows */
|
||||||
|
if (avg_rx > hdd_ctx->config->tcpDelackThresholdHigh) {
|
||||||
if ((hdd_ctx->cur_rx_level != WLAN_SVC_TP_HIGH) &&
|
if ((hdd_ctx->cur_rx_level != WLAN_SVC_TP_HIGH) &&
|
||||||
(++hdd_ctx->rx_high_ind_cnt == delack_timer_cnt)) {
|
(++hdd_ctx->rx_high_ind_cnt == delack_timer_cnt)) {
|
||||||
next_rx_level = WLAN_SVC_TP_HIGH;
|
next_rx_level = WLAN_SVC_TP_HIGH;
|
||||||
@@ -7346,7 +7372,7 @@ static void hdd_pld_request_bus_bandwidth(struct hdd_context *hdd_ctx,
|
|||||||
struct wlan_rx_tp_data rx_tp_data = {0};
|
struct wlan_rx_tp_data rx_tp_data = {0};
|
||||||
|
|
||||||
hdd_debug("TCP DELACK trigger level %d, average_rx: %llu",
|
hdd_debug("TCP DELACK trigger level %d, average_rx: %llu",
|
||||||
next_rx_level, temp_rx);
|
next_rx_level, avg_rx);
|
||||||
hdd_ctx->cur_rx_level = next_rx_level;
|
hdd_ctx->cur_rx_level = next_rx_level;
|
||||||
rx_level_change = true;
|
rx_level_change = true;
|
||||||
/* Send throughput indication only if it is enabled.
|
/* Send throughput indication only if it is enabled.
|
||||||
|
@@ -999,6 +999,9 @@ QDF_STATUS hdd_softap_rx_packet_cbk(void *context, qdf_nbuf_t rxBuf)
|
|||||||
rxstat = netif_receive_skb(skb);
|
rxstat = netif_receive_skb(skb);
|
||||||
else
|
else
|
||||||
rxstat = netif_rx_ni(skb);
|
rxstat = netif_rx_ni(skb);
|
||||||
|
|
||||||
|
hdd_ctx->no_rx_offload_pkt_cnt++;
|
||||||
|
|
||||||
if (NET_RX_SUCCESS == rxstat)
|
if (NET_RX_SUCCESS == rxstat)
|
||||||
++adapter->hdd_stats.tx_rx_stats.rx_delivered[cpu_index];
|
++adapter->hdd_stats.tx_rx_stats.rx_delivered[cpu_index];
|
||||||
else
|
else
|
||||||
|
@@ -1987,6 +1987,8 @@ QDF_STATUS hdd_rx_packet_cbk(void *context, qdf_nbuf_t rxBuf)
|
|||||||
|
|
||||||
if (rx_ol_status != QDF_STATUS_SUCCESS) {
|
if (rx_ol_status != QDF_STATUS_SUCCESS) {
|
||||||
/* we should optimize this per packet check, unlikely */
|
/* we should optimize this per packet check, unlikely */
|
||||||
|
/* Account for GRO/LRO ineligible packets, mostly UDP */
|
||||||
|
hdd_ctx->no_rx_offload_pkt_cnt++;
|
||||||
if (hdd_napi_enabled(HDD_NAPI_ANY) &&
|
if (hdd_napi_enabled(HDD_NAPI_ANY) &&
|
||||||
!hdd_ctx->enable_rxthread &&
|
!hdd_ctx->enable_rxthread &&
|
||||||
!QDF_NBUF_CB_RX_PEER_CACHED_FRM(skb)) {
|
!QDF_NBUF_CB_RX_PEER_CACHED_FRM(skb)) {
|
||||||
|
Reference in New Issue
Block a user