Browse Source

qcacmn: Add parameter to support drain RX rings only

Add a parameter to support drain RX related rings only.

Change-Id: Id30e92646698bd6b409468c98934a1716763d1e3
CRs-Fixed: 3675835
Yu Tian 1 year ago
parent
commit
2a709c7cec
4 changed files with 12 additions and 7 deletions
  1. 3 2
      dp/inc/cdp_txrx_cmn.h
  2. 1 1
      dp/inc/cdp_txrx_ops.h
  3. 3 2
      dp/wifi3.0/dp_rings.h
  4. 5 2
      dp/wifi3.0/dp_rings_main.c

+ 3 - 2
dp/inc/cdp_txrx_cmn.h

@@ -3024,9 +3024,10 @@ cdp_wds_ext_set_bit(ol_txrx_soc_handle soc, uint8_t *mac)
 /**
  * cdp_drain_txrx() - drain TX/RX SRNGs
  * @soc: opaque soc handle
+ * @rx_only: drain only RX rings
  */
 static inline void
-cdp_drain_txrx(ol_txrx_soc_handle soc)
+cdp_drain_txrx(ol_txrx_soc_handle soc, uint8_t rx_only)
 {
 	if (!soc || !soc->ops) {
 		dp_cdp_debug("Invalid Instance");
@@ -3038,7 +3039,7 @@ cdp_drain_txrx(ol_txrx_soc_handle soc)
 	    !soc->ops->cmn_drv_ops->txrx_drain)
 		return;
 
-	return soc->ops->cmn_drv_ops->txrx_drain(soc);
+	return soc->ops->cmn_drv_ops->txrx_drain(soc, rx_only);
 }
 
 /**

+ 1 - 1
dp/inc/cdp_txrx_ops.h

@@ -717,7 +717,7 @@ struct cdp_cmn_ops {
 	QDF_STATUS (*set_wds_ext_peer_bit)(ol_txrx_soc_handle soc,
 					   uint8_t *mac);
 #endif /* QCA_SUPPORT_WDS_EXTENDED */
-	void (*txrx_drain)(ol_txrx_soc_handle soc);
+	void (*txrx_drain)(ol_txrx_soc_handle soc, uint8_t rx_only);
 	int (*get_free_desc_poolsize)(struct cdp_soc_t *soc);
 #ifdef WLAN_SYSFS_DP_STATS
 	QDF_STATUS (*txrx_sysfs_fill_stats)(ol_txrx_soc_handle soc,

+ 3 - 2
dp/wifi3.0/dp_rings.h

@@ -570,7 +570,7 @@ dp_dump_wbm_idle_hptp(struct dp_soc *soc, struct dp_pdev *pdev);
 void dp_display_srng_info(struct cdp_soc_t *soc_hdl);
 
 #if defined(DP_POWER_SAVE) || defined(FEATURE_RUNTIME_PM)
-void dp_drain_txrx(struct cdp_soc_t *soc_handle);
+void dp_drain_txrx(struct cdp_soc_t *soc_handle, uint8_t rx_only);
 
 /*
  * dp_update_ring_hptp() - update dp rings hptp
@@ -817,7 +817,8 @@ static inline void dp_display_srng_info(struct cdp_soc_t *soc_hdl)
 }
 
 #if defined(DP_POWER_SAVE) || defined(FEATURE_RUNTIME_PM)
-static inline void dp_drain_txrx(struct cdp_soc_t *soc_handle)
+static inline void dp_drain_txrx(struct cdp_soc_t *soc_handle,
+				 uint8_t rx_only)
 {
 }
 #endif

+ 5 - 2
dp/wifi3.0/dp_rings_main.c

@@ -2951,7 +2951,7 @@ QDF_STATUS dp_set_vdev_pcp_tid_map_wifi3(struct cdp_soc_t *soc_hdl,
 }
 
 #if defined(FEATURE_RUNTIME_PM) || defined(DP_POWER_SAVE)
-void dp_drain_txrx(struct cdp_soc_t *soc_handle)
+void dp_drain_txrx(struct cdp_soc_t *soc_handle, uint8_t rx_only)
 {
 	struct dp_soc *soc = (struct dp_soc *)soc_handle;
 	uint32_t cur_tx_limit, cur_rx_limit;
@@ -2971,8 +2971,11 @@ void dp_drain_txrx(struct cdp_soc_t *soc_handle)
 	 */
 	dp_update_soft_irq_limits(soc, budget, budget);
 
-	for (i = 0; i < wlan_cfg_get_num_contexts(soc->wlan_cfg_ctx); i++)
+	for (i = 0; i < wlan_cfg_get_num_contexts(soc->wlan_cfg_ctx); i++) {
+		if (rx_only && !soc->intr_ctx[i].rx_ring_mask)
+			continue;
 		soc->arch_ops.dp_service_srngs(&soc->intr_ctx[i], budget, cpu);
+	}
 
 	dp_update_soft_irq_limits(soc, cur_tx_limit, cur_rx_limit);