qcacld-3.0: Add config changes to DP component

Add changes to initialize DP component config

Change-Id: I0f1dbbfad35801d0ffde85233c0dcde6c6ab27ec
CRs-Fixed: 3169865
This commit is contained in:
Amit Mehta
2022-04-09 17:06:20 +05:30
committed by Madan Koyyalamudi
parent 1fd4974449
commit a5e45cf6ac
7 changed files with 1517 additions and 62 deletions

View File

@@ -35,14 +35,6 @@
#include "pld_common.h"
#include "wlan_dp_nud_tracking.h"
#ifndef NUM_CPUS
#ifdef QCA_CONFIG_SMP
#define NUM_CPUS NR_CPUS
#else
#define NUM_CPUS 1
#endif
#endif
#ifndef NUM_TX_RX_HISTOGRAM
#define NUM_TX_RX_HISTOGRAM 128
#endif
@@ -121,11 +113,6 @@ struct wlan_dp_psoc_cfg {
bool enable_latency_crit_clients;
#endif /*WLAN_FEATURE_DP_BUS_BANDWIDTH*/
#ifdef WLAN_FEATURE_MSCS
uint32_t mscs_pkt_threshold;
uint32_t mscs_voice_interval;
#endif /* WLAN_FEATURE_MSCS */
#ifdef QCA_SUPPORT_TXRX_DRIVER_TCP_DEL_ACK
bool del_ack_enable;
uint32_t del_ack_threshold_high;
@@ -133,7 +120,6 @@ struct wlan_dp_psoc_cfg {
uint16_t del_ack_timer_value;
uint16_t del_ack_pkt_count;
#endif
uint32_t napi_cpu_affinity_mask;
/* CPU affinity mask for rx_thread */
uint32_t rx_thread_ul_affinity_mask;
uint32_t rx_thread_affinity_mask;
@@ -157,8 +143,6 @@ struct wlan_dp_psoc_cfg {
uint32_t fisa_enable;
int icmp_req_to_fw_mark_interval;
uint32_t cfg_wmi_credit_cnt;
};
/**
@@ -194,52 +178,6 @@ struct tx_rx_histogram {
uint64_t qtime;
};
struct dp_tx_rx_stats {
struct {
/* start_xmit stats */
__u32 tx_called;
__u32 tx_dropped;
__u32 tx_orphaned;
__u32 tx_classified_ac[WLAN_MAX_AC];
__u32 tx_dropped_ac[WLAN_MAX_AC];
#ifdef TX_MULTIQ_PER_AC
/* Neither valid socket nor skb->hash */
uint32_t inv_sk_and_skb_hash;
/* skb->hash already calculated */
uint32_t qselect_existing_skb_hash;
/* valid tx queue id in socket */
uint32_t qselect_sk_tx_map;
/* skb->hash calculated in select queue */
uint32_t qselect_skb_hash_calc;
#endif
/* rx stats */
__u32 rx_packets;
__u32 rx_dropped;
__u32 rx_delivered;
__u32 rx_refused;
} per_cpu[NUM_CPUS];
qdf_atomic_t rx_usolict_arp_n_mcast_drp;
/* rx gro */
__u32 rx_aggregated;
__u32 rx_gro_dropped;
__u32 rx_non_aggregated;
__u32 rx_gro_flush_skip;
__u32 rx_gro_low_tput_flush;
/* txflow stats */
bool is_txflow_paused;
__u32 txflow_pause_cnt;
__u32 txflow_unpause_cnt;
__u32 txflow_timer_cnt;
/*tx timeout stats*/
__u32 tx_timeout_cnt;
__u32 cont_txtimeout_cnt;
u64 jiffies_last_txtimeout;
};
/**
* struct dp_stats - DP stats
* @tx_rx_stats : Tx/Rx debug stats

View File

@@ -305,9 +305,275 @@ void dp_set_dump_dp_trace(uint16_t cmd_type, uint16_t count)
{
}
#endif
#ifdef WLAN_FEATURE_DP_BUS_BANDWIDTH
/**
* dp_ini_bus_bandwidth() - Initialize INIs concerned about bus bandwidth
* @config: pointer to dp config
* @psoc: pointer to psoc obj
*
* Return: none
*/
static void dp_ini_bus_bandwidth(struct wlan_dp_psoc_cfg *config,
struct wlan_objmgr_psoc *psoc)
{
config->bus_bw_ultra_high_threshold =
cfg_get(psoc, CFG_DP_BUS_BANDWIDTH_ULTRA_HIGH_THRESHOLD);
config->bus_bw_very_high_threshold =
cfg_get(psoc, CFG_DP_BUS_BANDWIDTH_VERY_HIGH_THRESHOLD);
config->bus_bw_dbs_threshold =
cfg_get(psoc, CFG_DP_BUS_BANDWIDTH_DBS_THRESHOLD);
config->bus_bw_high_threshold =
cfg_get(psoc, CFG_DP_BUS_BANDWIDTH_HIGH_THRESHOLD);
config->bus_bw_medium_threshold =
cfg_get(psoc, CFG_DP_BUS_BANDWIDTH_MEDIUM_THRESHOLD);
config->bus_bw_low_threshold =
cfg_get(psoc, CFG_DP_BUS_BANDWIDTH_LOW_THRESHOLD);
config->bus_bw_compute_interval =
cfg_get(psoc, CFG_DP_BUS_BANDWIDTH_COMPUTE_INTERVAL);
config->bus_low_cnt_threshold =
cfg_get(psoc, CFG_DP_BUS_LOW_BW_CNT_THRESHOLD);
config->enable_latency_crit_clients =
cfg_get(psoc, CFG_DP_BUS_HANDLE_LATENCY_CRITICAL_CLIENTS);
}
/**
* dp_ini_tcp_settings() - Initialize INIs concerned about tcp settings
* @config: pointer to dp config
* @psoc: pointer to psoc obj
*
* Return: none
*/
static void dp_ini_tcp_settings(struct wlan_dp_psoc_cfg *config,
struct wlan_objmgr_psoc *psoc)
{
config->enable_tcp_limit_output =
cfg_get(psoc, CFG_DP_ENABLE_TCP_LIMIT_OUTPUT);
config->enable_tcp_adv_win_scale =
cfg_get(psoc, CFG_DP_ENABLE_TCP_ADV_WIN_SCALE);
config->enable_tcp_delack =
cfg_get(psoc, CFG_DP_ENABLE_TCP_DELACK);
config->tcp_delack_thres_high =
cfg_get(psoc, CFG_DP_TCP_DELACK_THRESHOLD_HIGH);
config->tcp_delack_thres_low =
cfg_get(psoc, CFG_DP_TCP_DELACK_THRESHOLD_LOW);
config->tcp_delack_timer_count =
cfg_get(psoc, CFG_DP_TCP_DELACK_TIMER_COUNT);
config->tcp_tx_high_tput_thres =
cfg_get(psoc, CFG_DP_TCP_TX_HIGH_TPUT_THRESHOLD);
config->enable_tcp_param_update =
cfg_get(psoc, CFG_DP_ENABLE_TCP_PARAM_UPDATE);
}
#else
static void dp_ini_bus_bandwidth(struct wlan_dp_psoc_cfg *config,
struct wlan_objmgr_psoc *psoc)
{
}
static void dp_ini_tcp_settings(struct wlan_dp_psoc_cfg *config,
struct wlan_objmgr_psoc *psoc)
{
}
#endif /*WLAN_FEATURE_DP_BUS_BANDWIDTH*/
#ifdef CONFIG_DP_TRACE
/**
* dp_trace_cfg_update() - initialize DP Trace config
* @config : Configuration paramerts
* @psoc: psoc handle
*/
static void
dp_trace_cfg_update(struct wlan_dp_psoc_cfg *config,
struct wlan_objmgr_psoc *psoc)
{
qdf_size_t array_out_size;
config->enable_dp_trace = cfg_get(psoc, CFG_DP_ENABLE_DP_TRACE);
qdf_uint8_array_parse(cfg_get(psoc, CFG_DP_DP_TRACE_CONFIG),
config->dp_trace_config,
sizeof(config->dp_trace_config), &array_out_size);
config->dp_proto_event_bitmap = cfg_get(psoc,
CFG_DP_PROTO_EVENT_BITMAP);
}
#else
static void
dp_trace_cfg_update(struct wlan_dp_psoc_cfg *config,
struct wlan_objmgr_psoc *psoc)
{
}
#endif
#ifdef WLAN_NUD_TRACKING
/**
* dp_nud_tracking_cfg_update() - initialize NUD Tracking config
* @config : Configuration paramerts
* @psoc: psoc handle
*/
static void
dp_nud_tracking_cfg_update(struct wlan_dp_psoc_cfg *config,
struct wlan_objmgr_psoc *psoc)
{
config->enable_nud_tracking = cfg_get(psoc, CFG_DP_ENABLE_NUD_TRACKING);
}
#else
static void
dp_nud_tracking_cfg_update(struct wlan_dp_psoc_cfg *config,
struct wlan_objmgr_psoc *psoc)
{
}
#endif
#ifdef QCA_SUPPORT_TXRX_DRIVER_TCP_DEL_ACK
/**
* dp_ini_tcp_del_ack_settings() - initialize TCP delack config
* @config : Configuration paramerts
* @psoc: psoc handle
*/
static void dp_ini_tcp_del_ack_settings(struct wlan_dp_psoc_cfg *config,
struct wlan_objmgr_psoc *psoc)
{
config->del_ack_threshold_high =
cfg_get(psoc, CFG_DP_DRIVER_TCP_DELACK_HIGH_THRESHOLD);
config->del_ack_threshold_low =
cfg_get(psoc, CFG_DP_DRIVER_TCP_DELACK_LOW_THRESHOLD);
config->del_ack_enable =
cfg_get(psoc, CFG_DP_DRIVER_TCP_DELACK_ENABLE);
config->del_ack_pkt_count =
cfg_get(psoc, CFG_DP_DRIVER_TCP_DELACK_PKT_CNT);
config->del_ack_timer_value =
cfg_get(psoc, CFG_DP_DRIVER_TCP_DELACK_TIMER_VALUE);
}
#else
static void dp_ini_tcp_del_ack_settings(struct wlan_dp_psoc_cfg *config,
struct wlan_objmgr_psoc *psoc)
{
}
#endif
#ifdef WLAN_SUPPORT_TXRX_HL_BUNDLE
/**
* dp_hl_bundle_cfg_update() - initialize TxRx HL bundle config
* @config : Configuration paramerts
* @psoc: psoc handle
*/
static void dp_hl_bundle_cfg_update(struct wlan_dp_psoc_cfg *config,
struct wlan_objmgr_psoc *psoc)
{
config->pkt_bundle_threshold_high =
cfg_get(psoc, CFG_DP_HL_BUNDLE_HIGH_TH);
config->pkt_bundle_threshold_low =
cfg_get(psoc, CFG_DP_HL_BUNDLE_LOW_TH);
config->pkt_bundle_timer_value =
cfg_get(psoc, CFG_DP_HL_BUNDLE_TIMER_VALUE);
config->pkt_bundle_size =
cfg_get(psoc, CFG_DP_HL_BUNDLE_SIZE);
}
#else
static void dp_hl_bundle_cfg_update(struct wlan_dp_psoc_cfg *config,
struct wlan_objmgr_psoc *psoc)
{
}
#endif
/**
* dp_set_rx_mode_value() - set rx_mode values
* @dp_ctx: DP context
*
* Return: none
*/
static void dp_set_rx_mode_value(struct wlan_dp_psoc_context *dp_ctx)
{
uint32_t rx_mode = dp_ctx->dp_cfg.rx_mode;
enum QDF_GLOBAL_MODE con_mode = 0;
con_mode = cds_get_conparam();
/* RPS has higher priority than dynamic RPS when both bits are set */
if (rx_mode & CFG_ENABLE_RPS && rx_mode & CFG_ENABLE_DYNAMIC_RPS)
rx_mode &= ~CFG_ENABLE_DYNAMIC_RPS;
if (rx_mode & CFG_ENABLE_RX_THREAD && rx_mode & CFG_ENABLE_RPS) {
dp_warn("rx_mode wrong configuration. Make it default");
rx_mode = CFG_RX_MODE_DEFAULT;
}
if (rx_mode & CFG_ENABLE_RX_THREAD) {
dp_ctx->enable_rxthread = true;
} else if (rx_mode & CFG_ENABLE_DP_RX_THREADS) {
if (con_mode == QDF_GLOBAL_MONITOR_MODE)
dp_ctx->enable_dp_rx_threads = false;
else
dp_ctx->enable_dp_rx_threads = true;
}
if (rx_mode & CFG_ENABLE_RPS)
dp_ctx->rps = true;
if (rx_mode & CFG_ENABLE_NAPI)
dp_ctx->napi_enable = true;
if (rx_mode & CFG_ENABLE_DYNAMIC_RPS)
dp_ctx->dynamic_rps = true;
dp_info("rx_mode:%u dp_rx_threads:%u rx_thread:%u napi:%u rps:%u dynamic rps %u",
rx_mode, dp_ctx->enable_dp_rx_threads,
dp_ctx->enable_rxthread, dp_ctx->napi_enable,
dp_ctx->rps, dp_ctx->dynamic_rps);
}
/**
* dp_cfg_init() - initialize target specific configuration
* @ctx: dp context handle
*/
static void dp_cfg_init(struct wlan_dp_psoc_context *ctx)
{
struct wlan_dp_psoc_cfg *config = &ctx->dp_cfg;
struct wlan_objmgr_psoc *psoc = ctx->psoc;
uint16_t cfg_len;
cfg_len = qdf_str_len(cfg_get(psoc, CFG_DP_RPS_RX_QUEUE_CPU_MAP_LIST))
+ 1;
dp_ini_bus_bandwidth(config, psoc);
dp_ini_tcp_settings(config, psoc);
dp_ini_tcp_del_ack_settings(config, psoc);
dp_hl_bundle_cfg_update(config, psoc);
config->rx_thread_ul_affinity_mask =
cfg_get(psoc, CFG_DP_RX_THREAD_UL_CPU_MASK);
config->rx_thread_affinity_mask =
cfg_get(psoc, CFG_DP_RX_THREAD_CPU_MASK);
config->fisa_enable = cfg_get(psoc, CFG_DP_RX_FISA_ENABLE);
if (cfg_len < CFG_DP_RPS_RX_QUEUE_CPU_MAP_LIST_LEN) {
qdf_str_lcopy(config->cpu_map_list,
cfg_get(psoc, CFG_DP_RPS_RX_QUEUE_CPU_MAP_LIST),
cfg_len);
} else {
dp_err("ini string length greater than max size %d",
CFG_DP_RPS_RX_QUEUE_CPU_MAP_LIST_LEN);
cfg_len = qdf_str_len(cfg_default(CFG_DP_RPS_RX_QUEUE_CPU_MAP_LIST));
qdf_str_lcopy(config->cpu_map_list,
cfg_default(CFG_DP_RPS_RX_QUEUE_CPU_MAP_LIST),
cfg_len);
}
config->tx_orphan_enable = cfg_get(psoc, CFG_DP_TX_ORPHAN_ENABLE);
config->rx_mode = cfg_get(psoc, CFG_DP_RX_MODE);
dp_set_rx_mode_value(ctx);
config->multicast_replay_filter =
cfg_get(psoc, CFG_DP_FILTER_MULTICAST_REPLAY);
config->rx_wakelock_timeout =
cfg_get(psoc, CFG_DP_RX_WAKELOCK_TIMEOUT);
config->num_dp_rx_threads = cfg_get(psoc, CFG_DP_NUM_DP_RX_THREADS);
config->icmp_req_to_fw_mark_interval =
cfg_get(psoc, CFG_DP_ICMP_REQ_TO_FW_MARK_INTERVAL);
config->rx_softirq_max_yield_duration_ns =
cfg_get(psoc,
CFG_DP_RX_SOFTIRQ_MAX_YIELD_TIME_NS);
dp_trace_cfg_update(config, psoc);
dp_nud_tracking_cfg_update(config, psoc);
dp_trace_cfg_update(config, psoc);
}
/**

View File

@@ -76,6 +76,10 @@ void dp_periodic_sta_stats_display(struct wlan_dp_psoc_context *dp_ctx)
void dp_periodic_sta_stats_config(struct dp_config *config,
struct wlan_objmgr_psoc *psoc)
{
config->periodic_stats_timer_interval =
cfg_get(psoc, CFG_PERIODIC_STATS_TIMER_INTERVAL);
config->periodic_stats_timer_duration =
cfg_get(psoc, CFG_PERIODIC_STATS_TIMER_DURATION);
}
void dp_periodic_sta_stats_start(struct wlan_objmgr_vdev *vdev)

File diff suppressed because it is too large Load Diff

View File

@@ -51,6 +51,14 @@
#define NUM_TX_QUEUES (4 * TX_QUEUES_PER_AC)
#endif
#ifndef NUM_CPUS
#ifdef QCA_CONFIG_SMP
#define NUM_CPUS NR_CPUS
#else
#define NUM_CPUS 1
#endif
#endif
/**
* struct dp_arp_stats - arp debug stats count
* @tx_arp_req_count: no. of arp req received from network stack
@@ -222,6 +230,52 @@ struct dp_rsp_stats {
uint32_t icmpv4_rsp_recvd;
};
struct dp_tx_rx_stats {
struct {
/* start_xmit stats */
__u32 tx_called;
__u32 tx_dropped;
__u32 tx_orphaned;
__u32 tx_classified_ac[WLAN_MAX_AC];
__u32 tx_dropped_ac[WLAN_MAX_AC];
#ifdef TX_MULTIQ_PER_AC
/* Neither valid socket nor skb->hash */
uint32_t inv_sk_and_skb_hash;
/* skb->hash already calculated */
uint32_t qselect_existing_skb_hash;
/* valid tx queue id in socket */
uint32_t qselect_sk_tx_map;
/* skb->hash calculated in select queue */
uint32_t qselect_skb_hash_calc;
#endif
/* rx stats */
__u32 rx_packets;
__u32 rx_dropped;
__u32 rx_delivered;
__u32 rx_refused;
} per_cpu[NUM_CPUS];
qdf_atomic_t rx_usolict_arp_n_mcast_drp;
/* rx gro */
__u32 rx_aggregated;
__u32 rx_gro_dropped;
__u32 rx_non_aggregated;
__u32 rx_gro_flush_skip;
__u32 rx_gro_low_tput_flush;
/* txflow stats */
bool is_txflow_paused;
__u32 txflow_pause_cnt;
__u32 txflow_unpause_cnt;
__u32 txflow_timer_cnt;
/*tx timeout stats*/
__u32 tx_timeout_cnt;
__u32 cont_txtimeout_cnt;
u64 last_txtimeout;
};
/**
* struct dp_dhcp_ind - DHCP Start/Stop indication message
* @dhcp_start: Is DHCP start idication

View File

@@ -716,4 +716,20 @@ void ucfg_dp_register_hdd_callbacks(struct wlan_objmgr_psoc *psoc,
*/
void ucfg_dp_register_event_handler(struct wlan_objmgr_psoc *psoc,
struct wlan_dp_psoc_nb_ops *cb_obj);
/**
* ucfg_dp_get_bus_bw_compute_interval() - Get bus bandwidth compute interval
* @psoc: psoc handle
*
* Returns: Bus bandwidth compute interval
*/
uint32_t ucfg_dp_get_bus_bw_compute_interval(struct wlan_objmgr_psoc *psoc);
/**
* ucfg_dp_get_current_throughput_level() - get current bandwidth level
* @psoc: psoc handle
*
* Return: current bandwidth level
*/
int ucfg_dp_get_current_throughput_level(struct wlan_objmgr_psoc *psoc);
#endif /* _WLAN_DP_UCFG_API_H_ */

View File

@@ -971,6 +971,16 @@ void ucfg_dp_set_dump_dp_trace(uint16_t cmd_type, uint16_t count)
dp_set_dump_dp_trace(cmd_type, count);
}
int ucfg_dp_get_current_throughput_level(struct wlan_objmgr_psoc *psoc)
{
struct wlan_dp_psoc_context *dp_ctx = dp_psoc_get_priv(psoc);
if (!dp_ctx)
return 0;
return dp_get_current_throughput_level(dp_ctx);
}
QDF_STATUS
ucfg_dp_req_get_arp_stats(struct wlan_objmgr_psoc *psoc,
struct dp_get_arp_stats_params *params)
@@ -1048,3 +1058,14 @@ void ucfg_dp_register_event_handler(struct wlan_objmgr_psoc *psoc,
dp_ctx->nb_ops.osif_dp_get_arp_stats_evt =
cb_obj->osif_dp_get_arp_stats_evt;
}
uint32_t ucfg_dp_get_bus_bw_compute_interval(struct wlan_objmgr_psoc *psoc)
{
struct wlan_dp_psoc_context *dp_ctx = dp_psoc_get_priv(psoc);
if (!dp_ctx) {
dp_err("DP ctx is NULL");
return 0;
}
return dp_ctx->dp_cfg.bus_bw_compute_interval;
}