qcacmn: Allow drop pkts when pkts pending is large

On some cases, dp_rx_thread can not handle nbufs in time,
then a large number of packets are pending in
rx_thread->nbuf_queue, which run out of system memory at
last and failed to malloc new buffers for refill buffer
ring, fw crash is encountered. To avoid this, drop RX
packets when the pending number becomes large.

Change-Id: I370ad983b185b6ecb28fa7c0b4820b8edc00c710
CRs-Fixed: 2737191
This commit is contained in:
Yu Tian
2020-07-22 11:20:45 +08:00
gecommit door snandini
bovenliggende 30a3c984d0
commit db5374f08f
3 gewijzigde bestanden met toevoegingen van 93 en 1 verwijderingen

Bestand weergeven

@@ -187,6 +187,8 @@ struct wlan_srng_cfg {
* @pext_stats_enabled: Flag to enable and disabled peer extended stats
* @is_rx_buff_pool_enabled: flag to enable/disable emergency RX buffer
* pool support
* @rx_pending_high_threshold: threshold of starting pkt drop
* @rx_pending_low_threshold: threshold of stopping pkt drop
*/
struct wlan_cfg_dp_soc_ctxt {
int num_int_ctxts;
@@ -292,6 +294,8 @@ struct wlan_cfg_dp_soc_ctxt {
uint32_t reo_rings_mapping;
bool pext_stats_enabled;
bool is_rx_buff_pool_enabled;
uint32_t rx_pending_high_threshold;
uint32_t rx_pending_low_threshold;
};
/**
@@ -867,6 +871,24 @@ wlan_cfg_get_dma_mon_desc_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg);
int wlan_cfg_get_rx_dma_buf_ring_size(
struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
/*
* wlan_cfg_rx_pending_hl_threshold() - Return high threshold of rx pending
* @wlan_cfg_pdev_ctx
*
* Return: rx_pending_high_threshold
*/
uint32_t
wlan_cfg_rx_pending_hl_threshold(struct wlan_cfg_dp_soc_ctxt *cfg);
/*
* wlan_cfg_rx_pending_lo_threshold() - Return low threshold of rx pending
* @wlan_cfg_pdev_ctx
*
* Return: rx_pending_low_threshold
*/
uint32_t
wlan_cfg_rx_pending_lo_threshold(struct wlan_cfg_dp_soc_ctxt *cfg);
/*
* wlan_cfg_get_num_mac_rings() - Return the number of MAC RX DMA rings
* per pdev