Преглед изворни кода

qcacmn: Add ini support for RX low threshold interrupts

Add ini param "dp_disable_rx_buf_low_threshold" to disable
low threshold interrupts on regular rx refill ring. Default
it is enabled.

Change-Id: Ie471a4dc6862cbfe8b1eafe7c7d2ce2e0a7fcb7a
CRs-Fixed: 3313885
Chaithanya Garrepalli пре 2 година
родитељ
комит
64c4cb3524
4 измењених фајлова са 39 додато и 1 уклоњено
  1. 14 1
      dp/wifi3.0/dp_main.c
  2. 5 0
      wlan_cfg/cfg_dp.h
  3. 9 0
      wlan_cfg/wlan_cfg.c
  4. 11 0
      wlan_cfg/wlan_cfg.h

+ 14 - 1
dp/wifi3.0/dp_main.c

@@ -1905,6 +1905,7 @@ dp_srng_configure_interrupt_thresholds(struct dp_soc *soc,
 				       int num_entries)
 {
 	uint8_t wbm2_sw_rx_rel_ring_id;
+	bool rx_refill_lt_disable;
 
 	wbm2_sw_rx_rel_ring_id = wlan_cfg_get_rx_rel_ring_id(soc->wlan_cfg_ctx);
 
@@ -1920,6 +1921,18 @@ dp_srng_configure_interrupt_thresholds(struct dp_soc *soc,
 			wlan_cfg_get_int_timer_threshold_tx(soc->wlan_cfg_ctx);
 		ring_params->intr_batch_cntr_thres_entries =
 			wlan_cfg_get_int_batch_threshold_tx(soc->wlan_cfg_ctx);
+	} else if (ring_type == RXDMA_BUF) {
+		rx_refill_lt_disable =
+			wlan_cfg_get_dp_soc_rxdma_refill_lt_disable
+							(soc->wlan_cfg_ctx);
+		ring_params->intr_timer_thres_us =
+			wlan_cfg_get_int_timer_threshold_rx(soc->wlan_cfg_ctx);
+
+		if (!rx_refill_lt_disable) {
+			ring_params->low_threshold = num_entries >> 3;
+			ring_params->flags |= HAL_SRNG_LOW_THRES_INTR_ENABLE;
+			ring_params->intr_batch_cntr_thres_entries = 0;
+		}
 	} else {
 		ring_params->intr_timer_thres_us =
 			wlan_cfg_get_int_timer_threshold_other(soc->wlan_cfg_ctx);
@@ -1947,7 +1960,7 @@ dp_srng_configure_interrupt_thresholds(struct dp_soc *soc,
 	 * monitor buffer rings.
 	 * TODO: See if this is required for any other ring
 	 */
-	if ((ring_type == RXDMA_BUF) || (ring_type == RXDMA_MONITOR_BUF) ||
+	if ((ring_type == RXDMA_MONITOR_BUF) ||
 	    (ring_type == RXDMA_MONITOR_STATUS ||
 	    (ring_type == TX_MONITOR_BUF))) {
 		/* TODO: Setting low threshold to 1/8th of ring size

+ 5 - 0
wlan_cfg/cfg_dp.h

@@ -1098,6 +1098,10 @@
 		WLAN_CFG_RXDMA_REFILL_RING_SIZE, \
 		CFG_VALUE_OR_DEFAULT, "DP RXDMA refilll ring")
 
+#define CFG_DP_RXDMA_REFILL_LT_DISABLE \
+	CFG_INI_BOOL("dp_disable_rx_buf_low_threshold", false, \
+		     "Disable Low threshold interrupts for Rx Refill ring")
+
 #define CFG_DP_TX_DESC_LIMIT_0 \
 		CFG_INI_UINT("dp_tx_desc_limit_0", \
 		WLAN_CFG_TX_DESC_LIMIT_0_MIN, \
@@ -1790,6 +1794,7 @@
 		CFG(CFG_DP_REO_STATUS_RING) \
 		CFG(CFG_DP_RXDMA_BUF_RING) \
 		CFG(CFG_DP_RXDMA_REFILL_RING) \
+		CFG(CFG_DP_RXDMA_REFILL_LT_DISABLE) \
 		CFG(CFG_DP_TX_DESC_LIMIT_0) \
 		CFG(CFG_DP_TX_DESC_LIMIT_1) \
 		CFG(CFG_DP_TX_DESC_LIMIT_2) \

+ 9 - 0
wlan_cfg/wlan_cfg.c

@@ -2803,6 +2803,9 @@ wlan_cfg_soc_attach(struct cdp_ctrl_objmgr_psoc *psoc)
 						CFG_DP_REO_STATUS_RING);
 	wlan_cfg_ctx->rxdma_refill_ring = cfg_get(psoc,
 						  CFG_DP_RXDMA_REFILL_RING);
+	wlan_cfg_ctx->rxdma_refill_lt_disable =
+					cfg_get(psoc,
+						CFG_DP_RXDMA_REFILL_LT_DISABLE);
 	wlan_cfg_ctx->tx_desc_limit_0 = cfg_get(psoc,
 						CFG_DP_TX_DESC_LIMIT_0);
 	wlan_cfg_ctx->tx_desc_limit_1 = cfg_get(psoc,
@@ -3598,6 +3601,12 @@ wlan_cfg_get_dp_soc_rxdma_refill_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
 	return cfg->rxdma_refill_ring;
 }
 
+bool
+wlan_cfg_get_dp_soc_rxdma_refill_lt_disable(struct wlan_cfg_dp_soc_ctxt *cfg)
+{
+	return cfg->rxdma_refill_lt_disable;
+}
+
 int
 wlan_cfg_get_dp_soc_tx_desc_limit_0(struct wlan_cfg_dp_soc_ctxt *cfg)
 {

+ 11 - 0
wlan_cfg/wlan_cfg.h

@@ -207,6 +207,7 @@ struct wlan_srng_cfg {
  * @reo_cmd_ring: reo cmd ring size
  * @reo_status_ring: reo status ting size
  * @rxdma_refill_ring: rxdma refill ring size
+ * @rxdma_refill_lt_disable: rxdma refill low threshold disable
  * @rxdma_err_dst_ring: rxdma error destination ring size
  * @raw_mode_war: enable/disable raw mode war
  * @enable_data_stall_detection: enable/disable specific data stall detection
@@ -351,6 +352,7 @@ struct wlan_cfg_dp_soc_ctxt {
 	int reo_cmd_ring;
 	int reo_status_ring;
 	int rxdma_refill_ring;
+	bool rxdma_refill_lt_disable;
 	int rxdma_err_dst_ring;
 	uint32_t per_pkt_trace;
 	bool raw_mode_war;
@@ -1509,6 +1511,15 @@ wlan_cfg_get_dp_soc_tx_sw_internode_queue(struct wlan_cfg_dp_soc_ctxt *cfg);
 int
 wlan_cfg_get_dp_soc_rxdma_refill_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
 
+/*
+ * wlan_cfg_get_dp_soc_rxdma_refill_lt_disable - Get RxDMA refill LT status
+ * @wlan_cfg_soc_ctx
+ *
+ * Return: true if Low threshold disable else false
+ */
+bool
+wlan_cfg_get_dp_soc_rxdma_refill_lt_disable(struct wlan_cfg_dp_soc_ctxt *cfg);
+
 /*
  * wlan_cfg_get_dp_soc_rxdma_err_dst_ring_size - Get rxdma dst ring size
  * @wlan_cfg_soc_ctx