qcacmn: Avoid sending wds del wmi cmds in a burst

In case of aging out wds entries, avoid sending all
the wds delete wmi commands in a huge single burst.
Instead limit the maximum commands to half of the
wmi queue size. Inactivity will continue to be
marked every 120 secs but the inactive entries
will be flushed every 5 secs if there are pending
entries.

Change-Id: I6735704a0750ef466f1df798f0b354f4382098d6
CRs-Fixed: 2952682
This commit is contained in:
Pavankumar Nandeshwar
2021-06-01 21:09:19 -07:00
committed by Madan Koyyalamudi
parent 2376885753
commit 72bf8a6cb2
5 changed files with 43 additions and 6 deletions

View File

@@ -1996,6 +1996,7 @@ struct cdp_peer_hmwds_ast_add_status {
enum cdp_soc_param_t {
DP_SOC_PARAM_MSDU_EXCEPTION_DESC,
DP_SOC_PARAM_CMEM_FSE_SUPPORT,
DP_SOC_PARAM_MAX_AST_AGEOUT,
DP_SOC_PARAM_MAX,
};

View File

@@ -11331,6 +11331,10 @@ static QDF_STATUS dp_soc_set_param(struct cdp_soc_t *soc_hdl,
soc->fst_in_cmem = !!value;
dp_info("FW supports CMEM FSE %u", value);
break;
case DP_SOC_PARAM_MAX_AST_AGEOUT:
soc->max_ast_ageout_count = value;
dp_info("Max ast ageout count %u", soc->max_ast_ageout_count);
break;
default:
dp_info("not handled param %d ", param);
break;
@@ -12917,6 +12921,7 @@ void *dp_soc_init(struct dp_soc *soc, HTC_HANDLE htc_handle,
wlan_cfg_set_rx_hash(soc->wlan_cfg_ctx,
cfg_get(soc->ctrl_psoc, CFG_DP_RX_HASH));
soc->cce_disable = false;
soc->max_ast_ageout_count = MAX_AST_AGEOUT_COUNT;
qdf_mem_zero(&soc->vdev_id_map, sizeof(soc->vdev_id_map));
qdf_spinlock_create(&soc->vdev_map_lock);

View File

@@ -54,6 +54,11 @@ struct reo_qdesc_event {
};
#endif
struct ast_del_ctxt {
bool age;
int del_count;
};
typedef void dp_peer_iter_func(struct dp_soc *soc, struct dp_peer *peer,
void *arg);
void dp_peer_unref_delete(struct dp_peer *peer, enum dp_mod_id id);

View File

@@ -44,6 +44,12 @@ static void
dp_peer_age_ast_entries(struct dp_soc *soc, struct dp_peer *peer, void *arg)
{
struct dp_ast_entry *ase, *temp_ase;
struct ast_del_ctxt *del_ctxt = (struct ast_del_ctxt *)arg;
if ((del_ctxt->del_count >= soc->max_ast_ageout_count) &&
!del_ctxt->age) {
return;
}
DP_PEER_ITERATE_ASE_LIST(peer, ase, temp_ase) {
/*
@@ -54,12 +60,21 @@ dp_peer_age_ast_entries(struct dp_soc *soc, struct dp_peer *peer, void *arg)
continue;
if (ase->is_active) {
if (del_ctxt->age)
ase->is_active = FALSE;
continue;
}
if (del_ctxt->del_count < soc->max_ast_ageout_count) {
DP_STATS_INC(soc, ast.aged_out, 1);
dp_peer_del_ast(soc, ase);
del_ctxt->del_count++;
} else {
soc->pending_ageout = true;
if (!del_ctxt->age)
break;
}
}
}
@@ -97,17 +112,23 @@ dp_peer_age_mec_entries(struct dp_soc *soc)
static void dp_ast_aging_timer_fn(void *soc_hdl)
{
struct dp_soc *soc = (struct dp_soc *)soc_hdl;
struct ast_del_ctxt del_ctxt = {0};
if (soc->wds_ast_aging_timer_cnt++ >= DP_WDS_AST_AGING_TIMER_CNT) {
del_ctxt.age = true;
soc->wds_ast_aging_timer_cnt = 0;
}
if (soc->pending_ageout || del_ctxt.age) {
soc->pending_ageout = false;
/* AST list access lock */
qdf_spin_lock_bh(&soc->ast_lock);
dp_soc_iterate_peer(soc, dp_peer_age_ast_entries, NULL,
dp_soc_iterate_peer(soc, dp_peer_age_ast_entries, &del_ctxt,
DP_MOD_ID_AST);
qdf_spin_unlock_bh(&soc->ast_lock);
}
/*
@@ -132,6 +153,7 @@ static void dp_ast_aging_timer_fn(void *soc_hdl)
void dp_soc_wds_attach(struct dp_soc *soc)
{
soc->wds_ast_aging_timer_cnt = 0;
soc->pending_ageout = false;
qdf_timer_init(soc->osdev, &soc->ast_aging_timer,
dp_ast_aging_timer_fn, (void *)soc,
QDF_TIMER_TYPE_WAKE_APPS);

View File

@@ -104,6 +104,8 @@
#define DP_MAX_IRQ_PER_CONTEXT 12
#define DEFAULT_HW_PEER_ID 0xffff
#define MAX_AST_AGEOUT_COUNT 128
#define WBM_INT_ERROR_ALL 0
#define WBM_INT_ERROR_REO_NULL_BUFFER 1
#define WBM_INT_ERROR_REO_NULL_LINK_DESC 2
@@ -1831,6 +1833,8 @@ struct dp_soc {
/*Timer counter for WDS AST entry ageout*/
uint8_t wds_ast_aging_timer_cnt;
bool pending_ageout;
uint32_t max_ast_ageout_count;
/*interrupt timer*/
qdf_timer_t mon_reap_timer;