Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f7305420 authored by Yu Tian's avatar Yu Tian Committed by snandini
Browse files

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
parent ff72054c
Loading
Loading
Loading
Loading
+55 −1
Original line number Diff line number Diff line
@@ -106,6 +106,14 @@
#define WLAN_CFG_INT_TIMER_THRESHOLD_OTHER 8
#endif

#define WLAN_CFG_RX_PENDING_HL_THRESHOLD 0x60000
#define WLAN_CFG_RX_PENDING_HL_THRESHOLD_MIN 0
#define WLAN_CFG_RX_PENDING_HL_THRESHOLD_MAX 0x80000

#define WLAN_CFG_RX_PENDING_LO_THRESHOLD 0x60000
#define WLAN_CFG_RX_PENDING_LO_THRESHOLD_MIN 100
#define WLAN_CFG_RX_PENDING_LO_THRESHOLD_MAX 0x80000

#define WLAN_CFG_INT_TIMER_THRESHOLD_WBM_RELEASE_RING 256
#define WLAN_CFG_INT_TIMER_THRESHOLD_REO_RING 512

@@ -509,6 +517,49 @@
		WLAN_CFG_PER_PDEV_LMAC_RING_MAX, \
		WLAN_CFG_PER_PDEV_LMAC_RING, \
		CFG_VALUE_OR_DEFAULT, "DP pdev LMAC ring")
/*
 * <ini>
 * dp_rx_pending_hl_threshold - High threshold of frame number to start
 * frame dropping scheme
 * @Min: 0
 * @Max: 524288
 * @Default: 393216
 *
 * This ini entry is used to set a high limit threshold to start frame
 * dropping scheme
 *
 * Usage: External
 *
 * </ini>
 */
#define CFG_DP_RX_PENDING_HL_THRESHOLD \
		CFG_INI_UINT("dp_rx_pending_hl_threshold", \
		WLAN_CFG_RX_PENDING_HL_THRESHOLD_MIN, \
		WLAN_CFG_RX_PENDING_HL_THRESHOLD_MAX, \
		WLAN_CFG_RX_PENDING_HL_THRESHOLD, \
		CFG_VALUE_OR_DEFAULT, "DP rx pending hl threshold")

/*
 * <ini>
 * dp_rx_pending_lo_threshold - Low threshold of frame number to stop
 * frame dropping scheme
 * @Min: 100
 * @Max: 524288
 * @Default: 393216
 *
 * This ini entry is used to set a low limit threshold to stop frame
 * dropping scheme
 *
 * Usage: External
 *
 * </ini>
 */
#define CFG_DP_RX_PENDING_LO_THRESHOLD \
		CFG_INI_UINT("dp_rx_pending_lo_threshold", \
		WLAN_CFG_RX_PENDING_LO_THRESHOLD_MIN, \
		WLAN_CFG_RX_PENDING_LO_THRESHOLD_MAX, \
		WLAN_CFG_RX_PENDING_LO_THRESHOLD, \
		CFG_VALUE_OR_DEFAULT, "DP rx pending lo threshold")

#define CFG_DP_BASE_HW_MAC_ID \
		CFG_INI_UINT("dp_base_hw_macid", \
@@ -950,5 +1001,8 @@
		CFG(CFG_DP_RXDMA_MONITOR_RX_DROP_THRESHOLD) \
		CFG(CFG_DP_PKTLOG_BUFFER_SIZE) \
		CFG(CFG_DP_RX_FISA_ENABLE) \
		CFG(CFG_DP_LEGACY_MODE_CSUM_DISABLE)
		CFG(CFG_DP_LEGACY_MODE_CSUM_DISABLE) \
		CFG(CFG_DP_RX_PENDING_HL_THRESHOLD) \
		CFG(CFG_DP_RX_PENDING_LO_THRESHOLD)

#endif /* _CFG_DP_H_ */
+17 −0
Original line number Diff line number Diff line
@@ -572,6 +572,11 @@ wlan_cfg_soc_attach(struct cdp_ctrl_objmgr_psoc *psoc)
	wlan_cfg_ctx->mon_drop_thresh =
		cfg_get(psoc, CFG_DP_RXDMA_MONITOR_RX_DROP_THRESHOLD);
	wlan_cfg_ctx->is_rx_fisa_enabled = cfg_get(psoc, CFG_DP_RX_FISA_ENABLE);
	wlan_cfg_ctx->rx_pending_high_threshold =
			cfg_get(psoc, CFG_DP_RX_PENDING_HL_THRESHOLD);
	wlan_cfg_ctx->rx_pending_low_threshold =
			cfg_get(psoc, CFG_DP_RX_PENDING_LO_THRESHOLD);

	return wlan_cfg_ctx;
}

@@ -830,6 +835,18 @@ int wlan_cfg_per_pdev_tx_ring(struct wlan_cfg_dp_soc_ctxt *cfg)
	return cfg->per_pdev_tx_ring;
}

uint32_t
wlan_cfg_rx_pending_hl_threshold(struct wlan_cfg_dp_soc_ctxt *cfg)
{
	return cfg->rx_pending_high_threshold;
}

uint32_t
wlan_cfg_rx_pending_lo_threshold(struct wlan_cfg_dp_soc_ctxt *cfg)
{
	return cfg->rx_pending_low_threshold;
}

int wlan_cfg_per_pdev_lmac_ring(struct wlan_cfg_dp_soc_ctxt *cfg)
{
	return cfg->per_pdev_lmac_ring;
+22 −0
Original line number Diff line number Diff line
@@ -183,6 +183,8 @@ struct wlan_srng_cfg {
 *                        5 tuple flow entry
 * @pktlog_buffer_size: packet log buffer size
 * @is_rx_fisa_enabled: flag to enable/disable FISA Rx
 * @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;
@@ -283,6 +285,8 @@ struct wlan_cfg_dp_soc_ctxt {
	uint8_t *rx_toeplitz_hash_key;
	uint8_t pktlog_buffer_size;
	uint8_t is_rx_fisa_enabled;
	uint32_t rx_pending_high_threshold;
	uint32_t rx_pending_low_threshold;
};

/**
@@ -836,6 +840,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