Browse Source

qcacmn: Enable data path polling mode based on INI

Enable data path polling mode based on INI
dp_poll_mode_enable. Configure all data path
interfacing rings (UMAC/LMAC) and Monitor rings
in polling mode when NSS offload is disabled.
By default, poll mode is disabled.

Change-Id: I0e51207042811f517a423eb7276e3f33c5313450
Sridhar Selvaraj 4 years ago
parent
commit
b257b236b0
4 changed files with 42 additions and 4 deletions
  1. 18 2
      dp/wifi3.0/dp_main.c
  2. 6 1
      wlan_cfg/cfg_dp.h
  3. 7 1
      wlan_cfg/wlan_cfg.c
  4. 11 0
      wlan_cfg/wlan_cfg.h

+ 18 - 2
dp/wifi3.0/dp_main.c

@@ -1994,12 +1994,28 @@ static void dp_interrupt_timer(void *arg)
 	struct dp_pdev *pdev = soc->pdev_list[0];
 	enum timer_yield_status yield = DP_TIMER_NO_YIELD;
 	uint32_t work_done  = 0, total_work_done = 0;
-	int budget = 0xffff;
+	int budget = 0xffff, i;
 	uint32_t remaining_quota = budget;
 	uint64_t start_time;
 	uint32_t lmac_id;
 	uint8_t dp_intr_id;
 
+	/*
+	 * this logic makes all data path interfacing rings (UMAC/LMAC)
+	 * and Monitor rings polling mode when NSS offload is disabled
+	 */
+	if (wlan_cfg_is_poll_mode_enabled(soc->wlan_cfg_ctx) &&
+	    !wlan_cfg_get_dp_soc_nss_cfg(soc->wlan_cfg_ctx)) {
+		if (qdf_atomic_read(&soc->cmn_init_done)) {
+			for (i = 0; i < wlan_cfg_get_num_contexts(
+						soc->wlan_cfg_ctx); i++)
+				dp_service_srngs(&soc->intr_ctx[i], 0xffff);
+
+			qdf_timer_mod(&soc->int_timer, DP_INTR_POLL_TIMER_MS);
+		}
+		return;
+	}
+
 	if (!qdf_atomic_read(&soc->cmn_init_done))
 		return;
 
@@ -2182,7 +2198,7 @@ static QDF_STATUS dp_soc_interrupt_attach_wrapper(struct cdp_soc_t *txrx_soc)
 {
 	struct dp_soc *soc = (struct dp_soc *)txrx_soc;
 
-	if (hif_is_polled_mode_enabled(soc->hif_handle))
+	if (wlan_cfg_is_poll_mode_enabled(soc->wlan_cfg_ctx))
 		return dp_soc_attach_poll(txrx_soc);
 	else
 		return dp_soc_interrupt_attach(txrx_soc);

+ 6 - 1
wlan_cfg/cfg_dp.h

@@ -965,6 +965,10 @@
 	CFG_INI_BOOL("dp_rx_buff_prealloc_pool", false, \
 		     "Enable/Disable DP RX emergency buffer pool support")
 
+#define CFG_DP_POLL_MODE_ENABLE \
+		CFG_INI_BOOL("dp_poll_mode_enable", false, \
+		"Enable/Disable Polling mode for data path")
+
 #define CFG_DP \
 		CFG(CFG_DP_HTT_PACKET_TYPE) \
 		CFG(CFG_DP_INT_BATCH_THRESHOLD_OTHER) \
@@ -1047,5 +1051,6 @@
 		CFG(CFG_DP_RX_BUFF_POOL_ENABLE) \
 		CFG(CFG_DP_RX_PENDING_HL_THRESHOLD) \
 		CFG(CFG_DP_RX_PENDING_LO_THRESHOLD) \
-		CFG(CFG_DP_LEGACY_MODE_CSUM_DISABLE)
+		CFG(CFG_DP_LEGACY_MODE_CSUM_DISABLE) \
+		CFG(CFG_DP_POLL_MODE_ENABLE)
 #endif /* _CFG_DP_H_ */

+ 7 - 1
wlan_cfg/wlan_cfg.c

@@ -618,7 +618,8 @@ wlan_cfg_soc_attach(struct cdp_ctrl_objmgr_psoc *psoc)
 			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);
-
+	wlan_cfg_ctx->is_poll_mode_enabled =
+			cfg_get(psoc, CFG_DP_POLL_MODE_ENABLE);
 	return wlan_cfg_ctx;
 }
 
@@ -1357,6 +1358,11 @@ bool wlan_cfg_is_rx_fisa_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
 }
 #endif
 
+bool wlan_cfg_is_poll_mode_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
+{
+	return (bool)(cfg->is_poll_mode_enabled);
+}
+
 void
 wlan_cfg_set_rx_flow_search_table_per_pdev(struct wlan_cfg_dp_soc_ctxt *cfg,
 					   bool val)

+ 11 - 0
wlan_cfg/wlan_cfg.h

@@ -297,6 +297,7 @@ struct wlan_cfg_dp_soc_ctxt {
 	bool is_rx_buff_pool_enabled;
 	uint32_t rx_pending_high_threshold;
 	uint32_t rx_pending_low_threshold;
+	bool is_poll_mode_enabled;
 };
 
 /**
@@ -1420,3 +1421,13 @@ wlan_cfg_set_peer_ext_stats(struct wlan_cfg_dp_soc_ctxt *cfg,
  */
 bool
 wlan_cfg_is_peer_ext_stats_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
+
+/**
+ * wlan_cfg_is_poll_mode_enabled() - Check if poll mode is enabled
+ *
+ * @wlan_cfg_dp_soc_ctxt: soc configuration context
+ *
+ * Return: bool
+ */
+
+bool wlan_cfg_is_poll_mode_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);