diff --git a/dp/wifi3.0/dp_tx.c b/dp/wifi3.0/dp_tx.c index e06b609ccc..754578c710 100644 --- a/dp/wifi3.0/dp_tx.c +++ b/dp/wifi3.0/dp_tx.c @@ -5573,9 +5573,12 @@ uint32_t dp_tx_comp_handler(struct dp_intr *int_ctx, struct dp_soc *soc, bool force_break = false; struct dp_srng *tx_comp_ring = &soc->tx_comp_ring[ring_id]; int max_reap_limit, ring_near_full; + uint32_t num_entries; DP_HIST_INIT(); + num_entries = hal_srng_get_num_entries(soc->hal_soc, hal_ring_hdl); + more_data: hal_soc = soc->hal_soc; @@ -5593,7 +5596,9 @@ more_data: return 0; } - num_avail_for_reap = hal_srng_dst_num_valid(hal_soc, hal_ring_hdl, 0); + if (!num_avail_for_reap) + num_avail_for_reap = hal_srng_dst_num_valid(hal_soc, + hal_ring_hdl, 0); if (num_avail_for_reap >= quota) num_avail_for_reap = quota; @@ -5797,6 +5802,17 @@ next_desc: if (!hif_exec_should_yield(soc->hif_handle, int_ctx->dp_intr_id)) goto more_data; + + num_avail_for_reap = + hal_srng_dst_num_valid_locked(soc->hal_soc, + hal_ring_hdl, + true); + if (qdf_unlikely(num_entries && + (num_avail_for_reap >= + num_entries >> 1))) { + DP_STATS_INC(soc, tx.near_full, 1); + goto more_data; + } } } DP_TX_HIST_STATS_PER_PDEV(); diff --git a/dp/wifi3.0/dp_types.h b/dp/wifi3.0/dp_types.h index 0faf073db8..a3a0be1ead 100644 --- a/dp/wifi3.0/dp_types.h +++ b/dp/wifi3.0/dp_types.h @@ -1110,6 +1110,8 @@ struct dp_soc_stats { uint32_t tx_comp[MAX_TCL_DATA_RINGS]; /* Number of tx completions force freed */ uint32_t tx_comp_force_freed; + /* Tx completion ring near full */ + uint32_t near_full; } tx; /* SOC level RX stats */